Files
wordyne/Chart/templates/deployment.yaml

125 lines
4.5 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 }}
cloudyne.systems/component: site
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:
matchLabels:
2023-06-04 08:29:32 +00:00
cloudyne.systems/customer: {{ .Values.customer.legalName | replace " " "-" | lower | trunc 63 }}
2023-06-03 22:01:56 +00:00
cloudyne.systems/customer-legal-id: {{ .Values.customer.legalId }}
cloudyne.systems/site: {{ .Values.site.domain }}
2023-03-19 10:07:25 +00:00
template:
metadata:
labels:
2023-06-04 08:29:32 +00:00
cloudyne.systems/customer: {{ .Values.customer.legalName | replace " " "-" | lower | trunc 63 }}
2023-06-03 22:01:56 +00:00
cloudyne.systems/customer-legal-id: {{ .Values.customer.legalId }}
cloudyne.systems/site: {{ .Values.site.domain }}
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: cloud
persistentVolumeClaim:
claimName: pvc-{{ include "..fullname" . }}
2023-06-29 22:04:37 +02:00
- name: cloud-local
persistentVolumeClaim:
claimName: pvc-{{ include "..fullname" . }}-local
2023-03-19 10:07:25 +00:00
- name: serverconfig
configMap:
name: {{ include "..fullname" . }}-cfg
2023-06-04 07:58:00 +00:00
imagePullSecrets:
- name: pull-secret
2023-03-19 10:07:25 +00:00
initContainers:
2023-06-29 22:04:37 +02:00
- name: init-storage
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
image: cloudyne/ubuntu-ci:latest
command: ["storage-clone"]
args: ["/full-cloud", "/full-cloud-local"]
imagePullPolicy: Always
volumeMounts:
- name: cloud
mountPath: /full-cloud
- name: cloud-local
mountPath: /full-cloud-local
2023-03-19 10:07:25 +00:00
- name: deploy
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
2023-06-03 22:01:56 +00:00
image: "cloudyne.azurecr.io/buildahome/{{ .Values.site.name | default ( .Values.site.domain | replace "." "-" ) }}:{{ .Values.site.imageTag | default "latest" }}"
2023-03-19 10:07:25 +00:00
imagePullPolicy: Always
volumeMounts:
- name: cloud
mountPath: /full-cloud
- name: serverconfig
mountPath: /init-go/config.json
subPath: init.json
2023-06-03 22:01:56 +00:00
{{- if .Values.storage.wpContent }}
{{- range $v := .Values.storage.wpContent }}
2023-06-29 22:04:37 +02:00
- name: cloud-local
2023-06-03 22:01:56 +00:00
mountPath: "/app/web/app/{{ $v }}"
subPath: "{{ $v }}"
{{- end }}
{{- end }}
{{- if .Values.storage.additionalMounts }}
{{- range $v := .Values.storage.additionalMounts }}
2023-06-29 22:04:37 +02:00
- name: cloud-local
2023-03-19 10:07:25 +00:00
mountPath: {{ $v.localPath }}
subPath: {{ $v.cloudPath }}
{{- end }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "..fullname" . }}-env
- secretRef:
name: {{ include "..fullname" . }}-db-auth
2023-03-19 20:20:41 +00:00
- secretRef:
2023-03-19 22:43:41 +00:00
name: global-secrets
2023-06-04 08:41:01 +00:00
command: [ "/init-go/init-go" ]
2023-03-19 10:07:25 +00:00
containers:
- name: wordpress
securityContext:
2023-06-03 22:01:56 +00:00
runAsUser: 101
image: "cloudyne.azurecr.io/buildahome/{{ .Values.site.name | default ( .Values.site.domain | replace "." "-" ) }}:{{ .Values.site.imageTag | default "latest" }}"
2023-03-19 10:07:25 +00:00
imagePullPolicy: Always
volumeMounts:
- name: serverconfig
2023-06-03 22:01:56 +00:00
mountPath: /docker-entrypoint.d/unit.json
subPath: unit.json
{{- if .Values.storage.wpContent }}
{{- range $v := .Values.storage.wpContent }}
2023-06-29 22:04:37 +02:00
- name: cloud-local
2023-06-03 22:01:56 +00:00
mountPath: "/app/web/app/{{ $v }}"
subPath: "{{ $v }}"
{{- end }}
{{- end }}
{{- if .Values.storage.additionalMounts }}
{{- range $v := .Values.storage.additionalMounts }}
2023-06-29 22:04:37 +02:00
- name: cloud-local
2023-03-19 10:07:25 +00:00
mountPath: {{ $v.localPath }}
subPath: {{ $v.cloudPath }}
{{- end }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "..fullname" . }}-env
- secretRef:
name: {{ include "..fullname" . }}-db-auth
2023-03-19 20:20:41 +00:00
- secretRef:
2023-03-19 22:43:41 +00:00
name: global-secrets
2023-06-03 22:01:56 +00:00
{{- include "..resourcelimits" . | nindent 10 }}
2023-03-19 10:07:25 +00:00
ports:
- containerPort: 8080
name: http
protocol: TCP
2023-03-23 09:05:12 +01:00