Container Service for Kubernetes (ACK) allows you to use Helm to deploy applications from the App Catalog page of the ACK console. Helm in ACK provides extended features and supports official repositories. You can also use the Helm CLI to quickly deploy applications. This topic describes the terms used in Helm and how to use Helm to deploy applications.

Table of contents

Prerequisites

  • An ACK managed cluster is created. For more information, see Create an ACK managed cluster.

    Tiller is automatically deployed in the cluster when the cluster is created. The Helm CLI is automatically installed on each master node. An Alibaba Cloud chart repository is added to Helm.

  • The Kubernetes version of the cluster is 1.8.4 or later. If your cluster does not meet the requirement, update the cluster. For more information, see Update the Kubernetes version of an ACK cluster.

Introduction to Helm

Application management is the most challenging task in Kubernetes. The Helm project provides a unified method to package software and manage software versions. You can use Helm to simplify application distribution and deployment. Helm is an open source project initiated by Deis. Helm can be used to simplify the deployment and management of Kubernetes applications. Helm serves as a package manager for Kubernetes and allows you to find, share, and use applications developed in Kubernetes. Before you use Helm, we recommend that you familiarize yourself with the following terms and components:

CategoryNameDescription
Helm termsChartA packaging format used by Helm. Each chart contains the images, dependencies, and resource definitions that are required for running an application. A chart may contain service definitions used in a Kubernetes cluster. A Helm chart is similar to a Homebrew formula, an Advanced Package Tool (APT) dpkg, or a Yum rpm.
ReleaseAn instance of a chart that runs in a Kubernetes cluster. A chart can be installed multiple times in a Kubernetes cluster. After a chart is installed, a new release is created. For example, if you want to use a MySQL chart to run two databases on a server, you can install the chart twice and generate a release and release name each time you install the chart.
Helm components (client/server architecture)Helm CLIThe Helm client that runs on your on-premises machine or on the master nodes of a Kubernetes cluster.
TillerThe server-side component that runs in a Kubernetes cluster. Tiller manages the lifecycles of Kubernetes applications.
RepositoryA repository is used to store charts. The Helm client can access the index file and packaged charts in a chart repository over HTTP.

Use the ACK console to deploy applications with Helm

  1. Log on to the ACK console.
  2. In the left-side navigation pane, choose Marketplace > Marketplace.
  3. On the App Catalog tab, select and click a chart to go to the details page. In this example, ack-wordpress-sample is used.
  4. Click Deploy in the upper-right corner of the page. In the Deploy panel, select a cluster and namespace, and click Next.
  5. On the Parameters wizard page, configure the parameters and click OK.
    In this example, a persistent volume claim (PVC) is specified to bind a dynamically provisioned disk volume. For more information, see Use a dynamically provisioned disk volume.
    Note You must first provision a disk as a persistent volume (PV). The capacity of the PV cannot be less than the capacity specified in the PVC.
  6. In the left-side navigation pane, choose Network > Services.
  7. In the Service list, you can find the Service created for the application and the corresponding external endpoints for HTTP and HTTPS access. Click an external endpoint to access the WordPress application.
    Note Before you access the external endpoint, make sure that the port of the endpoint is added to the security group.

Use the Helm CLI to deploy applications

If you use the Helm CLI to deploy applications, you can log on to the Kubernetes cluster through SSH. For more information, see Use SSH to connect to the master nodes of a dedicated Kubernetes cluster. You can also configure the kubectl and Helm CLI on an on-premises machine. The Helm CLI will automatically add and configure a repository. You can also run the following command to add a repository:

 helm repo add aliyunhub https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/

In this example, the Helm CLI and kubectl are installed and configured on an on-premises machine, and then an Apache Spark-based WordPress application is deployed.

  1. Install and configure the Helm CLI and kubectl.
    1. Install and configure the kubectl on an on-premises machine. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.

      Run the kubectl cluster-info command to query information about the Kubernetes cluster.

    2. Install Helm on your on-premises machine. For more information, see Install Helm.
  2. Use Helm to deploy the WordPress application.
    1. Run the following command to deploy the WordPress application:
      helm install --name wordpress-test stable/wordpress
      Note ACK supports dynamically provisioned disk volumes. To dynamically provision a disk volume, you must first create a disk volume. For more information, see Use a dynamically provisioned disk volume.

      Expected output:

      NAME:   wordpress-test
      LAST DEPLOYED: Mon Nov  20 19:01:55 2017
      NAMESPACE: default
      STATUS: DEPLOYED
      ...
    2. Run the following commands to query the release and Service created for the WordPress application:
      helm list
      kubectl get svc
    3. Run the following command to view the pods provisioned for the WordPress application and wait until the status of the pods changes to Running.
      kubectl get pod
    4. Run the following command to obtain the endpoint of the WordPress application:
      echo http://$(kubectl get svc wordpress-test-wordpress -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
      • You can enter the preceding endpoint in the address bar of your browser to access the WordPress application.
      • You can also run the following commands based on the chart description to obtain the username and password of the administrator for the WordPress application:
        echo Username: user
        echo Password: $(kubectl get secret --namespace default wordpress-test-wordpress -o jsonpath="{.data.wordpress-password}" | base64 --decode)
    5. Optional:Run the following command to delete the WordPress application:
      helm delete --purge wordpress-test

Use a third-party chart repository

In addition to the built-in chart repositories provided by Alibaba Cloud, you can also use third-party chart repositories if your cluster has Internet access.

Run the following command to add a third-party chart repository to Helm: For more information about Helm commands, see Helm documentation.

helm repo add Repository name Repository URL
helm repo update

References

The wide adoption of Helm encourages a growing number of software vendors to provide high-quality charts. If you require more charts, visit https://kubeapps.com/.

Related topics