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.
Join the DZone community and get the full member experience.Join For Free
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.
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 metadata: name: mongo-simple-mongodb namespace: default spec: capacity: storage: 10gi accessmodes: - readwriteonce hostpath: path: "/tmp/data"
after this, you can see everything working on the kubernetes dashboard (‘kubectl proxy’).
Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.