Create or bring a Kubernetes cluster

Keptn can run on top of virtually any Kubernetes cluster. It can be installed in its own namespace on an existing Kubernetes cluster or on its own cluster. You can also deploy the Keptn Control Plane on one Kubernetes cluster and deploy the Keptn Execution Plane on other Kubernetes clusters; see Multi-cluster setup for details.

Before you install a new Kubernetes cluster, you must install the kubectl CLI.

Some of the more popular Kubernetes options are listed below with links to installation instructions.

  • This includes major commercial Kubernetes providers that are appropriate for production instances of Keptn.
  • k3s, k3d, and Minikube allow you to install a small Kubernetes cluster on your laptop for study and demonstration purposes.

Note Be sure to check Kubernetes support & Cluster size to ensure that Keptn is compatible with the Kubernetes version you are running and that your Kubernetes cluster has enough resources for Keptn. In particular, ensure that you include adequat storage capacity for the Persistent Volume Claims (PVCs). We recommend at least 20GB to 30GB of storage capacity for any Keptn installlation. Larger installations running more complex projects may need additional storage capacity. See Check resources for more information.

  • Create AKS cluster by following the guide here
  • Recommended node size: One D8s_v3 node
  • Create EKS cluster following by following the guide here
  • Recommended node size: One m5.2xlarge node

Run your Keptn installation for free on GKE! If you sign up for a Google Cloud account, Google gives you an initial $300 credit. For deploying Keptn, you can apply for an additional $200 credit, which you can use towards that GKE cluster needed to run Keptn. Apply for your credit here

  • Create GKE cluster by following the guide here
  • Recommended node size: One node with 8 vCPUs and 32 GB memory (e.g., one n1-standard-8 node)
    • Image type Ubuntu or COS (Note: If you plan to use Dynatrace monitoring, select ubuntu for a more convenient setup.

OpenShift 4

  1. Please bring your own OpenShift cluster in version 4 (tested version: 4.5)

  2. Install local tools

  1. Currently, there is the known limitation that the MongoDB of Keptn does not start. Please follow the troubleshooting guide provided here: MongoDB fails on OpenShift. ngo

OpenShift 3.11

  1. Please bring your own OpenShift cluster in version 3.11

  2. Install local tools

  1. On the OpenShift master node, execute the following steps:

    • Set up the required permissions for your user:

    oc adm policy –as system:admin add-cluster-role-to-user cluster-admin <OPENSHIFT_USER_NAME>

    
    - Set up the required permissions for the installer pod:
    
    ```console
    oc adm policy  add-cluster-role-to-user cluster-admin system:serviceaccount:default:default
    oc adm policy  add-cluster-role-to-user cluster-admin system:serviceaccount:kube-system:default
    
    • Enable admission WebHooks on your OpenShift master node:

    sudo -i cp -n /etc/origin/master/master-config.yaml /etc/origin/master/master-config.yaml.backup oc ex config patch /etc/origin/master/master-config.yaml –type=merge -p ‘{ “admissionConfig”: { “pluginConfig”: { “ValidatingAdmissionWebhook”: { “configuration”: { “apiVersion”: “apiserver.config.k8s.io/v1alpha1”, “kind”: “WebhookAdmission”, “kubeConfigFile”: “/dev/null” } }, “MutatingAdmissionWebhook”: { “configuration”: { “apiVersion”: “apiserver.config.k8s.io/v1alpha1”, “kind”: “WebhookAdmission”, “kubeConfigFile”: “/dev/null” } } } } }’ >/etc/origin/master/master-config.yaml.patched if [ $? == 0 ]; then mv -f /etc/origin/master/master-config.yaml.patched /etc/origin/master/master-config.yaml /usr/local/bin/master-restart api && /usr/local/bin/master-restart controllers else exit fi

Please refer to the official homepage of K3s for detailed installation instructions. Here, a short guide on how to run Keptn on K3s is provided for a Linux environment. Note: If you are using macOS, you will need to run K3s using multipass and as explained here.

  1. Download, install K3s (tested with versions 1.17 to 1.21) and run K3s using the following command:

    curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.20.4+k3s1 K3S_KUBECONFIG_MODE="644" sh -s - --no-deploy=traefik
    

    This installs version v1.20.4+k3s1 (please refer to the K3s GitHub releases page for newer releases), sets file permissions 644 on /etc/rancher/k3s/k3s.yaml and disables traefik as an ingress controller.

  2. Export the Kubernetes profile using

    export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
    
  3. Verify that the connection to the cluster works

    kubectl get nodes   
    

Please refer to the official homepage of K3d for detailed installation instructions. Here, a short guide on how to run Keptn on K3d is provided for a Linux environment.

Note: Docker is required to use k3d. k3d v5.x.x requires at least Docker v20.10.5 (runc >= v1.1.0-rc93) to work properly.

You must install kubectl before installing K3d. This is used to interact with the Kubernetes cluster.

  1. Download, install K3d (tested with v5.3.0) and run K3d using the following command:

    curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | TAG=v5.3.0 bash
    

    This installs version v5.3.0 (please refer to the K3d GitHub releases page for newer releases).

  2. Create a cluster called My keptn which has port fowarding and disables the traffic, which is a ingress gateaway.

    k3d cluster create mykeptn -p "8082:80@loadbalancer" --k3s-arg "--no-deploy=traefik@server:*"
    
  3. Verify that the connection to the cluster works

    kubectl get nodes   
    
  1. Download and install Minikube (tested with versions 1.3 to 1.10).

  2. Create a new Minikube profile (named keptn) with at least 6 CPU cores and 14 GB memory using:

    minikube start -p keptn --cpus 6 --memory 14000
    
  3. (Optional) Start the Minikube LoadBalancer service in a second terminal by executing:

    minikube tunnel 
    

Keptn runs on any other Kubernetes distribution as it only consists of Kubernetes deployments, services, RBAC rules, and PVCs. If you are facing problems, please let us know on https://slack.keptn.sh.