What is keptn, how it works and how to get started!![2022]

turned on laptop computer
Reading Time: 3 minutes

The Keptn project began as a way to assist enterprises in adopting cloud-native strategies for either cutting-edge microservice applications or long-standing monoliths. This ecosystem has been evolving since its inception, focusing on robust continuous delivery with automated testing, quality gates, and auto-remediation capabilities. It now has over 50.

In this post, we will understand everything about this tool, including why it was built and the various issues it solves.

What is Keptn?

Keptn was founded in early 2019 with the goal of assisting enterprises in embracing cloud-native concepts by delivering a ready-to-use platform for continuous delivery. It included automated testing, quality gating, and operations automation through coordinating automation and remediation tools. The project’s base was a well-established technique that Dynatrace had already successfully implemented in practice and offered as a full-week training to partners and clients.

Since the start of the project, this “battery-included” strategy has been a driving force. The project, however, swiftly evolved from an interactive demo to a ready-to-use Kubernetes infrastructure. External dependencies like Jenkins and Knative have been removed, and Keptn has evolved into a cloud-native control plane that automates the delivery and operational procedures by connecting to your target platform’s DevOps tools of choice.

To list it’s features in nutshell, we get:

  • Automated Tests
  • Automated Deployments
  • A Quality gate as a Code Service
  • Whole stack monitoring

Why we may use Keptn ??

Listed below are the features that have made this tool the most indemand tool of 2022.

  • It has addressed the most critical enterprise issue i.e Continous Delivery. Many teams worldwide have build their own CD pipelines in large businesses and have spent a minimum amount of effort in maintaining and nurturing this monolithic code.
  • It orchestrates not only just Continous Deployment but also continous or automated operations. It offers event-driven runbook to quickly correct errors discovered in production while minimizing th eimpact on end-users.

Now, lets do some Demo!!

Demo 1

In this demo, we will create a simple project in Kubernetes that will print “Hello World” on localhost.

Prerequisites

Machine with Docker installed and at least 8GB RAM.

Run the Hello World example:

docker run --rm -it \
--name thekindkeptn \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--add-host=host.docker.internal:host-gateway \
gardnera/thekindkeptn:0.0.15

The Keptn Bridge (UI) will be available on http://localhost or 0.0.0.0:80

Outcome

The command above has:

  • Created a Kubernetes cluster in Docker using k3d.
  • Installed Keptn and removed all authentication (for demo purposes)
  • Installed and authenticated the keptn CLI
  • Created a helloworld project
  • Ran your first hello Keptn sequence

DEMO 2

Installing Keptn using K3d. Use this method if you don’t have Docker and either have or don’t mind installing k3d.

Prerequisites

The following tools need to be installed for this tutorial:

  • Docker with minimum 4vCPUS, 12GB RAM, 20GB disk space left.
  • kubectl version >= 1.19
  • helm version >= 3.3.0
  • git

Installing K3d

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

You can check its version by running k3d --version.

Install Keptn

  1. Start a k3d cluster
k3d cluster create mykeptn -p "8082:80@loadbalancer" --k3s-server-arg "--kube-proxy-arg=conntrack-max-per-core=0"  --k3s-agent-arg "--kube-proxy-arg=conntrack-max-per-core=0" --agents 1

2. Download and install Keptn CLI.

curl -sL https://get.keptn.sh | bash

3. Install control-plane and execution-plane for continuous delivery use case using Helm.

helm install keptn https://github.com/keptn/keptn/releases/download/0.14.1/keptn-0.14.1.tgz -n keptn --create-namespace --set=continuous-delivery.enabled=true --wait
helm install helm-service https://github.com/keptn/keptn/releases/download/0.14.1/helm-service-0.14.1.tgz -n keptn --create-namespace --wait
helm install jmeter-service https://github.com/keptn/keptn/releases/download/0.14.1/jmeter-service-0.14.1.tgz -n keptn --create-namespace --wait

4. Configure ingress and authenticate Keptn CLI.

curl -SL https://raw.githubusercontent.com/keptn/examples/master/quickstart/expose-keptn.sh | bash

You can now access the Web UI at http://127.0.0.1.nip.io:8082/bridge.

Conclusion

In this blog I have tried to cover Keptn introduction, its use cases and installation process with docker and with K3d.

Please like and subscribe the blog to get more informative blogs like this !!

References

Keptn Docs: https://keptn.sh/docs/quickstart/

Written by 

Rishabh Verma is Google Certified Professional DevOps Engineer. He is always charged up for new things & learnings. He is dedicated to his work and believes in quality output. He loves to take deep dives into cloud technologies & different tools.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading