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-03-19 10:07:25 +00:00
|
|
|
{{- if and .Values.customer .Values.customer.package }}
|
|
|
|
|
replicas: {{ .Values.customer.package.replicas | default 1 }}
|
|
|
|
|
{{- else }}
|
|
|
|
|
replicas: 1
|
|
|
|
|
{{- end }}
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
cloudyne.systems/customer: {{ .Values.customer.name }}
|
|
|
|
|
cloudyne.systems/site: {{ .Values.site.url }}
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
|
|
|
|
cloudyne.systems/customer: {{ .Values.customer.name }}
|
|
|
|
|
cloudyne.systems/site: {{ .Values.site.url }}
|
|
|
|
|
spec:
|
|
|
|
|
securityContext:
|
|
|
|
|
fsGroup: 65534
|
|
|
|
|
volumes:
|
|
|
|
|
- name: cloud
|
|
|
|
|
persistentVolumeClaim:
|
|
|
|
|
claimName: pvc-{{ include "..fullname" . }}
|
|
|
|
|
- name: local
|
|
|
|
|
emptyDir: {}
|
|
|
|
|
- name: serverconfig
|
|
|
|
|
configMap:
|
|
|
|
|
name: {{ include "..fullname" . }}-cfg
|
|
|
|
|
initContainers:
|
|
|
|
|
- name: deploy
|
|
|
|
|
securityContext:
|
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
|
runAsUser: 0
|
|
|
|
|
{{- if .Values.global }}
|
|
|
|
|
image: {{ .Values.global.initImage | default "ghcr.io/cloudynes/php-init" }}:{{ .Values.global.imagetag | default "latest" }}
|
|
|
|
|
{{- else }}
|
|
|
|
|
image: ghcr.io/cloudynes/php-init:latest
|
|
|
|
|
{{- end }}
|
|
|
|
|
imagePullPolicy: Always
|
|
|
|
|
volumeMounts:
|
2023-03-19 20:20:41 +00:00
|
|
|
- name: local
|
2023-03-19 10:07:25 +00:00
|
|
|
mountPath: /app
|
2023-03-27 14:44:49 +02:00
|
|
|
- name: cloud
|
|
|
|
|
mountPath: /full-cloud
|
2023-03-19 10:07:25 +00:00
|
|
|
{{- if and .Values.site .Values.site.storage .Values.site.storage.cloud .Values.site.storage.cloud.folders }}
|
|
|
|
|
{{- range $v := .Values.site.storage.cloud.folders }}
|
|
|
|
|
- name: cloud
|
|
|
|
|
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-03-19 10:07:25 +00:00
|
|
|
containers:
|
|
|
|
|
- name: wordpress
|
|
|
|
|
securityContext:
|
|
|
|
|
runAsUser: 65534
|
|
|
|
|
{{- if .Values.global }}
|
2023-03-19 22:43:41 +00:00
|
|
|
image: {{ .Values.global.serverImage | default "ghcr.io/cloudynes/php-nginx" }}:{{ .Values.global.imagetag | default "latest" }}
|
2023-03-19 10:07:25 +00:00
|
|
|
{{- else }}
|
|
|
|
|
image: ghcr.io/cloudynes/php-nginx:latest
|
|
|
|
|
{{- end }}
|
|
|
|
|
imagePullPolicy: Always
|
|
|
|
|
volumeMounts:
|
2023-03-19 20:20:41 +00:00
|
|
|
- name: local
|
2023-03-19 10:07:25 +00:00
|
|
|
mountPath: /app
|
|
|
|
|
- name: serverconfig
|
2023-03-23 09:05:12 +01:00
|
|
|
mountPath: /etc/nginx/nginx.conf
|
2023-03-19 10:07:25 +00:00
|
|
|
subPath: nginx.conf
|
|
|
|
|
- name: serverconfig
|
|
|
|
|
mountPath: /usr/local/etc/php-fpm.d/www.conf
|
2023-03-19 22:43:41 +00:00
|
|
|
subPath: www.conf
|
2023-03-19 10:07:25 +00:00
|
|
|
{{- if and .Values.site .Values.site.storage .Values.site.storage.cloud .Values.site.storage.cloud.folders }}
|
|
|
|
|
{{- range $v := .Values.site.storage.cloud.folders }}
|
|
|
|
|
- name: cloud
|
|
|
|
|
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-03-19 10:07:25 +00:00
|
|
|
resources:
|
|
|
|
|
{{- if and .Values.customer .Values.customer.package .Values.customer.package.cpu }}
|
|
|
|
|
requests:
|
|
|
|
|
cpu: {{ .Values.customer.package.cpu.avg | default "1000m" }}
|
|
|
|
|
memory: {{ .Values.customer.package.mem.avg | default "1Gi" }}
|
|
|
|
|
limits:
|
|
|
|
|
cpu: {{ .Values.customer.package.cpu.peak | default "1000m" }}
|
|
|
|
|
memory: {{ .Values.customer.package.mem.peak | default "1Gi" }}
|
|
|
|
|
{{- else }}
|
|
|
|
|
requests:
|
|
|
|
|
cpu: 1000m
|
|
|
|
|
memory: 1Gi
|
|
|
|
|
limits:
|
|
|
|
|
cpu: 1000m
|
|
|
|
|
memory: 1Gi
|
|
|
|
|
{{- end }}
|
|
|
|
|
ports:
|
|
|
|
|
- containerPort: 8080
|
|
|
|
|
name: http
|
|
|
|
|
protocol: TCP
|
2023-03-23 09:05:12 +01:00
|
|
|
|