Get started with Keptn — Multi-stage delivery with Quality Gates(Demo)-Part 1

Start with provisioning a Kubernetes cluster

Setup your repository for Keptn project

GIT_USER=gitusername
GIT_TOKEN=gittoken
GIT_REMOTE_URL=remoteurl

Connect to your Kubernetes

Let’s start configuring your cluster

  1. Install Istio
  2. Download Keptn CLI and Install Keptn into your cluster
  3. Configure Istio

Let’s get started with Keptn now

KEPTN_ENDPOINT=http://$(kubectl -n keptn get ingress api-keptn-ingress -ojsonpath='{.spec.rules[0].host}')/apiKEPTN_API_TOKEN=$(kubectl get secret keptn-api-token -n keptn -ojsonpath='{.data.keptn-api-token}' | base64 --decode)KEPTN_BRIDGE_URL=http://$(kubectl -n keptn get ingress api-keptn-ingress -ojsonpath='{.spec.rules[0].host}')/bridgekeptn auth --endpoint=$KEPTN_ENDPOINT --api-token=$KEPTN_API_TOKEN
keptn configure bridge --output

Create a Keptn project

  1. Download a sample application
git clone https://github.com/codeWithUtkarsh/podtato-head.git
cd podtato-head/delivery/keptn
keptn create project pod-tato-head --shipyard=./shipyard.yaml --git-user=$GIT_USER --git-token=$GIT_TOKEN --git-remote-url=$GIT_REMOTE_URL
keptn create project pod-tato-head --shipyard=./shipyard.yaml --git-user=codeWithUtkarsh --git-remote-url=https://github.com/codeWithUtkarsh/keptn-poc --git-token=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
apiVersion: "spec.keptn.sh/0.2.0"
kind: "Shipyard"
metadata:
name: "shipyard-sockshop"
spec:
stages:
- name: "hardening"
sequences:
- name: "delivery"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "blue_green_service"
- name: "test"
properties:
teststrategy: "performance"
- name: "evaluation"
- name: "release"
- name: "production"
sequences:
- name: "delivery"
triggeredOn:
- event: "hardening.delivery.finished"
tasks:
- name: "deployment"
properties:
deploymentstrategy: "blue_green_service"
- name: "release"
          tasks:
- name: "deployment"
properties:
deploymentstrategy: "blue_green_service"
- name: "test"
properties:
teststrategy: "performance"
- name: "evaluation"
- name: "release"
triggeredOn:
- event: "hardening.delivery.finished"
cd helm-charts
tar cfvz ./helloservice.tgz ./helloservice
cd ..
keptn add-resource --project=pod-tato-head --stage=hardening --service=helloservice --resource=jmeter/load.jmx --resourceUri=jmeter/load.jmxkeptn add-resource --project=pod-tato-head --stage=hardening --service=helloservice --resource=jmeter/jmeter.conf.yaml --resourceUri=jmeter/jmeter.conf.yaml
keptn trigger delivery --project="pod-tato-head" --service=helloservice --image="gabrieltanner/hello-server" --tag=v0.1.1

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Utkarsh Sharma

Utkarsh Sharma

Cloud Enthusiast and Open Source Contributor | Java Microservices Developer | 6X Azure Certified | MCT | Love for Hiking ❤