aws

Get Started with Bitnami Charts using Amazon EKS and the AWS Marketplace

Introduction

Amazon Web Services (AWS) provides a number of different cloud and container services, including the Amazon Elastic Container Service for Kubernetes (EKS), which allows users to quickly and easily create Kubernetes clusters in the cloud. 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 AWS Marketplace to deploy applications on a running EKS cluster. To achieve this, it will use Kubeapps, an open source web-based dashboard that makes it easier to control applications running on Kubernetes.

Overview

This guide will walk you through the process of deploying and managing applications in an EKS cluster using the AWS Marketplace and Kubeapps. Kubeapps is a one-time install that gives you a number of important benefits, including the ability to:

  • browse Helm charts from public or your own private chart repositories and deploy them into your cluster;
  • upgrade, manage and delete the applications that are deployed in your Kubernetes cluster;
  • browse and provision external services from the Service Catalog and available Service Brokers.

For illustrative purposes, this guide will show you the steps to deploy the Bitnami WordPress Helm chart on your EKS cluster with Kubeapps. But WordPress is just an example: there are many other Helm charts available to choose from, and they’re all equally easy to deploy from the AWS Marketplace by following the same steps.

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

  • Subscribe to the Bitnami WordPress container using the AWS Marketplace
  • Install Kubeapps
  • Deploy the Bitnami WordPress Helm chart on EKS through Kubeapps
  • 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: Subscribe to the Bitnami WordPress container using the AWS Marketplace

: At the end of this step, you will have subscribed to the Bitnami WordPress container solution in the AWS Marketplace and obtained the details of the registry.

Follow these steps:

  • Log in to the AWS Marketplace.

    AWS Marketplace

  • Search for the Bitnami WordPress container by entering the search term “bitnami wordpress container” in the search bar at the top.

  • Select the Bitnami WordPress container in the list of search results.

  • On the product detail page, review the details of the solution and click the “Continue to subscribe” button.

    Container configuration

  • On the product subscription page, select “WordPress Container Solution” as the software option and accept the terms.

  • On the product configuration page, select “WordPress Container Set” as the fulfillment option and click the “Continue to fulfillment” button.

    Container fulfillment

  • On the product fulfillment page, copy the URL to the AWS Marketplace registry. You will need these details in Step 3.

    Solution details

Step 2: Install Kubeapps

: At the end of this step, you will have you will have installed Kubeapps on your EKS cluster and launched the Kubeapps dashboard.

NOTE: We recommend subscribing to Kubeapps because it provides an intuitive Web GUI to manage your Helm chart deployments on EKS. If you prefer not to use Kubeapps, you can still deploy Bitnami containers on EKS using the alternative approach at the end of this document.

The next step is to subscribe to, and install, Kubeapps:

  • In the AWS Marketplace, search for Kubeapps by entering the search term “bitnami kubeapps” in the search bar at the top.

  • Select Kubeapps in the list of search results and subscribe to it following the same procedure as in the previous section.

  • On your local system, use Helm to install Kubeapps, as shown below. Replace the displayed image version 1.0.0-beta.5-latest with the latest available Kubeapps version.

      $ helm repo add bitnami https://charts.bitnami.com/bitnami
      $ helm install kubeapps --namespace kubeapps bitnami/kubeapps \
        --set global.imageRegistry=217273820646.dkr.ecr.us-east-1.amazonaws.com/7762bbba-0563-4863-bb12-2b1dfb26d3c6/cg-1813167126 \
        --set apprepository.image.repository=kubeapps-apprepository-controller \
        --set apprepository.image.tag=1.0.0-0-latest \
        --set apprepository.syncImage.repository=kubeapps-chart-repo \
        --set apprepository.syncImage.tag=1.0.0-0-latest \
        --set chartsvc.image.repository=kubeapps-chartsvc \
        --set chartsvc.image.tag=1.0.0-0-latest \
        --set dashboard.image.repository=kubeapps-dashboard \
        --set dashboard.image.tag=1.0.0-0-latest \
        --set hooks.image.repository=kubectl \
        --set hooks.image.tag=1.0.0-0-latest \
        --set frontend.image.repository=nginx \
        --set frontend.image.tag=1.0.0-0-latest \
        --set postgresql.image.repository=postgresql \
        --set postgresql.image.tag=1.0.0-0-latest
    
  • Create a service account and role binding for Kubeapps and obtain an authorization token to log in to Kubeapps:

      $ kubectl create serviceaccount kubeapps-operator
      $ kubectl create clusterrolebinding kubeapps-operator --clusterrole=cluster-admin --serviceaccount=default:kubeapps-operator
      $ kubectl get secret $(kubectl get serviceaccount kubeapps-operator -o jsonpath='{.secrets[].name}') -o jsonpath='{.data.token}' | base64 --decode
    

    Note the token displayed as you will need it to log in to the Kubeapps dashboard.

  • Forward the necessary port for browser access:

      $ export POD_NAME=$(kubectl get pods -n kubeapps -l "app=kubeapps,release=kubeapps" -o jsonpath="{.items[0].metadata.name}")
      echo "Visit http://127.0.0.1:8080 in your browser to access the Kubeapps Dashboard"
      $ kubectl port-forward -n kubeapps $POD_NAME 8080:8080
    

