Files
wordyne/Chart/templates/deployment.yaml

197 lines
6.6 KiB
YAML
Raw Normal View History

2023-03-17 23:13:46 +00:00
apiVersion: apps/v1
2023-03-19 10:07:25 +00:00
kind: Deployment
2023-03-17 23:13:46 +00:00
metadata:
2023-03-19 20:20:41 +00:00
name: {{ include "..fullname" . }}
2023-03-19 10:07:25 +00:00
labels:
{{- include "..labels" . | nindent 4 }}
2023-03-17 23:13:46 +00:00
spec:
2023-06-03 22:01:56 +00:00
{{- if .Values.site.resources }}
replicas: {{ .Values.site.resources.replicas | default 1 }}
{{- else }}
2023-03-19 10:07:25 +00:00
replicas: 1
2023-06-03 22:01:56 +00:00
{{- end }}
2023-03-19 10:07:25 +00:00
selector:
2023-09-23 13:41:10 +00:00
matchLabels:
{{- include "..selector-labels" . | nindent 6 }}
2023-03-19 10:07:25 +00:00
template:
metadata:
2023-09-23 13:41:10 +00:00
labels:
{{- include "..selector-labels" . | nindent 8 }}
2023-03-19 10:07:25 +00:00
spec:
securityContext:
2023-06-03 22:01:56 +00:00
fsGroup: 101
2023-03-19 10:07:25 +00:00
volumes:
- name: serverconfig
configMap:
name: {{ include "..fullname" . }}-cfg
2023-09-12 15:45:08 +02:00
{{- if and .Values.secrets .Values.secrets.external }}
{{- range .Values.secrets.external }}
{{- if eq .type "file" }}
- name: {{ .name }}
secret:
secretName: {{- include "..fullname" $ }}-exts-{{ .name }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.storage.kubernetes }}
{{- range .Values.storage.kubernetes }}
- name: {{ .name }}
{{- if eq .type "secret" }}
secret:
secretName: "{{- include "..fullname" $ }}-sec-{{ .name }}"
{{- end }}
{{- if eq .type "configmap" }}
configMap:
name: "{{- include "..fullname" $ }}-sec-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.storage.cloud.active }}
- name: cloud
persistentVolumeClaim:
claimName: pvc-{{- include "..name" . }}-cloud
{{- end }}
{{- if .Values.storage.local.active }}
- name: local
persistentVolumeClaim:
claimName: pvc-{{- include "..name" . }}-local
{{- end }}
{{- if and .Values.secrets .Values.secrets.external }}
{{- range .Values.secrets.external }}
{{- if eq .type "docker" }}
2023-06-04 07:58:00 +00:00
imagePullSecrets:
2023-09-12 15:45:08 +02:00
- name: "{{- include "..fullname" $ }}-exts-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.storage.kubernetes }}
{{- range .Values.storage.kubernetes }}
{{- if eq .type "docker" }}
imagePullSecrets:
- name: "{{- include "..fullname" $ }}-sec-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
{{- if not .Values.init.asJob }}
2023-03-19 10:07:25 +00:00
initContainers:
2023-09-13 13:43:29 +02:00
{{- if and .Values.storage.cloud.active .Values.storage.local.active .Values.storage.local.cloneCloud }}
2023-09-12 15:45:08 +02:00
- name: init-local-storage
2023-06-29 22:04:37 +02:00
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
image: cloudyne/ubuntu-ci:latest
2023-06-29 22:28:15 +02:00
command: ["python3"]
2023-09-12 15:45:08 +02:00
args: ["/usr/local/bin/storage-clone", "/mnt/cloud", "/mnt/local"]
imagePullPolicy: Always
2023-06-29 22:04:37 +02:00
volumeMounts:
- name: cloud
2023-09-12 15:45:08 +02:00
mountPath: /mnt/cloud
- name: local
mountPath: /mnt/local
{{- end }}
- name: init-site
2023-03-19 10:07:25 +00:00
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
2023-09-12 15:45:08 +02:00
image: "{{ .Values.site.image }}"
2023-03-19 10:07:25 +00:00
imagePullPolicy: Always
volumeMounts:
- name: serverconfig
mountPath: /init-go/config.json
subPath: init.json
2024-02-22 19:32:00 +00:00
{{- if .Values.storage.cloud.active }}
- name: cloud
mountPath: "/mnt/cloud"
{{- end }}
2023-09-12 15:45:08 +02:00
{{- if .Values.storage.local.active }}
{{- range .Values.storage.folders }}
- name: local
mountPath: "/app/web/app/{{ . }}"
subPath: "{{ . }}"
2023-06-03 22:01:56 +00:00
{{- end }}
2023-09-12 15:45:08 +02:00
{{- else }}
{{- if .Values.storage.cloud.active }}
{{- range .Values.storage.folders }}
- name: cloud
mountPath: "/app/web/app/{{ . }}"
subPath: "{{ . }}"
{{- end }}
{{- end }}
2023-03-19 10:07:25 +00:00
{{- end }}
2023-03-19 10:07:25 +00:00
envFrom:
- configMapRef:
name: {{ include "..fullname" . }}-env
2023-09-12 15:45:08 +02:00
{{- if and .Values.secrets .Values.secrets.external }}
{{- range .Values.secrets.external }}
{{- if eq .type "env" }}
2023-03-19 10:07:25 +00:00
- secretRef:
2023-09-12 15:45:08 +02:00
name: "{{- include "..fullname" $ }}-exts-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
2023-03-19 20:20:41 +00:00
- secretRef:
2023-09-12 15:45:08 +02:00
name: {{ include "..fullname" . }}-db-auth
2023-07-10 18:56:09 +02:00
command: ["sh"]
args: ["-c", "/init-go/init-go"]
{{- end }}
2023-03-19 10:07:25 +00:00
containers:
- name: wordpress
securityContext:
2023-06-03 22:01:56 +00:00
runAsUser: 101
2023-09-12 15:45:08 +02:00
image: "{{ .Values.site.image }}"
2023-10-05 18:27:07 +02:00
imagePullPolicy: Always
2023-03-19 10:07:25 +00:00
volumeMounts:
2023-09-13 10:04:13 +02:00
- name: serverconfig
mountPath: /docker-entrypoint.d/unit.json
subPath: unit.json
2024-02-22 15:15:18 +00:00
{{- if .Values.storage.cloud.active }}
- name: cloud
mountPath: "/mnt/cloud"
{{- end }}
2023-09-12 15:45:08 +02:00
{{- if .Values.storage.local.active }}
2024-02-23 18:17:45 +00:00
{{- range .Values.storage.folders }}
2024-02-23 19:19:59 +01:00
{{- if or ( eq . "certificates" ) ( eq . "secrets" ) }}
2024-02-23 19:26:34 +01:00
- name: local
2024-02-23 18:17:45 +00:00
mountPath: "/app/{{ . }}"
subPath: "{{ . }}"
{{- else }}
2024-02-23 19:26:34 +01:00
- name: local
2023-09-12 15:45:08 +02:00
mountPath: "/app/web/app/{{ . }}"
subPath: "{{ . }}"
2024-02-23 18:17:45 +00:00
{{- end }}
{{- end }}
2023-09-12 15:45:08 +02:00
{{- else }}
{{- if .Values.storage.cloud.active }}
{{- range .Values.storage.folders }}
2024-02-23 19:26:34 +01:00
{{- if or ( eq . "certificates" ) ( eq . "secrets" ) }}
- name: cloud
mountPath: "/app/{{ . }}"
subPath: "{{ . }}"
{{- else }}
2023-09-12 15:45:08 +02:00
- name: cloud
mountPath: "/app/web/app/{{ . }}"
subPath: "{{ . }}"
2024-02-23 19:26:34 +01:00
{{- end }}
2023-09-12 15:45:08 +02:00
{{- end }}
{{- end }}
2023-03-19 10:07:25 +00:00
{{- end }}
2023-09-12 15:45:08 +02:00
{{- include "..resourcelimits" . | nindent 10 }}
2023-03-19 10:07:25 +00:00
envFrom:
- configMapRef:
name: {{ include "..fullname" . }}-env
2023-09-12 15:45:08 +02:00
{{- if and .Values.secrets .Values.secrets.external }}
{{- range .Values.secrets.external }}
{{- if eq .type "env" }}
2023-03-19 10:07:25 +00:00
- secretRef:
2023-09-12 15:45:08 +02:00
name: "{{- include "..fullname" $ }}-exts-{{ .name }}"
{{- end }}
{{- end }}
{{- end }}
2023-03-19 20:20:41 +00:00
- secretRef:
2023-09-12 15:45:08 +02:00
name: {{ include "..fullname" . }}-db-auth
2023-03-19 10:07:25 +00:00
ports:
- containerPort: 8080
name: http
2024-02-23 19:19:59 +01:00
protocol: TCP