# Ghost blogs — three instances # Unpinned — scheduler places them anywhere # Storage via local-path (K3s default provisioner) # MariaDB connection via cluster DNS: mariadb # Runs in default namespace # # Deploy: # kubectl create secret generic ghost-secrets \ # --from-literal=ghost1-db-password='' \ # --from-literal=ghost2-db-password='' \ # --from-literal=ghost3-db-password='' # kubectl apply -f ghost-db-init.yaml # kubectl get jobs -w # wait for completion # kubectl apply -f ghost.yaml --- # Ghost 1 — blog.the-fulfillment.org — port 2368 apiVersion: v1 kind: PersistentVolumeClaim metadata: name: ghost1-pvc spec: accessModes: - ReadWriteOnce storageClassName: local-path resources: requests: storage: 5Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: ghost1 spec: replicas: 1 selector: matchLabels: app: ghost1 template: metadata: labels: app: ghost1 spec: containers: - name: ghost1 image: ghost:5-alpine env: - name: database__client value: mysql - name: database__connection__host value: mariadb - name: database__connection__port value: "3306" - name: database__connection__user value: ghost1_user - name: database__connection__password valueFrom: secretKeyRef: name: ghost-secrets key: ghost1-db-password - name: database__connection__database value: ghost1_db - name: url value: https://blog.the-fulfillment.org - name: security__staffDeviceVerification value: "false" - name: mail__transport value: SMTP - name: mail__from value: "Sister Sam " - name: mail__options__host value: smtp.mailgun.org - name: mail__options__port value: "587" - name: mail__options__auth__user valueFrom: secretKeyRef: name: ghost-secrets key: mailgun-smtp-user - name: mail__options__auth__pass valueFrom: secretKeyRef: name: ghost-secrets key: mailgun-smtp-password - name: bulk_email__provider value: smtp ports: - containerPort: 2368 volumeMounts: - name: ghost1-storage mountPath: /var/lib/ghost/content volumes: - name: ghost1-storage persistentVolumeClaim: claimName: ghost1-pvc --- apiVersion: v1 kind: Service metadata: name: ghost1 spec: selector: app: ghost1 ports: - port: 2368 targetPort: 2368 nodePort: 32368 type: NodePort --- # Ghost 2 — port 2369 apiVersion: v1 kind: PersistentVolumeClaim metadata: name: ghost2-pvc spec: accessModes: - ReadWriteOnce storageClassName: local-path resources: requests: storage: 5Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: ghost2 spec: replicas: 1 selector: matchLabels: app: ghost2 template: metadata: labels: app: ghost2 spec: containers: - name: ghost2 image: ghost:5-alpine env: - name: database__client value: mysql - name: database__connection__host value: mariadb - name: database__connection__port value: "3306" - name: database__connection__user value: ghost2_user - name: database__connection__password valueFrom: secretKeyRef: name: ghost-secrets key: ghost2-db-password - name: database__connection__database value: ghost2_db - name: url value: https://blog.privacy-practice.com - name: security__staffDeviceVerification value: "false" - name: server__port value: "2369" ports: - containerPort: 2369 volumeMounts: - name: ghost2-storage mountPath: /var/lib/ghost/content volumes: - name: ghost2-storage persistentVolumeClaim: claimName: ghost2-pvc --- apiVersion: v1 kind: Service metadata: name: ghost2 spec: selector: app: ghost2 ports: - port: 2369 targetPort: 2369 nodePort: 32369 type: NodePort --- # Ghost 3 — port 2370 apiVersion: v1 kind: PersistentVolumeClaim metadata: name: ghost3-pvc spec: accessModes: - ReadWriteOnce storageClassName: local-path resources: requests: storage: 5Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: ghost3 spec: replicas: 1 selector: matchLabels: app: ghost3 template: metadata: labels: app: ghost3 spec: containers: - name: ghost3 image: ghost:5-alpine env: - name: database__client value: mysql - name: database__connection__host value: mariadb - name: database__connection__port value: "3306" - name: database__connection__user value: ghost3_user - name: database__connection__password valueFrom: secretKeyRef: name: ghost-secrets key: ghost3-db-password - name: database__connection__database value: ghost3_db - name: url value: https://blog.sjasoft.com - name: security__staffDeviceVerification value: "false" - name: server__port value: "2370" ports: - containerPort: 2370 volumeMounts: - name: ghost3-storage mountPath: /var/lib/ghost/content volumes: - name: ghost3-storage persistentVolumeClaim: claimName: ghost3-pvc --- apiVersion: v1 kind: Service metadata: name: ghost3 spec: selector: app: ghost3 ports: - port: 2370 targetPort: 2370 nodePort: 32370 type: NodePort