Initial chart: odoosky-system namespace + local container registry (Distribution v2)
This commit is contained in:
7
templates/namespace.yaml
Normal file
7
templates/namespace.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .Values.namespace }}
|
||||
labels:
|
||||
odoosky.io/component: platform
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
92
templates/registry.yaml
Normal file
92
templates/registry.yaml
Normal file
@@ -0,0 +1,92 @@
|
||||
{{- if .Values.registry.enabled -}}
|
||||
# Local container registry. Single replica — addon images are
|
||||
# rebuildable from Gitea source, so we trade HA for simplicity.
|
||||
# A node failure means a brief gap in image availability that
|
||||
# Tower's ensureAddonImage can recover from on the next pull.
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: registry
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
odoosky.io/component: registry
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.registry.persistence.size | quote }}
|
||||
{{- with .Values.registry.persistence.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: registry
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
odoosky.io/component: registry
|
||||
spec:
|
||||
replicas: 1
|
||||
# Recreate (not RollingUpdate): the PVC is RWO, so two registry
|
||||
# pods overlapping would block on the volume mount.
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
odoosky.io/component: registry
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
odoosky.io/component: registry
|
||||
spec:
|
||||
containers:
|
||||
- name: registry
|
||||
image: "{{ .Values.registry.image.repository }}:{{ .Values.registry.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.registry.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 5000
|
||||
env:
|
||||
# Allow image deletes via the API (Tower may garbage-collect
|
||||
# unused addon-versions later).
|
||||
- name: REGISTRY_STORAGE_DELETE_ENABLED
|
||||
value: "true"
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/registry
|
||||
resources:
|
||||
{{- toYaml .Values.registry.resources | nindent 12 }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 5000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 5000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 30
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: registry
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: registry
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
odoosky.io/component: registry
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.registry.service.port }}
|
||||
targetPort: 5000
|
||||
selector:
|
||||
odoosky.io/component: registry
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user