To install and configure keptn in a Kubernetes cluster, follow these instructions:
The next steps expect that you have a working Kubernetes cluster on AWS EKS. In case you do not have an EKS cluster available there are a couple of ways to setup your own cluster 1. Follow the Getting Started Guides. 2. Leverage Terraform Templates such as Tereraform AWS EKS Cluster by Cloudposse
When creating your own cluster we recommend the following minimum sizing definitions:
If you end up using the Terraform scripts from Cloudposse I suggest you create a terraform.tvars file with the following settings
namespace = "<yourprojectname>" stage = "workshop" name = "keptn01" instance_type = "t3.2xlarge" max_size = 3 min_size = 2 apply_config_map_aws_auth = "true"
Once your EKS cluster and all nodes are up & running we can go on with deploying keptn.
The scripts provided by keptn v.0.1 run in a BASH and require following tools locally installed:
Tip: View all the kubectl commands, including their options and descriptions in the kubectl CLI reference.
Additionally, the scripts need:
GitHub organizationto store the repositories of the sockshop application
GitHub personal access tokento push changes to the sockshop repositories
API Token must have the permissions as shown in the screenshot below:
Go to the keptn release page to download the installation file using, e.g.,
$ cd ~ $ wget ...
Extract the package and move to the keptn directory:
$ tar -xvzf keptn-v.0.1.0.tar.gz $ cd keptn
Keptn contains all scripts and instructions needed to deploy the demo application Sockshop on a Kubernetes cluster.
forkGitHubRepositories.sh script in the
scripts directory. This script takes the name of the GitHub organization you have created earlier. This script clones all needed repositories and uses
hub to fork those repositories to the passed GitHub organization. Afterwards, the script deletes all repositories and clones them again from the GitHub organization.
$ cd ~/keptn/scripts/ $ ./forkGitHubRepositories.sh <GitHubOrg>
Insert information in ./scripts/creds.json by executing
defineCredentials.sh in the
scripts directory. This script will prompt you for all information needed to complete the setup and populate the file scripts/creds.json with them.
Attention: This file will hold your personal access-token and credentials needed for the automatic setup of keptn. Take care of not leaking this file! (As a first precaution we have added this file to the
.gitignore file to prevent committing it to GitHub.)
setupInfrastructure.sh in the
scripts directory. This script deploys a container registry and Jenkins service within your cluster, as well as an initial deployment of the sockshop application in the dev, staging, and production namespaces. Please note that this is an initial step to provide you with running services in all three environments. In the course of the different use cases provided by keptn, the microservices will be built and deployed by the Jenkins pipelines set up by keptn.
Attention: The script will create several new resources for you and will also update the files shipped with keptn. Take care of not leaking any files that will hold personal information. Including:
Note: The script will run for some time (~10-15 min), since it will wait for Jenkins to boot before setting credentials via the Jenkins REST API.
To verify the deployment of the sockshop service, retrieve the URLs of your front-end in the dev, staging, and production environments with the
kubectl get svc
$ kubectl get svc front-end -n dev NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE front-end LoadBalancer 10.23.252.*** **.225.203.*** 8080:30438/TCP 5m
$ kubectl get svc front-end -n staging NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE front-end LoadBalancer 10.23.246.*** **.184.97.*** 8080:32501/TCP 6m
$ kubectl get svc front-end -n production NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE front-end LoadBalancer 10.23.248.*** **.226.62.*** 8080:32232/TCP 7m
kubectl get svc command to get the EXTERNAL-IP and PORT of Jenkins. Then user a browser to open Jenkins and login using the default Jenkins credentials:
Note: It is highly recommended to change these credentials right after the first login.
$ kubectl get svc jenkins -n cicd NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE jenkins LoadBalancer 10.23.245.*** ***.198.26.*** 24***:32478/TCP,50***:31867/TCP 10m
To verify the correct installation of Jenkins, go to the Jenkins dashboard where you see the following pipelines:
Finally, navigate to Jenkins > Manage Jenkins > Configure System and scroll to the environment variables to verify whether the variables are set correctly. Note: The value for the parameter DT_TENANT_URL must start with https://
Create a naming rule for process groups
Screenshot shows this rule definition.
To explore the capabilities of keptn, follow the provided use cases that are dedicated to a special topic. All use cases can be found in the keptn online doc
To clean up your Kubernetes cluster, execute the
cleanupCluster.sh script in the
Delete GitHub Organization
If you want to remove Sockshop from your GitHub feel free to delete your GitHub Organization