Header background

Mastering Kubernetes deployments with Keptn: a comprehensive guide to enhanced visibility

Deploying software in Kubernetes is often viewed as a straightforward process—just use kubectl or a GitOps solution like ArgoCD to deploy a YAML file, and you’re all set, right? Unfortunately, Kubernetes deployments can be fraught with challenges beyond the surface level. Numerous hurdles can hinder successful deployments, from resource constraints to external dependencies and monitoring inadequacies. In this article, we’ll explore these challenges in detail and introduce Keptn, an open source project that addresses these issues, enhancing Kubernetes observability for smoother and more efficient deployments.

Understanding Kubernetes deployment challenges

Deploying software using Kubernetes is, on the surface, easy, but there is a lot more to ensure a healthy deployment. There are a lot of potential problems that can prevent the successful deployment of a Kubernetes application, such as:

Resource constraints

In Kubernetes, managing resources efficiently is crucial to prevent performance bottlenecks and application failures. Insufficient CPU and memory allocation to pods can lead to resource contention and stop Pods from being created.

External dependencies

Many applications rely on external services, such as databases, APIs, or third-party services. Ensuring seamless connectivity to these dependencies during deployment is essential for application stability. Consider a scenario where a web application depends on an external payment gateway. Any connectivity issues with the payment gateway during deployment could result in transaction failures and impact the application’s functionality.

Infrastructure health

The underlying infrastructure’s health directly impacts application availability and performance. Vulnerabilities or hardware failures can disrupt deployments and compromise application security. For instance, if a Kubernetes cluster experiences a hardware failure during deployment, it can lead to service disruptions and affect the user experience.

Monitoring inadequacies

Comprehensive monitoring is essential for detecting and resolving issues during deployment. Inadequate monitoring tools or configurations can result in operational blind spots, delaying issue detection and resolution.

Performance degradation

Deploying new versions of applications can sometimes lead to unexpected performance degradation. Changes in application code or configurations can impact performance metrics, affecting user experience and application functionality. For instance, deploying a new version of a web application that introduces inefficient database queries could lead to increased response times and decreased user satisfaction.

This is the problem domain on which Keptn can help Platform Engineers provide a solution and guard rails for teams to deploy software that works perfectly.

Addressing Kubernetes deployment challenges with Keptn

Using Keptn, combined with your standard deployment tooling or practices,

you can move from “I guess it’s okay” to “I know it’s okay”. Keptn allows you to wrap governance and automated checks around the deployment process to ensure that the end-to-end deployment process is healthy and that your application meets the SLOs you’ve defined. This is done by configuring Keptn to execute KeptnTasks and KeptnEvaluations before and after deploying a Kubernetes Workload.

With these, you can implement checks that ensure your infrastructure is in a healthy state before a new version of a deployment is rolled out. This way, you can avoid the problems mentioned above by:

  • Verifying that your cluster has enough resources to run a workload.
  • Checking the reachability of external services that your workloads might require.
  • Ensuring that your monitoring solution monitors your cluster.
  • Verifying that there are no open problems within your cluster.

After successfully deploying a workload, Keptn also provides the means for post-deployment checks. These can be crucial in ensuring that the performance of your newly deployed workload meets your expectations before promoting it to the next stage.

How to get started

Keptn can be installed through Helm with this simple set of commands:

helm repo add keptn https://charts.lifecycle.keptn.sh
helm repo update
helm upgrade --install keptn keptn/keptn Dynatrace® Software Intelligence Platform
   -n keptn-system --create-namespace –wait

For further information and configuration options, head to the Keptn installation documentation. Otherwise, if your application uses the recommended Kubernetes labels, you are ready to go. Keptn will detect your application and provide observability of your deployment out of the box.

Usually, Keptn does not act in isolation during a deployment. In the logical timeline of events, there will be tools acting before Keptn (such as GitOps tools like ArgoCD) and tools that act after Keptn (such as security scanning tools).

If the tools before Keptn begin generating OpenTelemetry data (for example, spans and traces), it would be beneficial to see Keptn’s portion of the work in the correct context as part of the same distributed trace. Similarly, anything that happens after Keptn but still in the same logical “deployment” operation should be included in the end-to-end trace view.

To achieve this, Keptn now accepts tools to pass W3C trace IDs into Keptn

and Keptn will pass such W3C trace IDs out of Keptn, creating true end-to-end visibility.

With this information, Keptn can track from “PR merged” all the way to “deployment running in production,” allowing DevOps to slice and dice observability data to understand how the application reached that state.

After installing Keptn, you can get started by going through the several guides listed below that will introduce you step by step to the features provided by Keptn.

  • Integrate Keptn with your applications, which shows you how to configure your applications to be deployed with Keptn.
  • OpenTelemetry observability, which shows how to configure Keptn to make use of its observability features, so you can have a holistic overview of your application deployments and any issues that arise during deployment.
  • Multi-stage application delivery, which serves as an example of how you can integrate Keptn with ArgoCD and GitHub to take the previous concepts and apply them across multiple application environments, giving you full observability of your application deployment from development into production.

Conclusion

Keptn empowers DevOps teams to conquer the Kubernetes deployment challenge confidently, ensuring smoother and more efficient deployments. By addressing the complexities inherent in Kubernetes deployments and seamlessly integrating with existing tools, Keptn delivers unparalleled visibility and control. Start your journey with Keptn by downloading the first Release Candidate for v2 available now on GitHub.