From 2e96df2a211c8a5a8db8f490e7dedd7b1735a942 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 15 Apr 2024 14:38:10 +0100 Subject: Move ghost to web namespace --- kubernetes/namespaces/default/ghost/README.md | 7 ---- .../namespaces/default/ghost/deployment.yaml | 42 --------------------- kubernetes/namespaces/default/ghost/ingress.yaml | 24 ------------ kubernetes/namespaces/default/ghost/service.yaml | 9 ----- kubernetes/namespaces/default/ghost/volume.yaml | 13 ------- kubernetes/namespaces/web/ghost/README.md | 7 ++++ kubernetes/namespaces/web/ghost/deployment.yaml | 43 ++++++++++++++++++++++ kubernetes/namespaces/web/ghost/ingress.yaml | 25 +++++++++++++ kubernetes/namespaces/web/ghost/service.yaml | 10 +++++ kubernetes/namespaces/web/ghost/volume.yaml | 14 +++++++ 10 files changed, 99 insertions(+), 95 deletions(-) delete mode 100644 kubernetes/namespaces/default/ghost/README.md delete mode 100644 kubernetes/namespaces/default/ghost/deployment.yaml delete mode 100644 kubernetes/namespaces/default/ghost/ingress.yaml delete mode 100644 kubernetes/namespaces/default/ghost/service.yaml delete mode 100644 kubernetes/namespaces/default/ghost/volume.yaml create mode 100644 kubernetes/namespaces/web/ghost/README.md create mode 100644 kubernetes/namespaces/web/ghost/deployment.yaml create mode 100644 kubernetes/namespaces/web/ghost/ingress.yaml create mode 100644 kubernetes/namespaces/web/ghost/service.yaml create mode 100644 kubernetes/namespaces/web/ghost/volume.yaml (limited to 'kubernetes/namespaces') diff --git a/kubernetes/namespaces/default/ghost/README.md b/kubernetes/namespaces/default/ghost/README.md deleted file mode 100644 index fee4f8f..0000000 --- a/kubernetes/namespaces/default/ghost/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Ghost - -This folder contains the deployment manifests for Ghost, the CMS we use for https://blog.pythondiscord.com/. - -There should be no additional configuration required, there is a setup process on the domain when Ghost first boots, you can reach it by going to https://blog.pythondiscord.com/ghost/ immediately after starting the deployment. - -To deploy this application run `kubectl apply -f ghost` from the root directory of this repository. This will create a deployment, service ingress and persistent volume. diff --git a/kubernetes/namespaces/default/ghost/deployment.yaml b/kubernetes/namespaces/default/ghost/deployment.yaml deleted file mode 100644 index 9ead2c8..0000000 --- a/kubernetes/namespaces/default/ghost/deployment.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: ghost -spec: - replicas: 1 - strategy: - type: Recreate - selector: - matchLabels: - app: ghost - template: - metadata: - labels: - app: ghost - spec: - securityContext: - fsGroup: 2000 - runAsUser: 1000 - runAsNonRoot: true - containers: - - name: ghost - image: ghost:5.78-alpine - imagePullPolicy: Always - ports: - - containerPort: 2368 - env: - - name: url - value: https://blog.pythondiscord.com - - name: database__client - value: sqlite3 - - name: database__connection__filename - value: /var/lib/ghost/content/data/ghost.db - volumeMounts: - - mountPath: /var/lib/ghost/content - name: ghost-data - securityContext: - readOnlyRootFilesystem: true - volumes: - - name: ghost-data - persistentVolumeClaim: - claimName: ghost-storage diff --git a/kubernetes/namespaces/default/ghost/ingress.yaml b/kubernetes/namespaces/default/ghost/ingress.yaml deleted file mode 100644 index 30f0589..0000000 --- a/kubernetes/namespaces/default/ghost/ingress.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - nginx.ingress.kubernetes.io/auth-tls-verify-client: "on" - nginx.ingress.kubernetes.io/auth-tls-secret: "kube-system/mtls-client-crt-bundle" - nginx.ingress.kubernetes.io/auth-tls-error-page: "https://www.youtube.com/watch?v=dQw4w9WgXcQ" - name: ghost -spec: - tls: - - hosts: - - "*.pythondiscord.com" - secretName: pythondiscord.com-tls - rules: - - host: blog.pythondiscord.com - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: ghost - port: - number: 2368 diff --git a/kubernetes/namespaces/default/ghost/service.yaml b/kubernetes/namespaces/default/ghost/service.yaml deleted file mode 100644 index b030ecb..0000000 --- a/kubernetes/namespaces/default/ghost/service.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: ghost -spec: - ports: - - port: 2368 - selector: - app: ghost diff --git a/kubernetes/namespaces/default/ghost/volume.yaml b/kubernetes/namespaces/default/ghost/volume.yaml deleted file mode 100644 index 24c7929..0000000 --- a/kubernetes/namespaces/default/ghost/volume.yaml +++ /dev/null @@ -1,13 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: ghost-storage - labels: - app: ghost -spec: - storageClassName: linode-block-storage-retain - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi diff --git a/kubernetes/namespaces/web/ghost/README.md b/kubernetes/namespaces/web/ghost/README.md new file mode 100644 index 0000000..fee4f8f --- /dev/null +++ b/kubernetes/namespaces/web/ghost/README.md @@ -0,0 +1,7 @@ +# Ghost + +This folder contains the deployment manifests for Ghost, the CMS we use for https://blog.pythondiscord.com/. + +There should be no additional configuration required, there is a setup process on the domain when Ghost first boots, you can reach it by going to https://blog.pythondiscord.com/ghost/ immediately after starting the deployment. + +To deploy this application run `kubectl apply -f ghost` from the root directory of this repository. This will create a deployment, service ingress and persistent volume. diff --git a/kubernetes/namespaces/web/ghost/deployment.yaml b/kubernetes/namespaces/web/ghost/deployment.yaml new file mode 100644 index 0000000..3d07ffe --- /dev/null +++ b/kubernetes/namespaces/web/ghost/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ghost + namespace: web +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: ghost + template: + metadata: + labels: + app: ghost + spec: + securityContext: + fsGroup: 2000 + runAsUser: 1000 + runAsNonRoot: true + containers: + - name: ghost + image: ghost:5.78-alpine + imagePullPolicy: Always + ports: + - containerPort: 2368 + env: + - name: url + value: https://blog.pythondiscord.com + - name: database__client + value: sqlite3 + - name: database__connection__filename + value: /var/lib/ghost/content/data/ghost.db + volumeMounts: + - mountPath: /var/lib/ghost/content + name: ghost-data + securityContext: + readOnlyRootFilesystem: true + volumes: + - name: ghost-data + persistentVolumeClaim: + claimName: ghost-storage diff --git a/kubernetes/namespaces/web/ghost/ingress.yaml b/kubernetes/namespaces/web/ghost/ingress.yaml new file mode 100644 index 0000000..74a275b --- /dev/null +++ b/kubernetes/namespaces/web/ghost/ingress.yaml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + nginx.ingress.kubernetes.io/auth-tls-verify-client: "on" + nginx.ingress.kubernetes.io/auth-tls-secret: "kube-system/mtls-client-crt-bundle" + nginx.ingress.kubernetes.io/auth-tls-error-page: "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + name: ghost + namespace: web +spec: + tls: + - hosts: + - "*.pythondiscord.com" + secretName: pythondiscord.com-tls + rules: + - host: blog.pythondiscord.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: ghost + port: + number: 2368 diff --git a/kubernetes/namespaces/web/ghost/service.yaml b/kubernetes/namespaces/web/ghost/service.yaml new file mode 100644 index 0000000..7cb41b9 --- /dev/null +++ b/kubernetes/namespaces/web/ghost/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: ghost + namespace: web +spec: + ports: + - port: 2368 + selector: + app: ghost diff --git a/kubernetes/namespaces/web/ghost/volume.yaml b/kubernetes/namespaces/web/ghost/volume.yaml new file mode 100644 index 0000000..3789b39 --- /dev/null +++ b/kubernetes/namespaces/web/ghost/volume.yaml @@ -0,0 +1,14 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: ghost-storage + labels: + app: ghost + namespace: web +spec: + storageClassName: linode-block-storage-retain + accessModes: + - ReadWriteOncePod + resources: + requests: + storage: 10Gi -- cgit v1.2.3