In this blog post, I will show you how to deploy WordPress on Azure Kubernetes Service (AKS) Cluster.
As it stands right now, installing WordPress on Kubernetes is possible using two methods. First, you install WordPress and MySQL containers as you would install on a Docker host. The second option is using a Helm chart which is the recommended method.
To start, log in to Azure using Azure CLI and add the Bitnami Helm repository. We will use the Bitnami WordPress package for Kubernetes to install WP.
helm repo add bitnami https://charts.bitnami.com/bitnami
After adding the repo, update it using:
helm repo update
To install WordPress and customize the configuration, I will use a YAML file that will configure the hostname and a few other settings.
service: type: LoadBalancer ingress: enabled: true hostname: blog.deploycontainers.com
Save the above file as .YAML and change the hostname. In my case, I will use blog.deploycontainers.com as the hostname and I will run the following command. If you are using the default namespace remove the –namespace option.
helm install deploycontainers bitnami/wordpress --values=wp-deploycontainers.yaml --namespace ingress
After running the Helm command with the file, you will see the following information on the screen with instructions on how to get the admin password.
To make the website available the domain name, we need to get the LoadBalancer IP address and change the A record on the DNS zone, To find the IP address use the following command.
kubectl get service --namespace ingress-basic
After getting the IP address, I will add an A record to my DNS zone and test it by going to blog.deploycontainer.com.