Files
blog/k8s/manifests/app/templates/7-wp-deployment.yaml
felegy 7e88f159d9
All checks were successful
/ build-and-deploy (push) Successful in 1m44s
+ ADD kubernetes deployment
2025-10-01 08:03:33 +00:00

87 lines
2.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "common.robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
app: "{{ template 'common.robustName' .Release.Name }}-app"
spec:
replicas: 1
# revisionHistoryLimit: 3
selector:
matchLabels:
app: "{{ template 'common.robustName' .Release.Name }}-app"
template:
metadata:
labels:
app: "{{ template 'common.robustName' .Release.Name }}-app"
spec:
imagePullSecrets:
- name: github-container-registry
containers:
- name: "{{ template 'common.robustName' .Release.Name }}-app"
image: {{ .Values.image }}
imagePullPolicy: Always
command:
- {{ .Values.command | default "web" | quote }}
resources:
requests:
memory: 128M
cpu: 100m
limits:
memory: 512M
ports:
- containerPort: 5000
envFrom:
- configMapRef:
name: dev-env
- secretRef:
name: dev-secret-env
- secretRef:
name: dev-db-connection
livenessProbe:
failureThreshold: 3
httpGet:
httpHeaders:
- name: Host
value: {{ .Values.host }}
- name: X-Forwarded-Proto
value: https
path: /wp/wp-cron.php?nocache
port: 5000
initialDelaySeconds: 10
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 30
readinessProbe:
failureThreshold: 3
httpGet:
httpHeaders:
- name: Host
value: {{ .Values.host }}
- name: X-Forwarded-Proto
value: https
path: /?nocache
port: 5000
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "common.robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
spec:
selector:
app: "{{ template 'common.robustName' .Release.Name }}-app"
ports:
- name: wp
protocol: TCP
port: 5000
targetPort: 5000