From bc492f8f226c323948aeeabe5dc0b35fd9c26847 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Sun, 23 Mar 2025 17:39:05 +0100 Subject: [PATCH] Migrate ghost from helm to manifests --- apps/base/ghost/deployment.yaml | 35 +++++++++++++++++++++++++++ apps/base/ghost/repository.yaml | 10 -------- apps/base/ghost/service.yaml | 15 ++++++++++++ apps/prod/ghost/deployment-patch.yaml | 20 +++++++++++++++ apps/prod/ghost/kustomization.yaml | 11 +++------ apps/prod/ghost/pvc.yaml | 12 +++++++++ apps/prod/ghost/release.yaml | 19 --------------- apps/prod/ghost/secret.enc.yaml | 28 --------------------- apps/prod/ghost/values.yaml | 24 ------------------ 9 files changed, 85 insertions(+), 89 deletions(-) create mode 100644 apps/base/ghost/deployment.yaml delete mode 100644 apps/base/ghost/repository.yaml create mode 100644 apps/base/ghost/service.yaml create mode 100644 apps/prod/ghost/deployment-patch.yaml create mode 100644 apps/prod/ghost/pvc.yaml delete mode 100644 apps/prod/ghost/release.yaml delete mode 100644 apps/prod/ghost/secret.enc.yaml delete mode 100644 apps/prod/ghost/values.yaml diff --git a/apps/base/ghost/deployment.yaml b/apps/base/ghost/deployment.yaml new file mode 100644 index 0000000..17100db --- /dev/null +++ b/apps/base/ghost/deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ghost + namespace: ghost + labels: + app: ghost +spec: + replicas: 1 + selector: + matchLabels: + app: ghost + template: + metadata: + labels: + app: ghost + spec: + containers: + - name: ghost + image: ghost:5-alpine + ports: + - containerPort: 2368 + name: http + env: + - name: database__client + value: sqlite3 + - name: NODE_ENV + value: production + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 100m + memory: 256Mi \ No newline at end of file diff --git a/apps/base/ghost/repository.yaml b/apps/base/ghost/repository.yaml deleted file mode 100644 index 0d63f42..0000000 --- a/apps/base/ghost/repository.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# /apps/base/ghost/repository.yaml -apiVersion: source.toolkit.fluxcd.io/v1 -kind: HelmRepository -metadata: - name: bitnami - namespace: ghost -spec: - interval: 24h - type: oci - url: oci://registry-1.docker.io/bitnamicharts \ No newline at end of file diff --git a/apps/base/ghost/service.yaml b/apps/base/ghost/service.yaml new file mode 100644 index 0000000..7ad3224 --- /dev/null +++ b/apps/base/ghost/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: ghost + namespace: ghost + labels: + app: ghost +spec: + selector: + app: ghost + ports: + - port: 80 + targetPort: 2368 + name: http + type: ClusterIP \ No newline at end of file diff --git a/apps/prod/ghost/deployment-patch.yaml b/apps/prod/ghost/deployment-patch.yaml new file mode 100644 index 0000000..b7fac87 --- /dev/null +++ b/apps/prod/ghost/deployment-patch.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ghost + namespace: ghost +spec: + template: + spec: + containers: + - name: ghost + env: + - name: url + value: https://${GHOST_URL} + volumeMounts: + - name: ghost-content + mountPath: /var/lib/ghost/content + volumes: + - name: ghost-content + persistentVolumeClaim: + claimName: ghost-content \ No newline at end of file diff --git a/apps/prod/ghost/kustomization.yaml b/apps/prod/ghost/kustomization.yaml index e07bf2f..8a06c5b 100644 --- a/apps/prod/ghost/kustomization.yaml +++ b/apps/prod/ghost/kustomization.yaml @@ -1,19 +1,14 @@ -# /apps/prod/ghost/kustomization.yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: ghost resources: - ../../base/ghost - - release.yaml + - pvc.yaml - ingress.yaml - - secret.enc.yaml -configMapGenerator: - - name: ghost-prod-values - namespace: ghost - files: - - values.yaml +patchesStrategicMerge: + - deployment-patch.yaml configurations: - kustomizeconfig.yaml \ No newline at end of file diff --git a/apps/prod/ghost/pvc.yaml b/apps/prod/ghost/pvc.yaml new file mode 100644 index 0000000..2ffff42 --- /dev/null +++ b/apps/prod/ghost/pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ghost-content + namespace: ghost +spec: + accessModes: + - ReadWriteOnce + storageClassName: retain-local-path + resources: + requests: + storage: 5Gi \ No newline at end of file diff --git a/apps/prod/ghost/release.yaml b/apps/prod/ghost/release.yaml deleted file mode 100644 index cc5f500..0000000 --- a/apps/prod/ghost/release.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: helm.toolkit.fluxcd.io/v2 -kind: HelmRelease -metadata: - name: ghost - namespace: ghost -spec: - interval: 1h - chart: - spec: - chart: ghost - version: "22.2.3" - sourceRef: - kind: HelmRepository - name: bitnami - namespace: ghost - interval: 1h - valuesFrom: - - kind: ConfigMap - name: ghost-prod-values \ No newline at end of file diff --git a/apps/prod/ghost/secret.enc.yaml b/apps/prod/ghost/secret.enc.yaml deleted file mode 100644 index 9275e6f..0000000 --- a/apps/prod/ghost/secret.enc.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: ghost-admin-secret - namespace: ghost -type: Opaque -stringData: - ghost-password: ENC[AES256_GCM,data:UfT+Is1grMWVhQOl2ew7etgE,iv:fDiZ4re4odMYd2LJk90qwqdMvr9+oH0fW7SZiEjE6TU=,tag:qbREC2IScRYq6Y9lk4C5EA==,type:str] -sops: - kms: [] - gcp_kms: [] - azure_kv: [] - hc_vault: [] - age: - - recipient: age1jk99rtxq3ep2xj2w886cchddf7jypqpwkr3dszg5dzq93gn8cy9qyc786m - enc: | - -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvd0VQMmJYVFp4bVBYWTZh - RmlGQXE5YlBZZjVFYlJERFR1Q3B5U2tncDBVCkVvczlzakJFN3o2UGFiLzZaN2pL - RVRYTUpOYTdpNUFNVWhldFVucVBwNXMKLS0tIHRNUVpnSkpVeHV6L0FaOFZVdW8v - ZGs3Y2dkZEtmTG9GbVRoMzJoTFJpaHMKENlCAd/B6HLlL2NlRXx64JqoJYuxNQwj - KRGmUNbjDIjFQym/8LI6XbIW1WgrWa/6pVdzkUOjjTXe6V9BijFGhw== - -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-03-23T15:09:57Z" - mac: ENC[AES256_GCM,data:Xy351DGdecmgyDrNR9QUMj5QXlqnm4icdJix0zyiX8THO8cojHj7g5qfrXLuQbN6G5zMVW0b6YgDiSeaXvSFje1tHNZd4cCmq3BO4A0MTAUufau6n50nWFlWaMecny4JIPYS+kJe6FUq68mCv/aaDMWPOf3jZDfPYb5KUVqat80=,iv:aLphC2N5vkBB9Ma5NafpP6dyHD5rM3Z6aI+g1sJ5KNM=,tag:yFslBcL/oKWwdWG2ZWeBrA==,type:str] - pgp: [] - unencrypted_regex: ^(apiVersion|metadata|kind|type)$ - version: 3.9.4 diff --git a/apps/prod/ghost/values.yaml b/apps/prod/ghost/values.yaml deleted file mode 100644 index 808b9b3..0000000 --- a/apps/prod/ghost/values.yaml +++ /dev/null @@ -1,24 +0,0 @@ -mysql: - enabled: false -postgresql: - enabled: false - -persistence: - enabled: true - storageClass: "retain-local-path" - size: 8Gi - -ghostHost: "${GHOST_DOMAIN}" -ghostUsername: admin -existingSecret: "ghost-admin-secret" -ghostEmail: "${GHOST_ADMIN_EMAIL}" -ghostBlogTitle: "" - -service: - type: ClusterIP - -extraEnvVars: - - name: database__client - value: sqlite3 - - name: NODE_ENV - value: production \ No newline at end of file