This repo provides the scripts to create a local kubernetes/openshift 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
- Modify kind config to make sure
extraMounts:
cover the linux header and BCC. - Export
CLUSTER_PROVIDER
env variable:
export CLUSTER_PROVIDER=kind
or
export CLUSTER_PROVIDER=microshift
- 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
CLUSTER_PROVIDER=microshift
CLUSTER_NAME=microshift
PROMETHEUS_ENABLE=false
GRAFANA_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.