Deploying Apps to Kubernetes on the IBM Cloud With Helm

DZone 's Guide to

Deploying Apps to Kubernetes on the IBM Cloud With Helm

This quick guide will teach you how to use the package manager Helm to deploy apps to Kubernetes on IBM's Cloud Container Service.

· Cloud Zone ·
Free Resource

Helm is the package manager for Kubernetes. With Helm, you can very easily deploy applications, tools, and databases like MongoDB, PostgreSQL, WordPress, and Apache Spark into your own Kubernetes clusters. Below is a brief description of how to use Helm for the IBM Cloud Container service.

“Helm helps you manage Kubernetes applications. Helm Charts helps you define, install, and upgrade even the most complex Kubernetes application. Charts are easy to create, version, share, and publish, so start using Helm and stop the copy-and-paste madness. The latest version of Helm is maintained by the CNCF.”

You can easily install applications by invoking commands like ‘helm install stable/mongodb’. You can also configure applications before installing them via YAML configuration files.

The Kubernetes community provides a curated catalog of stable Helm Charts. Additionally, IBM provides charts for Db2, MQ, and more.

Below is a quick example for how to deploy MongoDB to Kubernetes on the IBM Cloud.

First, you need to configure the Bluemix CLI to work against your Kubernetes cluster, and you need to install Helm on your development machine.

bx login -a https://api.ng.bluemix.net
bx target --cf
bx cs init
bx cs cluster-config mycluster
set environment variable: export KUBECONFIG=...
bx cr login
helm init
helm repo add stable https://kubernetes-charts.storage.googleapis.com/

Next, you can install Kubernetes applications with the following command:

helm install --name my-tag stable/mongodb

If you want to delete everything later, run ‘helm delete my-tag’.

To find out the IP address and port, run these commands:

bx cs workers mycluster
kubectl get svc
kubectl get svc my-service

If you have a paid account, this is all you have to do.

The free account does not support persistent volumes. As a workaround (not for production) you can use disk space on worker nodes. Run ‘kubectl create -f config.yaml’ with the following content in config.yaml for MongoDB.

kind: PersistentVolume
apiVersion: v1
  name: mongo-simple-mongodb
  namespace: default  
    storage: 10Gi
    - ReadWriteOnce
    path: "/tmp/data"

After this, you can see everything working on the Kubernetes dashboard (‘kubectl proxy’).


app deployment, cloud, helm, ibm cloud container service, kubernetes, tutorial

Published at DZone with permission of Niklas Heidloff , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}