DEV Community

Muneer Syed
Muneer Syed

Posted on

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

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
Enter fullscreen mode Exit fullscreen mode
  • 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"}}}'
Enter fullscreen mode Exit fullscreen mode
  • Deploy ghost
helm upgrade --install ghost ghost --namespace example --create-namespace -f custom/ghost/example.yaml
Enter fullscreen mode Exit fullscreen mode
  • 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
Enter fullscreen mode Exit fullscreen mode
  • Create ingress rules for routing traffic to ghost pod
kubectl apply -f custom/ghost/ingress.yaml -n example
Enter fullscreen mode Exit fullscreen mode

Deploying self hosted ghost on kubernetes with multiple replicas is not supported yet, we will be deploying it with only 1 replica.

Top comments (0)