Deploy WordPress On Azure Kubernetes Service (AKS)

In this blog post, I will show you how to deploy WordPress on Azure Kubernetes Service (AKS) Cluster.

Helm Charts

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.

Requirements

To install WordPress on an AKS cluster you will need an AKS Cluster, Azure CLI and Kubectl and Helm installed on your machine (If you are using macOS use brew install helm to install Helm)

Get Started

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

YAML File

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.


Posted

in

,

by