Congratulations on successfully setting up your Kubernetes cluster with a Ghost blog! As you embark on this new journey of managing and maintaining your dynamic platform, it is essential to stay proactive in ensuring the smooth operation and optimal performance of your environment. This article will explore three crucial aspects of maintaining your newly created Kubernetes cluster with Ghost blog: updating the Ghost configuration file, upgrading Ghost and MySQL versions, and expanding storage volume.
Updating the Ghost configuration file
The Ghost configuration file serves as the backbone of your blog's settings, defining everything from database connectivity to theme customization. Regularly updating this file ensures that your Ghost installation remains up-to-date with any changes or improvements introduced by the Ghost team. Considering you've followed the instructions from Part II of this manual, you should now have the configuration file set up with Kubernetes secret. In that case, all you'd need to do to upgrade the configuration is:
- update the
- update the secret with the following command:
$ kubectl create secret generic ghost-blog --dry-run=client --save-config -o yaml --from-file=config=../code/config.production.json | kubectl apply -f -
- Rollout the change by restarting the deployment:
$ kubectl rollout restart deployment ghost-blog-web
Upgrading Ghost and MySQL Version
Ghost, being an open-source platform, constantly receives updates and new features that improve its security, performance, and overall user experience. Similarly, MySQL, the database management system that powers your Ghost blog, often releases new versions with bug fixes and optimizations. Fortunately for us, the setup we've configured allows us to update both technologies with little effort. All you need to do is simply update the image directive version (
image: ghost:5.38) in the
kube/blog.yaml and apply the change to the Kubernetes cluster in the
$ kubens blog $ kubectl apply -f kube/blog.yaml
Similarly, it's done for MySQL by updating the image version directive for MySQL deployment in the
kube/mysql.yaml file and applying the change.
Expanding storage volume
As your Ghost blog grows in content and attracts more visitors, you may find that the initial storage volume allocated to your Kubernetes cluster becomes insufficient. In this section, we will look into expanding your storage volume to accommodate the increasing demands of your blog.
One of the critical aspects of our setup was CSI Driver installation for Hetzner which would help us to modify a separate volume via Kubernetes cluster configuration changes. To expand the volume, change the
storage: 10Gi param to a new value in the
kube/pvc.yaml config and apply it running the
kubectl apply -f kube/pvc.yaml command. This will result in smooth Hetzner Volume resizing without re-creation of it. Note that this value can only be increased and can't be shrunk back — don't go too far, as it will affect the cost.
As you can see, maintaining such a blog is simple and hassle-free. In future articles, I'll aim to cover details on further expansion — moving from a single-node configuration to an indeed clustered, highly-available solution. Subscribe to not miss out on the updates!