106 lines
3.0 KiB
YAML
106 lines
3.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ghost
|
|
namespace: {{ .namespace }}
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
component: web
|
|
template:
|
|
metadata:
|
|
labels:
|
|
component: web
|
|
spec:
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
fsGroup: 1000
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: ghost
|
|
image: ghost:5.130.6-alpine
|
|
ports:
|
|
- name: http
|
|
containerPort: 2368
|
|
protocol: TCP
|
|
env:
|
|
- name: NODE_ENV
|
|
value: production
|
|
- name: url
|
|
value: "https://{{ .domain }}"
|
|
- name: database__client
|
|
value: mysql
|
|
- name: database__connection__host
|
|
value: "{{ .db.host }}"
|
|
- name: database__connection__port
|
|
value: "{{ .db.port }}"
|
|
- name: database__connection__database
|
|
value: "{{ .db.name }}"
|
|
- name: database__connection__user
|
|
value: "{{ .db.user }}"
|
|
- name: database__connection__password
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ghost-secrets
|
|
key: dbPassword
|
|
- name: mail__transport
|
|
value: SMTP
|
|
- name: mail__options__host
|
|
value: "{{ .smtp.host }}"
|
|
- name: mail__options__port
|
|
value: "{{ .smtp.port }}"
|
|
- name: mail__options__auth__user
|
|
value: "{{ .smtp.user }}"
|
|
- name: mail__options__auth__pass
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ghost-secrets
|
|
key: smtpPassword
|
|
- name: mail__from
|
|
value: "{{ .smtp.from }}"
|
|
resources:
|
|
limits:
|
|
cpu: 1000m
|
|
ephemeral-storage: 2Gi
|
|
memory: 512Mi
|
|
requests:
|
|
cpu: 50m
|
|
ephemeral-storage: 50Mi
|
|
memory: 256Mi
|
|
volumeMounts:
|
|
- name: ghost-data
|
|
mountPath: /var/lib/ghost/content
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /ghost/api/admin/site/
|
|
port: 2368
|
|
initialDelaySeconds: 120
|
|
timeoutSeconds: 5
|
|
periodSeconds: 30
|
|
failureThreshold: 6
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /ghost/api/admin/site/
|
|
port: 2368
|
|
initialDelaySeconds: 60
|
|
timeoutSeconds: 5
|
|
periodSeconds: 15
|
|
failureThreshold: 3
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: false
|
|
volumes:
|
|
- name: ghost-data
|
|
persistentVolumeClaim:
|
|
claimName: ghost-data
|
|
restartPolicy: Always
|