In this tutorial we are going to learn how to install keptn on k3s.
Why would you want to do this?
What is K3s?
But:
To start the keptn-on-k3s installation properly, you need a machine running Linux with the curl
package installed.
Currently, this has been tested using following distributions:
If you want to install keptn-on-k3s with Dynatrace support, you will need to create a Dynatrace token.
export DT_TENANT=yourtenant.live.dynatrace.com
export DT_API_TOKEN=yourAPItoken
Keptn-on-k3s is a keptn-sandbox project at the moment. It is a very simple shell script, which installs k3s (from their GitHub Repository) and afterwards applies the manifests for keptn.
The keptn-dynatrace-service or the keptn-prometheus-service can also be installed automatically with keptn-on-k3s. This can be achieved by specifying a provider (this will query the corresponding metadata endpoint) or set the IP address manually. If hostname -I
is working on the machine and no provider or IP address is specified, the installer will use the first reasonable IP address.
To expose keptn's bridge and the api via an ingress controller, keptn-on-k3s needs to know the IP address which will be used (to generate a xip.io entry and the Ingress objects).
You can install keptn-on-k3s (with autodetection of your IP address using the command hostname -I
):
curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/master/install-keptn-on-k3s.sh | bash -s -
When installing keptn-on-k3s on a public cloud, the IP address can not be detected directly on the host. Therefore, a --provider
option is implemented, which instructs the script to query the metadata endpoint of the the specified cloud provider and get the public ip address of the node.
As a result, the installation- of keptn-on-k3s on a cloud provider can be triggered using the command:
curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/master/install-keptn-on-k3s.sh | bash -s - --provider [gke|aks|digitalocean]
It may be the case, that you want to specify the IP address manually, this can be achieved using the --ip
option:
curl -Lsf https://raw.githubusercontent.com/keptn-sandbox/keptn-on-k3s/master/install-keptn-on-k3s.sh | bash -s - --ip [your-ip]
Additionally, you can install keptn-on-k3s with support for Dynatrace, Prometheus or the jMeter service. This can be done via the --with-dynatrace
, --with-prometheus
or --with-jmeter
flags.
Every release of Keptn provides binaries for the Keptn CLI. These binaries are available for Linux, macOS, and Windows.
There are multiple options how to get the Keptn CLI on your machine.
curl -sL https://get.keptn.sh | sudo -E bash
This will download and install the Keptn CLI automatically.keptn
binary in the unpacked directorychmod +x keptn
), and move it to the desired destination (e.g. mv keptn /usr/local/bin/keptn
)Now, you should be able to run the Keptn CLI:
keptn --help
.\keptn.exe --help
After installation, you get the required information needed to communicate with the keptn API or to access the keptn's Bridge. Therefore, the following output is shown at the end of the installation (In this example, -ip 127.0.0.1
has been used for the installation):
API URL : https://api.keptn.127.0.0.1.xip.io
Bridge URL: https://bridge.keptn.127.0.0.1.xip.io
Bridge Username: keptn
Bridge Password: FvSv8KLD1sCa7LWrW1yEV7TUAy6g5T35
API Token : qonZAH53/L/LbN7Rph9Mkg==
To use keptn:
- Install the keptn CLI: curl -sL https://get.keptn.sh | sudo -E bash
- Authenticate: keptn auth --api-token "qonZAH53/L/LbN7Rph9Mkg==" --endpoint "https://api.keptn.127.0.0.1.xip.io"
Using this information, you can simply connect the keptn CLI to the API
keptn auth --endpoint=API-URL --api-token=API-Token
At the end a message indicating that you are successfully authenticated should be shown.
The keptn's bridge is exposed automatically, and can be accessed using the URL and the credentials which are displayed after the installation.
Now that you have successfully installed the keptn control plane, you may want to configure quality gates.
Here are some possibilities:
--with-prometheus
)--with-dynatrace
)