|
| 1 | +--- |
| 2 | +apiVersion: v1 |
| 3 | +kind: Secret |
| 4 | +metadata: |
| 5 | + name: auth |
| 6 | + namespace: {{ .Release.Namespace }} |
| 7 | +stringData: |
| 8 | + htpasswd: {{ .Values.auth.htpasswd | quote }} |
| 9 | +--- |
| 10 | +apiVersion: v1 |
| 11 | +kind: Service |
| 12 | +metadata: |
| 13 | + name: registry |
| 14 | + namespace: {{ .Release.Namespace }} |
| 15 | + labels: |
| 16 | + {{- include "container-registry.labels" . | nindent 4 }} |
| 17 | +spec: |
| 18 | + type: ClusterIP |
| 19 | + selector: |
| 20 | + {{- include "container-registry.selectorLabels" . | nindent 4 }} |
| 21 | + ports: |
| 22 | + - name: registry |
| 23 | + port: 5000 |
| 24 | + targetPort: 5000 |
| 25 | +--- |
| 26 | +apiVersion: networking.k8s.io/v1 |
| 27 | +kind: Ingress |
| 28 | +metadata: |
| 29 | + annotations: |
| 30 | + kubernetes.io/ingress.class: traefik |
| 31 | + traefik.ingress.kubernetes.io/router.entrypoints: websecure |
| 32 | + traefik.ingress.kubernetes.io/router.tls: "true" |
| 33 | + labels: |
| 34 | + {{- include "container-registry.labels" . | nindent 4 }} |
| 35 | + name: registry |
| 36 | + namespace: {{ .Release.Namespace }} |
| 37 | +spec: |
| 38 | + rules: |
| 39 | + - host: {{ .Values.domain }} |
| 40 | + http: |
| 41 | + paths: |
| 42 | + - backend: |
| 43 | + service: |
| 44 | + name: registry |
| 45 | + port: |
| 46 | + number: 5000 |
| 47 | + path: / |
| 48 | + pathType: ImplementationSpecific |
| 49 | + tls: |
| 50 | + - hosts: |
| 51 | + - {{ .Values.domain }} |
| 52 | + secretName: epinio-registry-tls |
| 53 | +{{ if .Values.createNodePort }} |
| 54 | +--- |
| 55 | +apiVersion: v1 |
| 56 | +kind: Service |
| 57 | +metadata: |
| 58 | + name: registry-node |
| 59 | + namespace: {{ .Release.Namespace }} |
| 60 | + labels: |
| 61 | + {{- include "container-registry.labels" . | nindent 4 }} |
| 62 | +spec: |
| 63 | + type: NodePort |
| 64 | + selector: |
| 65 | + {{- include "container-registry.selectorLabels" . | nindent 4 }} |
| 66 | + ports: |
| 67 | + - name: registry |
| 68 | + port: 5000 |
| 69 | + targetPort: 5000 |
| 70 | + nodePort: 30500 |
| 71 | +{{- end }} |
| 72 | +--- |
| 73 | +apiVersion: apps/v1 |
| 74 | +kind: Deployment |
| 75 | +metadata: |
| 76 | + name: registry |
| 77 | + namespace: {{ .Release.Namespace }} |
| 78 | + labels: |
| 79 | + {{- include "container-registry.labels" . | nindent 4 }} |
| 80 | +spec: |
| 81 | + replicas: 1 |
| 82 | + selector: |
| 83 | + matchLabels: |
| 84 | + {{- include "container-registry.selectorLabels" . | nindent 6 }} |
| 85 | + template: |
| 86 | + metadata: |
| 87 | + labels: |
| 88 | + {{- include "container-registry.labels" . | nindent 8 }} |
| 89 | + spec: |
| 90 | + containers: |
| 91 | + - name: registry |
| 92 | + image: {{ .Values.registry.image }} |
| 93 | + imagePullPolicy: {{ .Values.registry.imagePullPolicy }} |
| 94 | + env: |
| 95 | + - name: REGISTRY_AUTH |
| 96 | + value: htpasswd |
| 97 | + - name: REGISTRY_AUTH_HTPASSWD_REALM |
| 98 | + value: Registry Realm |
| 99 | + - name: REGISTRY_AUTH_HTPASSWD_PATH |
| 100 | + value: /etc/registry/auth/htpasswd |
| 101 | + volumeMounts: |
| 102 | + - name: registry |
| 103 | + mountPath: /var/lib/registry |
| 104 | + readOnly: false |
| 105 | + - name: auth |
| 106 | + mountPath: /etc/registry/auth |
| 107 | + readOnly: true |
| 108 | + securityContext: |
| 109 | + runAsUser: 1000 |
| 110 | + runAsNonRoot: true |
| 111 | + allowPrivilegeEscalation: false |
| 112 | + readOnlyRootFilesystem: true |
| 113 | + livenessProbe: |
| 114 | + tcpSocket: |
| 115 | + port: 5000 |
| 116 | + initialDelaySeconds: 15 |
| 117 | + periodSeconds: 20 |
| 118 | + readinessProbe: |
| 119 | + tcpSocket: |
| 120 | + port: 5000 |
| 121 | + initialDelaySeconds: 5 |
| 122 | + periodSeconds: 5 |
| 123 | + volumes: |
| 124 | + - name: registry |
| 125 | + emptyDir: {} |
| 126 | + - name: auth |
| 127 | + secret: |
| 128 | + secretName: auth |
0 commit comments