Docker registry on a cluster
This file contains 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 | |
# Versions < 2.6 don't have arm support | |
image: registry:2.7.1 | |
imagePullPolicy: Always | |
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: apps/v1 | |
kind: DaemonSet | |
metadata: | |
name: kube-registry-proxy | |
namespace: kube-system | |
labels: | |
k8s-app: kube-registry-proxy | |
kubernetes.io/cluster-service: "true" | |
version: v0.4 | |
spec: | |
selector: | |
matchLabels: | |
k8s-app: kube-registry-proxy | |
version: v0.4 | |
template: | |
metadata: | |
labels: | |
k8s-app: kube-registry-proxy | |
version: v0.4 | |
spec: | |
containers: | |
- name: kube-registry-proxy | |
image: gcr.io/google_containers/kube-registry-proxy:0.4 | |
imagePullPolicy: Always | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A version that allows running on multi-node setup without having a high chance of failure based on this issue