Deploy Ghost with MySQL DB replication using helm chart

Muneer Syed
2 min readJan 9, 2024

--

ghost

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

Flow Diagram

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

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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Muneer Syed
Muneer Syed

No responses yet

Write a response