This repo provides the scripts to create a local kubernetes cluster to be used for development or integration tests. It is also used in Github action for kepler.
Please install the same version of kubectl
and kind
as Github-hosted runner.
Currently Kepler project's Github Action only supports Ubuntu
based runners.
You can refer to tools list here
./main.sh prerequisites
Will setup ebpf on your host instance.
./main.sh containerruntime
Will setup container runtime on your host instance.
-
Modify kind config to make sure
extraMounts:
cover the linux header and BCC. -
To setup local env run:
./main.sh up
-
To tear down local env run:
./main.sh down
Alternatively, use
.env
file to define and override the default configuration variables. E.g#.env PROMETHEUS_ENABLE=false GRAFANA_ENABLE=false TEKTON_ENABLE=false KUBEVIRT_ENABLE=false
Start the cluster by running
./main.sh up
There's a container registry available which is exposed at localhost:5001
.
To set up a local cluster for kepler development, we need to make the cluster connected with a local container registry.
- Check kubectl version.
- Check k8s cluster provider's version(as KIND).
- Check prometheus operator version.
Please feel free to refer to kind provider implementation to contribute a k8s cluster. Please ensure that these checklist are statisfies as Kepler requires certain feature to be available.
-
The provider related script should be placed under
'./provider/<name>/<name.sh>'
-
The script should have a
<provider>_up
function that sets up the k8s cluster. -
The script should have a
<provider>_down
function that deletes the cluster. -
The script should have a
<provider>_kubeconfig
function that prints the path to the cluster's kubeconfig that is located on host machine. Consider usingtmp/<provider>/kubeconfig
as the path to create/copy the kubeconfig file. -
Ensure cluster can pull from the local specific registry since for local development, we expect to push the development image to the local registry instead of a public registry.
-
Mount local path of linux kernel and ebpf(BCC) inside kepler pod.
In order to make contributions to this repo, you need to have the following installed:
You can install pre-commit by running the following command:
pip install pre-commit
After installing pre-commit, you need to install the pre-commit hooks by running the following command:
pre-commit install
To run pre-commit manually
pre-commit run --all-files