wordpress-helm/charts/templates/deployment.yaml
Rebecca Valente 47c42f0430
Some checks failed
package-helm-chart / package-helm-chart (push) Failing after 2m49s
initial commit
2025-09-22 19:03:15 -03:00

119 lines
4.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "wordpress-website.fullname" . }}
labels:
{{- include "wordpress-website.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "wordpress-website.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "wordpress-website.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "wordpress-website.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
env:
- name: WORDPRESS_DB_HOST
value: {{ .Values.postgresql.host }}
- name: WORDPRESS_DB_NAME
value: {{ .Values.postgresql.database }}
- name: WORDPRESS_DB_USER
value: {{ .Values.postgresql.username }}
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "wordpress-website.fullname" . }}-postgresql
key: postgresql-password
- name: WORDPRESS_TABLE_PREFIX
value: {{ .Values.wordpress.tablePrefix }}
{{- if .Values.wordpress.authKey }}
- name: WORDPRESS_AUTH_KEY
value: {{ .Values.wordpress.authKey }}
{{- end }}
{{- if .Values.wordpress.secureAuthKey }}
- name: WORDPRESS_SECURE_AUTH_KEY
value: {{ .Values.wordpress.secureAuthKey }}
{{- end }}
{{- if .Values.wordpress.loggedInKey }}
- name: WORDPRESS_LOGGED_IN_KEY
value: {{ .Values.wordpress.loggedInKey }}
{{- end }}
{{- if .Values.wordpress.nonceKey }}
- name: WORDPRESS_NONCE_KEY
value: {{ .Values.wordpress.nonceKey }}
{{- end }}
{{- if .Values.wordpress.authSalt }}
- name: WORDPRESS_AUTH_SALT
value: {{ .Values.wordpress.authSalt }}
{{- end }}
{{- if .Values.wordpress.secureAuthSalt }}
- name: WORDPRESS_SECURE_AUTH_SALT
value: {{ .Values.wordpress.secureAuthSalt }}
{{- end }}
{{- if .Values.wordpress.loggedInSalt }}
- name: WORDPRESS_LOGGED_IN_SALT
value: {{ .Values.wordpress.loggedInSalt }}
{{- end }}
{{- if .Values.wordpress.nonceSalt }}
- name: WORDPRESS_NONCE_SALT
value: {{ .Values.wordpress.nonceSalt }}
{{- end }}
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: wordpress-data
mountPath: /var/www/html
volumes:
- name: wordpress-data
persistentVolumeClaim:
claimName: {{ include "wordpress-website.fullname" . }}-data
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}