Skip to main content

Helm and Kubernetes

It is possible to install Kraken in Kubernetes using Helm Chart.

Pre-requisites

Several things are required to install Kraken using Helm. In short:

  • Kubernetes cluster and kubectl tool
  • Helm tool

Helm is used to deploy several Kraken services and expose them to an external network. These Kraken services are described in Architecture chapter.

Kubernetes Clusters

There are multiple ways for setting up a Kubernetes cluster. One of the easiest ones, that is most often used for experimenting is Minikube. There are also managed clusters like EKS (Elastic Kubernetes Service) in AWS.

This manual will show how to install Kraken CI in Minikube but the steps are similar for other Kubernetes environments as well.

Install in Minikube

First, download minikube from https://minikube.sigs.k8s.io/docs/.

And then create a cluster:

$ minikube start

Now you may install Kraken CI but first, lets add a repo with Kraken Helm charts:

$ helm repo add kraken-ci https://kraken.ci/helm-repo/charts
$ helm repo update

and now install Kraken CI:

$ helm upgrade --install --create-namespace --namespace kraken \
--debug --wait \
--set access.method='external-ips' --set access.external_ips={`minikube ip`} \
kraken-ci kraken-ci/kraken-ci

This command actually upgrades Kraken CI if it is already installed but if it was not yet installed, then it installs it (this is --install switch).

The switches --create-namespace --namespace kraken are installing Kraken CI into kraken namespace. If the namespace does not exist, then it is created.

This command waits until all Kraken services are started correctly (--wait switch). The --debug switch makes the output much more verbose.

The two --set switches set Kraken's chart configuration. Whole the config can be present using the following command:

$ helm show values kraken-ci/kraken-ci

In the upgrade command, there are set two fields:

  • access.method which indicate what method should be used to expose Kraken services in Kubernetes; there are available the following options: external-ips, node-port, load-balancer
  • access.external_ips which indicate what external IP should be used to access Kraken services; in the case above, an IP address of minikube is used (the curly brackets {..} are necessary because access.external_ips requires an array as an argument)

And then, there are two arguments at the end of the upgrade command. The first one is kraken-ci and this is the installation name of the chart - you can pick any name here. The second argument is the name of Kraken's Helm repository that was added above and the name of the chart in this repository: kraken-ci/kraken-ci.

When everything completes successfully, then at the end of the whole output there should be presented short instruction about getting the URL of Kraken service like that:

NOTES:
Get the application URL by running these commands:
export NODE_PORT=$(kubectl get --namespace kk-1 -o jsonpath="{.spec.ports[0].port}" services ui)
export NODE_IP=$(kubectl get nodes --namespace kk-1 -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT

Now you may check if Kraken is working by visiting the URL given by this code and by checking if Kubernetes is running Kraken's services with this command:

kubectl get all -n kraken

This will show Kraken's pods, services, deployments and replica sets.