ungleich-k8s/apps/docker-cache/templates/deployment.yaml
2021-12-04 21:15:42 +01:00

82 lines
2.1 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-registry
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-registry
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: {{ .Release.Name }}-registry
use-as-service: {{ .Release.Name }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/nginxconf.yaml") . | sha256sum }}
spec:
containers:
- name: nginx
image: ungleich/ungleich-certbot:0.3.2
ports:
- containerPort: 443
name: https
- containerPort: 80
name: http
env:
- name: DOMAIN
value: "{{ tpl .Values.fqdn . }}"
- name: EMAIL
value: "{{ .Values.email }}"
- name: NGINX
value: "yes"
{{ if eq .Values.letsencryptStaging "no" }}
- name: STAGING
value: "no"
{{ end }}
volumeMounts:
- name: nginx-config
mountPath: "/etc/nginx/conf.d/"
- name: etcletsencrypt
mountPath: "/etc/letsencrypt"
- name: registry
image: registry:{{ .Chart.AppVersion }}
ports:
- containerPort: 5000
env:
- name: REGISTRY_PROXY_REMOTEURL
value: https://registry-1.docker.io
volumeMounts:
- name: data
mountPath: "/var/lib/registry"
volumes:
- name: etcletsencrypt
persistentVolumeClaim:
claimName: {{ .Release.Name }}-letsencrypt-certs
- name: nginx-config
configMap:
name: {{ .Release.Name }}-nginx-config
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-data
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app: {{ .Release.Name }}
spec:
type: ClusterIP
ports:
# Required for letsencrypt
- port: 80
name: http
- port: 443
name: https
selector:
use-as-service: {{ .Release.Name }}