Creating applications and subscriptions within Kubernetes clusters using IBM Multicloud Manager 3.2.1

Joshua Packer
IBM Cloud
Published in
5 min readOct 31, 2019

With version 3.2.1, the application lifecycle capabilities of IBM Multicloud Manager are enhanced to help you maintain the continuous delivery of Helm charts and Kubernetes resources. These enhanced capabilities include the introduction of channels and subscriptions for orchestrating the management and deployed of charts and resources.

  • Channels are a kind of Kubernetes object that represents the usual places where you would expect to find Helm charts and Kubernetes resources, including templates within Kubernetes namespaces, YAML files within object stores, and Helm charts within Helm repositories. You can populate these channels manually or from your continuous integration systems. With IBM Multicloud Manager 3.2.1, you can subscribe your managed clusters to one or more channels to create a diverse delivery ecosystem.
  • Subscriptions are another kind of Kubernetes object, which you can propagate to managed clusters to help manage the ecosystem. Subscriptions provide you with flexible controls to specify which versions of specific charts and resources to deliver to clusters from your channel sources.

The channel and subscription model for application management provides you with the capability to deliver your applications to your managed clusters similar to how you receive OS package updates. The channel and subscription model also gives you greater flexibility for how you deliver your applications and updates.

Sample package

To demonstrate how to get started with channels and subscriptions, a sample package is available that you can download to quickly and easily create and begin using channels and subscriptions. This package is hosted on the IBM GitHub project and is available for download and use with any licensed edition of IBM Multicloud Manager.

With this package in your development environment, you can easily set up a channel that points to the IBM Cloud Charts Helm Repository, which is a repository of IBM and third-party developer edition Helm charts. As a specific example, this sample project subscribes managed clusters to the Helm chart for IBM MQ Advanced for Developers. This subscription deploys the latest version of the chart and continues to update the deployed chart whenever a new version is published to the repository that is represented by the channel. When you are creating your own subscriptions, you can use the same subscription to target multiple managed clusters so that you can update all clusters that need to include the same chart.

Prerequisites

To use this sample package to create your own channels and subscriptions, ensure that your environment has the following prerequisites:

  • IBM Multicloud Manage hub cluster
  • IBM Multicloud Manager managed cluster
  • IBM MQ Advanced for Developer edition Helm chart
  • Kubernetes secret for the IBM MQ administrator

In addition, you need to clone the sample files from the IBM GitHub project.

Creating the Helm chart channels

These files are the YAML files that you need for creating the channels and subscriptions for delivering and configuring resources. One of these YAML files is used to create a namespace type channel and a Helm repository type channel. The namespace type channel is used to hold secrets and configMaps. The Helm repository channel is used to identify the IBM Developer Edition Helm Chart repository on GitHub.com. IBM MQ Advanced is one of the charts that IBM makes available in this repository for developers. Use the following commands to create the channels:

To create the secret (vault) channel:

kubectl apply -f ./channels/1-secret-vault-channel.yaml

To create the Helm repository channel:

kubectl apply -f ./channels/2-ibmcom-helm-channel.yaml

Creating the Helm repository subscription

With the Helm chart channels set up, you can create a subscription to the IBM Cloud Charts Helm Repository to install the latest version of the IBM MQ Advanced for Developers chart. This YAML file is used to create this subscription resource for the Helm chart, create an application resource, and create a subscription resource to deliver the IBM MQ Administrator secret. The application resource is used to tie one or more subscriptions together for dependencies. This relationship allows the IBM Multicloud Manager management console to display the different resources that are associated with the deployed application.

kubectl apply -f ./subscriptions/3-mqadvanced-subscription.yaml

This command propagates the vault/secret namespace subscription to all of your managed clusters with the label environment: Dev. A second subscription is propagated to all your managed clusters. This second subscription subscribes the clusters to the IBM Developer Edition chart repository. The subscription finds a chart by name, and then chooses a version of the chart based on the parameters in the subscription. Once a chart version is located, the subscription on the managed clusters deploys the associated Helm release by creating a HelmRelease resource that orchestrates the deployment.

Verifying the subscription

To make sure that all resources are working, you can complete the following checks:

1. Check the state of your hub cluster subscriptions with the following command:

kubectl -n developer-editions describe subscriptions | more

This command shows whether the subscriptions are successfully propagated to the appropriate managed clusters.

2. In the IBM Multicloud Manager console, use the Applications dashboard to view the mq-advanced-server-dev application. The application should have two associated resources, the Kubernetes secret subscription and the Helm chart subscription.

3. On a managed cluster, you can look at the status of the chart by reviewing the subscription status with the following command:

kubectl -n developer-editions describe subscriptions

If there is a problem for deploying the chart or creating the secret, the issue is displayed in the command output. Alternately, you can see the results of the IBM MQ Advanced for Developers chart by running the following command:

kubectl -n developer-editions get all

Within the command output, you see a statefulSet that includes the health of the IBM MQ pods. The following command can also show you the details for the IBM MQ Advanced for Developers pod:

kubectl -n developer-editions get pods

Conclusion

This example allows you to deploy the IBM MQ Advanced Server Developer Edition chart to a managed cluster. These Kubernetes resource artifacts can be quickly duplicated to support other IBM Developer Edition charts as well as your own charts. For IBM Developer Edition charts, you can see the subscriptions in the GitHub repository.

By changing the Channel URL, Subscription chart target name and version, and the Subscriptions override for custom values, you can subscribe a cluster to any Helm chart that you choose. This capability brings a new level of continuous delivery to your charts. As updates are published to the Helm Repository, these latest updates can be automatically applied or controlled through versions choices across one or more of your managed clusters.

Resources

GitHub: IBM MQ Advanced for Developers example

IBM Multicloud Manager is an IBM Cloud Pak offering that provides Kubernetes container management capabilities. With IBM Multicloud Manager, you have control of your Kubernetes clusters and can ensure that your clusters are secure, operating efficiently, and delivering the service levels that your applications expect.

IBM Multicloud Manager 3.2.1 is available as part of IBM Cloud Pak for Multicloud Management. For more information, see the IBM Knowledge Center

Special thanks to my editor Robert Wellon.

--

--

Joshua Packer
IBM Cloud

Senior Technical Staff Member — Architect IBM Multicloud Manager & IBM Cloud Foundry Enterprise Edition on IBM Cloud Private