Go to file
Patryk Gudalewicz 8fb5af1285 Initial commit 2022-10-27 13:06:35 +02:00
.gitignore Initial commit 2022-10-27 13:06:35 +02:00
createDash.py Initial commit 2022-10-27 13:06:35 +02:00
environment.yaml Initial commit 2022-10-27 13:06:35 +02:00
kubernetes_tiles_template.json Initial commit 2022-10-27 13:06:35 +02:00
readme.md Initial commit 2022-10-27 13:06:35 +02:00
requirements.txt Initial commit 2022-10-27 13:06:35 +02:00

readme.md

Kubernetes dashboard as a code

This repository holds the code to generate the Kubernetes overwiew Dashboard as Code.

Dashboard is generated for specific cluster provided as parameter for the script.

Dashboard naming convention is: "[PROVIDED CLUSTER NAME] - Kubernetes cluster overview"

Prerequisites

Python packages

Before executing scripts, python requirements have to be satisfied. To do so, execute following command: pip install -r requirements.txt

.env file

To provide authentication for API calls, create ".env" file in the script directory with following definition:

<ENV NAME>=<ENV TOKEN>
	<ENV NAME> is name of environment variable. This name should be passed to "environment.yaml" file as "env-token-name" parameter
	Example:
	environment.yaml file: "- env-token-name: "GLOBAL_CONFIG_TOKEN"
	.env file: "GLOBAL_CONFIG_TOKEN=XXXXXXXXXXX"

Usage

	usage: createDash.py [-h] -C CLUSTER [--remove] [-E ENVIRONMENT]

	Generate and deploy the Kubernetes Overview Dashboard as Code.

	options:
	-h, --help            show this help message and exit
	-C CLUSTER, --cluster CLUSTER
							Name of the Kubernetes cluster (default: None)
	--remove              Remove dashboard for given cluster. If not specified dashboard will be created or updated (default: False)
	-E ENVIRONMENT, --environment ENVIRONMENT
							Name of the environment (the same as in environment.yaml file. Used to upload dashboard to specific Dynatrace environment. If not specified all environments in file will be used (default: None)

Files

createDash.py

This scripts generates Dashboard and uploads it to Dynatrace.

environment.yaml

File containing environments to connect to Dynatrace tenant

Environment name:
	name: string										#name ov environment
	env-url: str										#url of environment
	env-token-name: str									#name of environment variable containing API token

requirements.txt

File containing required python packages

kubernetes_tiles_template.json

File containing template for dashboard