2a40e6d4 by Adam Heath

Updates and refactors needed to allow the storage backend for the

registry to be changed.
1 parent 1e1af139
......@@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: registry-config
name: registry-env
data:
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/tls.crt
REGISTRY_HTTP_TLS_KEY: /certs/tls.key
......@@ -10,7 +10,7 @@ data:
apiVersion: v1
kind: Secret
metadata:
name: registry-secret
name: registry-env
stringData:
---
apiVersion: v1
......
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
......@@ -5,3 +5,10 @@ resources:
- ./config.yaml
- ./registry.yaml
configMapGenerator:
- name: registry-etc
options:
disableNameSuffixHash: true
files:
- ./etc/config.yaml
......
......@@ -85,16 +85,21 @@ spec:
- name: certificate
secret:
secretName: registry-crt
- name: registry-etc
configMap:
name: registry-etc
containers:
- name: registry
image: registry:2
envFrom:
- configMapRef:
name: registry-config
name: registry-env
- secretRef:
name: registry-secret
name: registry-env
volumeMounts:
- name: registry-etc
mountPath: /etc/docker/registry/
- name: registry-data
mountPath: /var/lib/registry
- name: certificate
......
......@@ -10,6 +10,10 @@ registry:
nodePort: 0
clusterIP: 0
type: NodePort
etc: null
env:
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
secrets: {}
certificate:
hostNames:
- registry.local
......
......@@ -118,6 +118,9 @@ releases:
app: {{ .Values.namePrefix }}registry
spec:
volumes:
- name: registry-etc
configMap:
name: {{ .Values.namePrefix }}registry-etc
- name: registry-data
persistentVolumeClaim:
claimName: {{ .Values.namePrefix }}registry-data
......@@ -125,23 +128,32 @@ releases:
- name: registry
envFrom:
- configMapRef:
name: {{ .Values.namePrefix }}registry-config
name: {{ .Values.namePrefix }}registry-env
- secretRef:
name: {{ .Values.namePrefix }}registry-secret
name: {{ .Values.namePrefix }}registry-env
- apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.namePrefix }}registry-config
name: {{ .Values.namePrefix }}registry-env
namespace: {{ .Values.namespace }}
data:
REGISTRY_REDIS_ADDR: {{ .Values.namePrefix }}registry-redis.{{ .Values.namespace }}.svc.cluster.local
REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR: redis
{{- .Values.registry.env | toYaml | nindent 10 }}
{{- if .Values.registry.etc }}
- apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.namePrefix }}registry-etc
namespace: {{ .Values.namespace }}
data: {{ .Values.registry.etc | toYaml | nindent 10 }}
{{- end }}
- apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.namePrefix }}registry-secret
name: {{ .Values.namePrefix }}registry-env
namespace: {{ .Values.namespace }}
stringData:
stringData: {{- .Values.registry.secrets | toYaml | nindent 10 }}
{{- if not (empty (.Values.registry.strategicMergePatches)) }}
{{- .Values.registry.strategicMergePatches | toYaml | indent 6 }}
{{- end }}
......