
The documentation defines a couple of replication-controller and service to provision a docker-registry somewhere on the cluster and have it available by the name viz. A record of kube-registry.default.svc.<clustername>. On each node, http-proxies are placed as daemon-set with the kube-registry DNS name set as upstream, so that the registry is available on each host under endpoint localhost:5000 Because in the documentation, selector-identifiers are the same for "upstream" registry and proxies, the proxies themselves register under the service intended for the upstream and now have themselves as upstream under a different port, where connection attempts result in "connection refused". Adapting selectors to be unique as in this patch fixes the problem. modified: cluster/addons/registry/README.md modified: cluster/addons/registry/registry-rc.yaml modified: cluster/addons/registry/registry-svc.yaml
50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
apiVersion: v1
|
|
kind: ReplicationController
|
|
metadata:
|
|
name: kube-registry-v0
|
|
namespace: kube-system
|
|
labels:
|
|
k8s-app: kube-registry-upstream
|
|
version: v0
|
|
kubernetes.io/cluster-service: "true"
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
k8s-app: kube-registry-upstream
|
|
version: v0
|
|
template:
|
|
metadata:
|
|
labels:
|
|
k8s-app: kube-registry-upstream
|
|
version: v0
|
|
kubernetes.io/cluster-service: "true"
|
|
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
|
|
persistentVolumeClaim:
|
|
claimName: kube-registry-pvc
|