Skip to content

isItObservable/keptn-lifecycle-Toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Is it Observable

Is It observable Logo

Episode : What is Keptn LifeCycle Toolkit

This repository contains the files utilized during the tutorial presented in the dedicated IsItObservable episode related to Keptn LifeCycle Toolkit.

Keptn Logo

What you will learn

This repository showcase the usage of Keptn LifeCycle Toolkit with :

  • The Otel-demo
  • The OpenTelemetry Operator
  • Nginx ingress controller
  • Dynatrace

We will send all Telemetry data produced by the Otel-demo , and KLT to Dynatrace.

Prerequisite

The following tools need to be install on your machine :

  • jq
  • kubectl
  • git
  • gcloud ( if you are using GKE)
  • Helm

Deployment Steps in GCP

You will first need a Kubernetes cluster with 2 Nodes. You can either deploy on Minikube or K3s or follow the instructions to create GKE cluster:

1.Create a Google Cloud Platform Project

PROJECT_ID="<your-project-id>"
gcloud services enable container.googleapis.com --project ${PROJECT_ID}
gcloud services enable monitoring.googleapis.com \
    cloudtrace.googleapis.com \
    clouddebugger.googleapis.com \
    cloudprofiler.googleapis.com \
    --project ${PROJECT_ID}

2.Create a GKE cluster

ZONE=europe-west3-a
NAME=isitobservable-keptn-lifecycle-tookit
gcloud container clusters create "${NAME}" --zone ${ZONE} --machine-type=e2-medium --num-nodes=3 

Getting started

Dynatrace Tenant

1. Dynatrace Tenant - start a trial

If you don't have any Dyntrace tenant , then i suggest to create a trial using the following link : Dynatrace Trial Once you have your Tenant save the Dynatrace (including https) tenant URL in the variable DT_TENANT_URL (for example : https://dedededfrf.live.dynatrace.com)

DT_TENANT_URL=<YOUR TENANT URL>

2. Create the Dynatrace API Tokens

Create a Dynatrace token with the following scope ( left menu Acces Token):

  • ingest metrics
  • ingest OpenTelemetry traces

data token

Save the value of the token . We will use it later to store in a k8S secret
DATA_INGEST_TOKEN=<YOUR TOKEN VALUE>

3.Clone the Github Repository

https://github.com/isItObservable/keptn-lifecycle-Toolkit
cd keptn-lifecycle-Toolkit

4.Deploy most of the components

The application will deploy the otel demo v1.2.1

chmod 777 deployment.sh
./deployment.sh  --clustername "${NAME}" --dturl "${DT_TENANT_URL}" --dttoken "${DATA_INGEST_TOKEN}"

4. Modify Keptn LifeCycle Toolkit

We will change the otel collector url define in the KLS in 2 deployments :

Update Deployment klc-controller-manager

kubectl edit deployment  klc-controller-manager -n keptn-lifecycle-toolkit-system

Change the OTEL_COLLECTOR_URL to use oteld-collector.default.svc.cluster.local:4317

Update Deployment keptn-scheduler

kubectl edit deployment  keptn-scheduler -n keptn-lifecycle-toolkit-system

Change the OTEL_COLLECTOR_URL to use oteld-collector.default.svc.cluster.local:4317

Add the Grafana Dashboard

kubectl apply -f keptn/grafana-dashboard-keptn-overview.yaml
kubectl apply -f keptn/grafana-dashboard-keptn-workloads.yaml
kubectl apply -f keptn/grafana_dashboard-keptn-application.yaml

5. Deploy the Otel-demo Application

the version 1.2.1

kubectl create ns otel-demo
kubectl apply -f keptn/v1/application.yaml -n otel-demo
kubectl apply -f kubernetes-manifests/openTelemetry-sidecar.yaml -n otel-demo
kubectl annotate ns otel-demo  keptn.sh/lifecycle-toolkit="enabled"
kubectl apply -f keptn/keptn-predeployment_adservice.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_cartservice.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_checkoutservice.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_currency.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_featureflag.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_frontend.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_kafka.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_paymentservice.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_postgres.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_productcatalogserice.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_recommendation.yaml  -n otel-demo
kubectl apply -f keptn/keptn-predeployment_redis.yaml -n otel-demo
kubectl apply -f keptn/keptn-predeployment_shipping.yaml -n otel-demo
kubectl apply -f keptn/v1/K8sdemo.yaml -n otel-demo

Let's have a look at the workload instances

kubectl get keptnworkloadinstance -n otel-demo

if we look at the pod running we will see the pods handling are various tasks

kubectl get pods -n otel-demo

the version 1.2.2

ubectl apply -f  keptn/v2/application.yaml -n otel-demo
kubectl apply -f keptn/v2/keptn-postdeployment_http.yaml -n otel-demo
kubectl apply -f keptn/v2/post-deployment-eval.yaml -n otel-demo
kubectl apply -f keptn/v2/pre-deployment-eval.yaml -n otel-demo
kubectl apply -f keptn/v2/provider.yaml -n otel-demo
kubectl apply -f keptn/v2/K8sdemo.yaml -n otel-demo

About

Tutorial for Keptn LifeCycle Toolkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages