In this post will see about what is Keptn and how to install it in the Kubernetes cluster.
What is Keptn?
Keptn is an open-source control plane to build cloud-native, industry-driven continuous delivery systems. 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. According to Dynatrace, Keptn augments any standard Kubernetes cluster to support delivery based on automated quality gates and self-healing operations workflows.
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 summarize, Keptn basically looks after:
- Automated Tests
- Automated Deployments
- Pitometer’s Automated Quality Gates – a Quality Gate as Code Service
- Integrated whole stack monitoring, such as Dynatrace, allows for automated operations.
Why Keptn? As there are more tools in the market? Here is some of issues Keptn trying to solve it.
Issue1: Enterprise-Wide Continuous Delivery
The first issue addressed by Keptn is enterprise-wide automated continuous delivery. The majority of the teams the Keptn developers spoke with said they spend too much time and money establishing pipelines, custom tool interfaces, and managing their own data warehouses. Many teams across labs or regions have built their own CD pipelines in large businesses, and have spent a substantial amount of effort maintaining and nurturing this “soon to become monolithic legacy pipeline code”!. This was addressed by Keptn.
Issue2: Continuous Deployment and Continuous Operational Issues
Keptn orchestrates not just Continuous Deployment, but also Continuous or Automated Operations. Alois Reitbauer discusses the two main ideas of Keptn in his analogy. He compares it to NASA’s Launch and Mission Control when launching a rocket:
Until the launch timer reaches 00:00, NASA’s Launch Control is in charge. They can terminate the expedition till then, depending on the info they have! With Continuous Deployment, the release team is in charge of successfully deploying an artifact (for example, a new container image). They can “abort” the deployment at any time using several methods, such as automatic quality gates or using blue/green or canary releases in production. They can, also, halt an artifact from being rolled out to the entire user base at any time. As a result, Keptn provides automated multi-stage unbreakable delivery pipelines, as well as automatic quality gates and production-safe deployments!
Once the rocket lifts off, NASA’s Mission Control takes charge. They can’t cancel the trip, so they must deal with any issues that arise in order to ensure that astronauts can safely ascend and descend from space.
When using Automated Operations, the operations team is responsible for doing everything possible to minimize the impact on end customers in the event of a problem. This will be accomplished by, for example, scaling up to more resources when required, redirecting traffic for specific users, clearing log folders, and so on. It is necessary to automate as many of these procedures as possible in order to react quickly.
As a result, Keptn offers event-driven runbook automation to quickly correct errors discovered in production while minimizing the impact on end-users.
Installation
Here are the steps to follow to install the keptn,
- Define the Keptn chart repository
- Install Keptn into the keptn namespace on the Kubernetes cluster
- Expose the API gateway service that controls how Keptn communicates with the internet. See Choose access option for details about all the options that are available and how to install and use them. You can also do this after installation.
- You may also want to modify the Keptn configuration options. This is discussed more below.
Here are the installation objects we can use to install the keptn using kubernetes,
--version 0.19.3
– Keptn release to be installed. If you do not specify the release, Helm uses the latest release.--repo=https://charts.keptn.sh
– the location of the Helm chart. You can use this option rather than running thehelm repo add
command as shown above).apiGatewayNginx.type=<access-option>
– this is necessary to access Keptn.<access-option>
must beLoadBalancer
,NodePort
, orClusterIP
. See Choose access options for details.--create-namespace
– creates thekeptn
namespace if it does not already exist.--set=continuousDelivery.enabled=true
– install Continuous Delivery support for this Keptn instance.
- Install core control plane components and expose via a LoadBalancer:
# helm install keptn keptn --repo=https://charts.keptn.sh \
-n keptn --create-namespace \
--set=apiGatewayNginx.type=LoadBalancer \
--set=continuousDelivery.enabled=true \
--wait
- Install the execution plane components. These are additional microservices that will handle certain tasks:
# helm install jmeter-service keptn/jmeter-service -n keptn
# helm install helm-service keptn/helm-service -n keptn
Use a LoadBalancer for api-gateway-nginx
# helm upgrade keptn keptn --install -n keptn --create-namespace --wait --version=0.19.3 --repo=https://charts.keptn.sh --set=apiGatewayNginx.type=LoadBalancer
Install Keptn with an Ingress object
If you are already using an Ingress Controller and want to create an ingress object for Keptn, you can leverage the ingress
section of the Helm chart.
The Helm chart allows customizing the ingress object to your needs. When ingress.enabled
is set to true
(by default, enabled
is set to false
), the chart allows you to specify optional parameters of host
, path
, pathType
, tls
, and annotations
. This supports many different Ingress-Controllers and configurations.
# helm upgrade keptn keptn --install -n keptn --create-namespace --set=ingress.enabled=true,ingress.annotations=<YOUR_ANNOTATIONS>,ingress.host=<YOUR_HOST>,ingress.path=<YOUR_PATH>, ingress.pathType=<YOUR_PATH_TYPE>, ingress.tls=<YOUR_TLS>
Install Keptn CLI
The Keptn CLI sends commands to Keptn by interacting with the Keptn API. The API Token that is used to communicate with Keptn is generated during the installation.
curl
# curl -sL https://get.keptn.sh/ | bash
This installs the Keptn CLI for you in the current directory on your cloud shell machine. You can use sudo to move the file to another location. You can run the Keptn CLI from any directory but you may need to specify the location of the path, using .keptn rather than just keptn if it is in your current directory.
Homebrew
# brew install keptn
Binaries
Binaries for the Keptn CLI are provided for Linux, macOS, and Windows.
- Download the latest version for your operating system from: GitHub
- Unpack the archive
- Find the keptn binary in the unpacked directory
- Linux / macOS: Add executable permissions (chmod +x keptn), and move it to the desired destination (e.g. mv keptn /usr/local/bin/keptn)
- Windows: Copy the executable to the desired folder and add the executable to your PATH environment variable.
- Now, verify that the installation has worked and that the version is correct by running:
- Linux / macOS
# keptn version
- Windows
$ .\keptn.exe version
Note: For the rest of the documentation, we will stick to the Linux / macOS version of the commands.
Please like and subscribe us to get our regular updates. on Instagram, Twitter and Youtube