Deploy Ghost with MySQL DB replication using helm chart

ghost

Ghost is used by creators to run their own website to publish private content

Flow Diagram

ghost deployment design

Quickstart Install

These instructions are for ghost installation on bare metal Kubernetes cluster using helm.

  • Run the update dependency command to create bitnami MySQL helm chart in the ghost helm charts directory
git clone https://github.com/Muneer94/ghost-deploy.git
cd ghost-deploy
helm dependency update ./ghost --debug
  • Deploy local-path-provisioner storage class but it does not support readwritemany so for high availability of your Kubernetes cluster better to use longhorn
# mak sure following packages are installed in kubernetes nodes
sudo apt-get install nfs-common cifs-utils -y
# longhorn
helm repo add longhorn https://charts.longhorn.io
helm repo update
helm upgrade --install longhorn longhorn/longhorn --namespace longhorn-system --create-namespace
# make longhorn storage class as false so that we won't have multiple storage classes as default
kubectl patch storageclass longhorn -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
  • Deploy ghost
helm upgrade --install ghost ghost --namespace example --create-namespace -f custom/ghost/example.yaml
  • Deploy ingress nginx controller to access ghost publicly with custom values in custom/ghost directory
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace -f custom/ghost/nginx.yaml
  • Create ingress rules for routing traffic to ghost pod
kubectl apply -f custom/ghost/ingress.yaml -n example
Note: Deploying self hosted ghost on kubernetes with multiple replicas is not supported yet, we will be deploying it with only 1 replica.