kubernetes

Get Started with Bitnami Charts using the Microsoft Azure Marketplace

Introduction

Microsoft Azure is a flexible and versatile cloud platform for enterprise use cases, while Kubernetes is quickly becoming the standard way to manage application containers in production environment. Azure Kubernetes Service (AKS) brings these two solutions together, allowing users to quickly and easily create fully managed Kubernetes clusters.

But starting up a cluster is just the beginning: the next step is to deploy applications on it. That’s where this tutorial comes in. It will walk you, step by step, through the process of using the Microsoft Azure Marketplace to deploy Bitnami applications using Helm charts on a running AKS cluster.

Overview

This guide will introduce you to Bitnami’s Helm charts by provisioning a Kubernetes cluster and deploying the Bitnami WordPress Helm chart on it. This will give you a pre-configured WordPress blog that you can start using right away. But WordPress is just an example: there are hundreds of other Bitnami applications to choose from, and they’re all equally easy to set up.

Here are the steps you’ll follow in this tutorial:

  • Provision a Kubernetes cluster
  • Install and configure Helm
  • Deploy the WordPress Helm chart
  • Access the Kubernetes dashboard
  • Log in and start using WordPress

The next sections will walk you through these steps in detail.

Assumptions and prerequisites

This guide assumes that:

Step 1: Provision a Kubernetes cluster

: At the end of this step, you will have provisioned a Kubernetes cluster on AKS.

The first step is to provision a new Kubernetes cluster using the Microsoft Azure CLI. Follow these steps:

NOTE: If you already have kubectl and a running Kubernetes cluster on AKS, you can skip the first two steps in this section. However, ensure that you execute the final step in this section to obtain and configure your local environment with the credentials for your cluster using the az aks get-credentials command.

  • Log in to Microsoft Azure:

      $ az login
    

    If you have multiple subscriptions, you can optionally set the subscription you wish to use in the SUBSCRIPTION-NAME placeholder.

      $ az account set --subscription "SUBSCRIPTION-NAME"
    
  • Create a resource group and cluster. The cluster creation process can take up to 20 minutes.

      $ az group create --name aks-resource-group --location eastus
      $ az aks create --name aks-cluster --resource-group aks-resource-group --node-count 3 --generate-ssh-keys
    

    In this example, the resource group is named aks-resource-group and the cluster is named aks-cluster and is provisioned in the eastus location. If you choose different names or a different location, update the following steps to use the correct information.

  • If you don’t already have it, use the command below to install kubectl, the Kubernetes command-line interface:

      $ sudo az aks install-cli
    
  • Configure kubectl to use the credentials for the new AKS cluster:

      $ az aks get-credentials --name aks-cluster --resource-group aks-resource-group
    

Step 2: Install and configure Helm

: At the end of this step, you will have configured Helm to work in your AKS cluster.

Next, install and configure Helm for your operating system:

  • To install Helm v3.x, run the following commands:

      $ curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get-helm-3 > get_helm.sh
      $ chmod 700 get_helm.sh
      $ ./get_helm.sh
    

    TIP: If you are using OS X you can install it with the brew install command: brew install helm.

If you are using AKS v1.9 or v1.10, create a secret to use when pulling images from the registry.

    $ kubectl create secret generic emptysecret --from-literal=.dockerconfigjson='{"auths":{"marketplace.azurecr.io":{"Username":"","Password":""}}}' --type=kubernetes.io/dockerconfigjson

NOTE: This command is not required for AKS clusters v1.11 and higher. It is only necessary the first time you deploy a chart on a v1.9 or v1.10 AKS cluster and it can be omitted for subsequent chart deployments on the same AKS cluster.

Step 3: Deploy the WordPress Helm Chart

: At the end of this step, you will have WordPress running in your AKS cluster.

