Created
May 2, 2017 16:31
-
-
Save coco98/b750b3debc6d517308596c248daf3bb1 to your computer and use it in GitHub Desktop.
Docker registry on minikube
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: kube-registry-v0 | |
namespace: kube-system | |
labels: | |
k8s-app: kube-registry | |
version: v0 | |
spec: | |
replicas: 1 | |
selector: | |
k8s-app: kube-registry | |
version: v0 | |
template: | |
metadata: | |
labels: | |
k8s-app: kube-registry | |
version: v0 | |
spec: | |
containers: | |
- name: registry | |
image: registry:2.5.1 | |
resources: | |
# keep request = limit to keep this container in guaranteed class | |
limits: | |
cpu: 100m | |
memory: 100Mi | |
requests: | |
cpu: 100m | |
memory: 100Mi | |
env: | |
- name: REGISTRY_HTTP_ADDR | |
value: :5000 | |
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY | |
value: /var/lib/registry | |
volumeMounts: | |
- name: image-store | |
mountPath: /var/lib/registry | |
ports: | |
- containerPort: 5000 | |
name: registry | |
protocol: TCP | |
volumes: | |
- name: image-store | |
hostPath: | |
path: /data/registry/ | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: kube-registry | |
namespace: kube-system | |
labels: | |
k8s-app: kube-registry | |
spec: | |
selector: | |
k8s-app: kube-registry | |
ports: | |
- name: registry | |
port: 5000 | |
protocol: TCP | |
--- | |
apiVersion: extensions/v1beta1 | |
kind: DaemonSet | |
metadata: | |
name: kube-registry-proxy | |
namespace: kube-system | |
labels: | |
k8s-app: kube-registry | |
kubernetes.io/cluster-service: "true" | |
version: v0.4 | |
spec: | |
template: | |
metadata: | |
labels: | |
k8s-app: kube-registry | |
version: v0.4 | |
spec: | |
containers: | |
- name: kube-registry-proxy | |
image: gcr.io/google_containers/kube-registry-proxy:0.4 | |
resources: | |
limits: | |
cpu: 100m | |
memory: 50Mi | |
env: | |
- name: REGISTRY_HOST | |
value: kube-registry.kube-system.svc.cluster.local | |
- name: REGISTRY_PORT | |
value: "5000" | |
ports: | |
- name: registry | |
containerPort: 80 | |
hostPort: 5000 |
I also ran into the issue above. I'm using rootless docker fwiw. As a workaround, I added the result of minikube ip
as an insecure registry in my docker daemon and restarted it. I was able to docker push $(minikube ip):5000/<image>:<tag>
and pulling on cluster side worked fine as localhost:5000/<image>:<tag>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello - I'm getting a connection refused error, not sure what's causing it.
My setup:
MacOS with docker desktop, created kubernetes cluster with 3 nodes:
I added localhost:5000 as an insecure registry in docker desktop's "Docker Engine" setting; not sure if this matters but I've tried both with and without:
Steps:
1.
Setup the registry2.
Created a port-forward:3.
Built docker image of a sample app and tagged it:4.
Attempted to push image to registry but ended up with the error:5.
I can curl the registry just fine:Any ideas?