deployment.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "registry.fullname" . }}
  5. labels:
  6. app.kubernetes.io/name: {{ include "registry.name" . }}
  7. app.kubernetes.io/instance: {{ .Release.Name }}
  8. spec:
  9. replicas: {{ .Values.replicaCount }}
  10. selector:
  11. matchLabels:
  12. app.kubernetes.io/name: {{ include "registry.name" . }}
  13. template:
  14. metadata:
  15. labels:
  16. app.kubernetes.io/name: {{ include "registry.name" . }}
  17. app.kubernetes.io/instance: {{ .Release.Name }}
  18. spec:
  19. containers:
  20. - name: registry
  21. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  22. imagePullPolicy: {{ .Values.image.pullPolicy }}
  23. ports:
  24. - containerPort: {{ .Values.service.port }}
  25. name: http
  26. env:
  27. - name: REGISTRY_AUTH
  28. value: htpasswd
  29. - name: REGISTRY_AUTH_HTPASSWD_PATH
  30. value: /auth/htpasswd
  31. - name: REGISTRY_AUTH_HTPASSWD_REALM
  32. value: Registry Realm
  33. volumeMounts:
  34. - name: registry-storage
  35. mountPath: /var/lib/registry
  36. - name: auth
  37. mountPath: /auth
  38. volumes:
  39. - name: registry-storage
  40. persistentVolumeClaim:
  41. claimName: {{ include "registry.fullname" . }}-pvc
  42. - name: auth
  43. secret:
  44. secretName: {{ include "registry.fullname" . }}-auth
  45. items:
  46. - key: htpasswd
  47. path: htpasswd