You should now be able to access Kubeapps by browsing to http://127.0.0.1:8080 on your local system. This is what you should see:

Kubeapps login

Log in using the token obtained previously and you should see the Kubeapps dashboard, as shown below:

Kubeapps dashboard

Step 3: Deploy the Bitnami WordPress Helm chart on EKS through Kubeapps

: At the end of this step, you will have deployed WordPress on your EKS cluster through Kubeapps.

The next step is to deploy WordPress on your EKS cluster. The easiest way to do this is with a Helm chart, and Kubeapps gives you one-click access to a large number of such charts.

Follow these steps:

  • From the Kubeapps dashboard, click the “Catalog” menu option in the top navigation bar.

  • Search for and select the Bitnami WordPress Helm chart.

    Kubeapps WordPress chart

  • On the chart detail page, click the “Deploy using Helm” button.

    Kubeapps WordPress chart deployment

  • Enter a name for your chart and make the following changes in the YAML chart configuration:

    • Uncomment and update the global.imageRegistry option in the YAML configuration with the registry URL obtained in Step 1, as shown below:

          ## Global Docker image registry
          ## Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value
          ##
          global:
            imageRegistry: REGISTRY-URL
      

      Kubeapps WordPress chart configuration

    • Update the image.repository option in the YAML configuration and remove the bitnami/ prefix for the repository name. For example, if the image.repository option is set to bitnami/wordpress, modify it to just wordpress.

    • Update the image.tag option in the YAML configuration and use the “Software Version” from the Container Solution adding the “-latest” suffix. For example, for WordPress the version is set to 4.9.8, change it to 4.9.8-latest.

  • For any chart dependencies, add similar image.repository and image.tag options, remembering to use the same version tag in each case. For example, if the chart configuration references MariaDB as a dependency, add the following to the corresponding section:

         mariadb:
          image:
            repository: mariadb
            tag: 4.9.8-latest
    
  • Click “Deploy” to proceed. Kubeapps will deploy the Helm chart and display a status screen as the chart is installed.

  • Refresh the page until Kubeapps reports that the pods are “ready”:

    Kubeapps WordPress chart status

  • Get the credentials for WordPress by clicking the eye icon in the “Application Secrets” section:

    Kubeapps WordPress chart credentials

Browse to the load balancer URL shown on the Kubeapps status screen and you should see WordPress running. Here’s what it should look like:

WordPress home page

Step 4: 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.

Troubleshooting

Occasionally, Kubernetes may report an error if you attempt to deploy a chart with versions of container images that are not yet available in your private AWS registry. In this case, use helm status to check if all the containers are running. If not, use kubectl describe pod-name to find the source of the error.

Once you confirm that the error occurred because Helm was unable to find the container image in the registry, check the image.tag option in the YAML configuration in Step 3 is pointing to an existing version in the “Container Solution”.

Alternative approach

To deploy Bitnami Helm charts on EKS using the AWS Marketplace, we recommend using Kubeapps, a Web-based UI for deploying and managing applications in Kubernetes clusters, as described in this guide.

However, if you prefer not to use Kubeapps, you can still deploy Bitnami Helm charts on EKS using an alternative approach. The steps below assume that:

Follow the steps below:

  • Subscribe to the container solution you wish to deploy using the AWS Marketplace, as described in Step 1 of this guide.

  • Create a secret for Helm to use when pulling container images from the registry. Replace the SECRET-NAME placeholder with a custom name for the secret.

      $ kubectl create secret docker-registry "SECRET-NAME"                  \
          --docker-username="AWS"                                            \
          --docker-password=$(aws ecr get-login-password --region us-east-1) \
          --docker-server="709825985650.dkr.ecr.us-east-1.amazonaws.com"
    
  • On your local system, use Helm to install the required chart, as shown below. Replace the REGISTRY-URL placeholder with the URL to the AWS Marketplace registry as obtained in the previous step and the SECRET-NAME placeholder with the secret name used in the previous command. For example, to install Bitnami WordPress, use the commands below:

      $ helm repo add bitnami https://charts.bitnami.com/bitnami
      $ helm install wordpress bitnami/wordpress --set global.imageRegistry=REGISTRY-URL --set global.imagePullSecrets[0]="SECRET-NAME"
    

    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.

    Release deployment

  • Check pod status until all the pods are “running”:

      $ kubectl get pods -w
    
  • Obtain the credentials and load balancer URL for the application by executing the commands shown in the output of helm install.

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

Last modification April 10, 2024