Files
Kubernetes/DockerRegistry/docker_registry_deploy.yaml

48 lines
1.3 KiB
YAML

# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: docker-registry
namespace: registry
spec:
replicas: 1
selector:
matchLabels:
app: docker-registry
template:
metadata:
labels:
app: docker-registry
spec:
containers:
- name: registry
image: registry:2
ports:
- containerPort: 5000
env:
- name: REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY
value: /var/lib/registry
- name: REGISTRY_HTTP_RELATIVEURLS
value: "true"
- name: REGISTRY_AUTH
value: htpasswd
- name: REGISTRY_AUTH_HTPASSWD_REALM
value: "registry.mariushome.lt"
- name: REGISTRY_AUTH_HTPASSWD_PATH
value: /auth/htpasswd
volumeMounts:
- name: registry-storage
mountPath: /var/lib/registry
- name: registry-htpasswd
mountPath: /auth
readOnly: true
volumes:
- name: registry-storage
persistentVolumeClaim:
claimName: registry-pvc
- name: registry-htpasswd
secret:
secretName: registry-htpasswd
items:
- key: htpasswd
path: htpasswd