Once Helm is installed, you’re ready to deploy WordPress using the Bitnami WordPress Helm Chart.

  • Add the Microsoft Azure Marketplace chart repository to Helm:

      $ helm repo add azure-marketplace https://marketplace.azurecr.io/helm/v1/repo
    
  • Install the WordPress Helm Chart by executing the command below.

      $ helm install wordpress azure-marketplace/wordpress
    

    For v1.9 or v1.10 AKS clusters, use the same command but with the additional secret:

      $ helm install wordpress azure-marketplace/wordpress --set global.imagePullSecrets={emptysecret}
    

    You should see something like the output below as the chart is installed. Pay special attention to the NOTES section of the output, as it contains important information to access the application.

    Helm chart output

    NOTE: Some Bitnami charts, such as those for Magento and Ghost, can connect to an external database and require deployment in two steps. First, deploy the database server and obtain its public IP address and then, run the helm upgrade command with the public IP address. For example:

      $ helm upgrade magento azure-marketplace/magento --set magentoHost=$APP_HOST,magentoPassword=$APP_PASSWORD,mariadb.db.password=$APP_DATABASE_PASSWORD
    

    For v1.9 or v1.10 AKS clusters, you must add the secret to the command line above:

      $ helm upgrade magento azure-marketplace/magento --set magentoHost=$APP_HOST,magentoPassword=$APP_PASSWORD,mariadb.db.password=$APP_DATABASE_PASSWORD --set global.imagePullSecrets={emptysecret}
    
  • Check pod status until both WordPress and MariaDB are “running”:

      $ kubectl get pods -w
    

    Pods

  • Check services until you see the load balancer’s external IP address:

      $ kubectl get svc -w wordpress-chart-wordpress --namespace default
    

    Load balancer

  • Get the credentials for the application by executing the commands shown in the output of helm install:

    Helm chart commands

Browse to the specified URL and you should see WordPress running. Here’s what it should look like:

WordPress home page

You will also be able to see your cluster in the Microsoft Azure dashboard, under the “Resource groups” menu item:

Cluster details

Step 4: Access the Kubernetes dashboard

Once your WordPress Helm chart has been installed and it is running in your AKS cluster, you can access the Kubernetes dashboard to manage and monitoring your deployments in a visual way. Follow these steps:

  • To access your AKS cluster, navigate to the Microsoft Azure Portal and select the “Kubernetes services” section.

  • Click the name of the cluster you want to access. Then, click “View Kubernetes dashboard”.

  • In the resulting screen, you will find a set of steps that include the commands you need to execute from a terminal window in your local system:

    Instructions to access the Kubernetes dashboard

  • Once you have executed the commands above, the Kubernetes dashboard IP address will be displayed. Enter that IP address in a web browser to access the cluster dashboard.

Step 5: Log in and start using WordPress

At the end of this step, you will have logged in to WordPress and created a new blog post.

To log in to the WordPress dashboard, follow these steps:

  • Browse to the WordPress dashboard, usually at the URL http://SERVER-IP/wp-admin.

  • Log in with the administrator credentials from the previous step.

    WordPress credentials

You should now arrive at the WordPress dashboard, which allows you to manage posts, pages and comments; customize your blog with themes and plugins; import and export content; manage navigation menus; add or delete new user accounts; and much more.

WordPress credentials

Create your first post

You can now add a new post using the following steps:

  • Select the “Posts -> Add New” menu option to create a new post.

    Add new WordPress post

  • Enter a title and content for the post. You can use the formatting tools at the top of the content area to format your post and add hyperlinks or images.

  • Optionally, choose the format and category for your post.

  • Publish it immediately using the “Publish” button.

    Add new WordPress post

And now, when you visit your blog’s front page, you should see your new post.

WordPress post publishing

Congratulations! You now have a working, fully-functional WordPress blog in the cloud.

Keep your WordPress installation up-to-date

You can keep your WordPress installation up-to-date using tools such as VaultPress or the All-in-One WP Migration plugin. Alternatively, for simple upgrades that don’t involve chart changes, you need only to update the container tag/version used in your deployment.

To learn more about the topics discussed in this tutorial, use the links below:

Last modification February 6, 2023