ungleich-k8s/apps/docker-cache/templates/deployment.yaml

83 lines
2.1 KiB
YAML
Raw Normal View History

2021-12-04 19:44:30 +00:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-registry
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-registry
replicas: 1
2021-12-04 20:15:42 +00:00
strategy:
type: Recreate
2021-12-04 19:44:30 +00:00
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
2021-12-04 20:15:42 +00:00
env:
- name: REGISTRY_PROXY_REMOTEURL
2021-12-04 13:49:08 +00:00
value: {{ .Values.registry }}
2021-12-04 19:44:30 +00:00
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 }}