updated readme and restructure project
This commit is contained in:
5
kubernetes/docker-registry-helm-chart/Chart.yaml
Normal file
5
kubernetes/docker-registry-helm-chart/Chart.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
apiVersion: v2
|
||||
name: docker-registry-helm-chart
|
||||
description: A Helm chart for deploying a Docker registry
|
||||
version: 0.1.0
|
||||
appVersion: "latest"
|
||||
@ -0,0 +1,49 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.name }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
replicas: {{ .Values.deployment.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.name }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Values.name }}
|
||||
image: {{ .Values.deployment.image }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.deployment.containerPort }}
|
||||
env:
|
||||
- name: REGISTRY_AUTH
|
||||
value: "htpasswd"
|
||||
- name: REGISTRY_AUTH_HTPASSWD_REALM
|
||||
value: "Registry Realm"
|
||||
- name: REGISTRY_AUTH_HTPASSWD_PATH
|
||||
value: "/auth/registry-passwords"
|
||||
- name: REGISTRY_AUTH_HTPASSWD_FILE
|
||||
value: "/auth/registry-passwords"
|
||||
- name: REGISTRY_HTTP_HEADERS
|
||||
value: |
|
||||
Access-Control-Allow-Origin: ['{{ .Values.uiDomain }}']
|
||||
Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE', 'POST', 'PUT']
|
||||
Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Content-Type', 'X-Requested-With', 'Cache-Control']
|
||||
Access-Control-Max-Age: [1728000]
|
||||
Access-Control-Allow-Credentials: [true]
|
||||
Access-Control-Expose-Headers: ['Docker-Content-Digest']
|
||||
volumeMounts:
|
||||
- name: {{ .Values.deployment.registryStorageVolumeName }}
|
||||
mountPath: /var/lib/registry
|
||||
- name: {{ .Values.deployment.authStorageVolumeName }}
|
||||
mountPath: /auth
|
||||
volumes:
|
||||
- name: {{ .Values.deployment.registryStorageVolumeName }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.pvc.claimName }}
|
||||
- name: {{ .Values.deployment.authStorageVolumeName }}
|
||||
secret:
|
||||
secretName: {{ .Values.credentialSecret.name }}
|
||||
29
kubernetes/docker-registry-helm-chart/templates/ingress.yaml
Normal file
29
kubernetes/docker-registry-helm-chart/templates/ingress.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ .Values.name }}-ingress
|
||||
namespace: {{ .Values.namespace }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.ingress.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
- host: "{{ .Values.host }}"
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ .Values.name }}-service
|
||||
port:
|
||||
number: 5000
|
||||
{{- if .Values.ingress.tls.enabled }}
|
||||
tls:
|
||||
- hosts:
|
||||
- "{{ .Values.ingress.tls.host }}"
|
||||
secretName: {{ .Values.ingress.tls.secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
11
kubernetes/docker-registry-helm-chart/templates/pvc.yaml
Normal file
11
kubernetes/docker-registry-helm-chart/templates/pvc.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.pvc.claimName }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.pvc.accessMode }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.pvc.size }}
|
||||
13
kubernetes/docker-registry-helm-chart/templates/service.yaml
Normal file
13
kubernetes/docker-registry-helm-chart/templates/service.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.name }}-service
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ .Values.name }}
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: {{ .Values.deployment.containerPort }}
|
||||
type: {{ .Values.service.type }}
|
||||
34
kubernetes/docker-registry-helm-chart/values.yaml
Normal file
34
kubernetes/docker-registry-helm-chart/values.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
name: registry
|
||||
namespace: docker-registry
|
||||
storage: 5Gi
|
||||
host: registry.example.com
|
||||
|
||||
deployment:
|
||||
replicas: 1
|
||||
containerPort: 5000
|
||||
image: registry:2
|
||||
registryStorageVolumeName: registry-storage
|
||||
authStorageVolumeName: auth-storage
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||
tls:
|
||||
enabled: true
|
||||
host: "*.example.com"
|
||||
secretName: wildcard-cert-secret
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 5000
|
||||
|
||||
pvc:
|
||||
claimName: registry-pvc
|
||||
enabled: true
|
||||
storageClass: longhorn
|
||||
accessMode: ReadWriteOnce
|
||||
size: 5Gi
|
||||
|
||||
credentialSecret:
|
||||
name: registry-credentials
|
||||
Reference in New Issue
Block a user