kubernetes

Get Started with Bitnami Charts using the IBM Cloud Kubernetes Service

Introduction

IBM Cloud Kubernetes Service is a managed Kubernetes service for production environments. Key features include intelligent scheduling, self-healing, horizontal scaling, service discovery and load balancing, automated rollouts and rollbacks, and secret and configuration management.

IBM Cloud Kubernetes Service makes it easy to configure and deploy a new Kubernetes cluster. Once you have your cluster running, you can use the IBM Cloud Catalog to deploy Bitnami’s Kubernetes-ready applications into your cluster with a single click.

This tutorial will walk you, step by step, through the process of deploying Bitnami applications on a running IBM Cloud Kubernetes Service cluster.

Assumptions and prerequisites

This tutorial assumes that:

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

Step 1: Deploy WordPress through the IBM Cloud Catalog

At the end of this step, you will have WordPress running in your IBM Cloud Kubernetes cluster.

Follow the steps below:

  • Log in to your IBM Cloud account
  • Click the “Catalog” menu item in the top navigation bar.
  • Select the “Software” tab of the catalog.
  • Search for and select WordPress from the list of applications.

    WordPress selection

  • On the application deployment page, select your IBM Cloud Kubernetes Service cluster. Use the default namespace or add a custom namespace for the deployment.

    WordPress deployment

  • Scroll down to the application customization section and review the details of the deployment, such as the WordPress blog name, administrator name and email address, and administrator password. Enter a custom password, or leave it blank to have a random password generated.

    WordPress deployment configuration

  • Read and agree to the license agreements. Click “Install” to begin the deployment.

IBM Cloud will now begin deploying WordPress to the Kubernetes cluster. This may take a few minutes and the status of the deployment will be visible in the workspace, as shown below.

WordPress deployment status

In the resulting screen, click “View log” to see the deployment notes. Run the commands shown to obtain the service’s public IP address and credentials (if randomly generated) to log in to WordPress. You can now access WordPress by launching your Web browser and browsing to the service address. You should see the front page of your blog with a sample post, as below:

WordPress home page

Step 2: Provide an external host for your application

NOTE: Some applications require an extra step to provide a external host that the cluster can use to manage your application service. This guide uses OwnCloud as an example. This step is not required for WordPress. If you have deployed a WordPress Helm chart, skip this section and navigate to step 3.

To provide an external host for your application, follow these instructions:

  • Navigate to “Kubernetes -> Clusters” and click the cluster where you deployed the application.
  • In the resulting screen, click the “Web terminal” button. It will open a terminal in the current tab. Click the maximize screen icon to start the terminal in a different tab.

    Open the web terminal

  • Install Helm in your cluster. Execute the following commands to install and configure the Helm CLI in the web terminal.

    $ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
    $ chmod 700 get_helm.sh
    $ USE_SUDO=false HELM_INSTALL_DIR=. ./get_helm.sh
    $ export PATH=`pwd`:$PATH
    

TIP: Check out the Helm official documentation to learn more about how to install Helm 3 locally in your cluster.

  • Return to the IBM Cloud console and navigate to the “Schematics” section:

    Navigate to the Schematics section

  • Select the workspace where your application is running. In the “Activity” section, click “View log” as shown below:

    View logs

  • In the deployment notes you will see an error message similar to this:

    ###############################################################################
    ### ERROR: You did not provide an external host in your 'helm install' call ###
    ###############################################################################
    
  • You will also find some commands to configure both the endpoint, the administration and the database password (if randomly generated). You should see a message similar to the following. Copy and execute the commands in the web console.

    This deployment will be incomplete until you configure ownCloud with a resolvable
    host. To configure ownCloud with the URL of your service:
    1. Get the ownCloud URL by running:
    NOTE: It may take a few minutes for the LoadBalancer IP to be available.
    Watch the status with: 'kubectl get svc --namespace default -w owncloud'
    export APP_HOST=$(kubectl get svc --namespace default owncloud --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
    export APP_PASSWORD=$(kubectl get secret --namespace default owncloud -o jsonpath="{.data.owncloud-password}" | base64 --decode)
    export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace default owncloud-mariadb -o jsonpath="{.data.mariadb-password}" | base64 --decode)
    
    2. Complete your ownCloud deployment by running:
    helm upgrade owncloud bitnami/owncloud \
    --set owncloudHost=$APP_HOST,owncloudPassword=$APP_PASSWORD,mariadb.db.password=$APP_DATABASE_PASSWORD 
    

Enter the obtained URL in a web browser to access your application. Log in using the default username user and the password obtained in the step above.

Step 3: 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 July 29, 2020