A quick start guide to get Kepler up and running.
This guide assumes you have the following installed:
In order to make contributions to Kepler, 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
Use make cluster-up
to setup a local development cluster running in Kind.
The make target cluster-up
works by cloning
local-dev-cluster repo
locally and using the scripts in the repo to setup a Kubernetes running locally
using Kind
.
NOTE: Considering that your local environment is different to CI, we strongly recommend that you check prerequisites and start up to customize your own local development environment.
You can find technical discussions within the community regarding this topic by following this enhancements proposal and related issue.
make cluster-deploy
Make target cluster-deploy
does the following
- Build the necessary manifests.
- Build and Push the Kepler image to local registry.
- Deploys Kepler with the newly created image.
- Validate Kepler installation.
If you want to use container registry of your choice:
make cluster-deploy IMAGE_REPO=index.docker.io/myrepo IMAGE_TAG=mybuild NO_BUILD=true
If you want to run Kepler with privileged setup:
make cluster-deploy IMAGE_REPO=index.docker.io/myrepo IMAGE_TAG=mybuild OPTS=ROOTLESS NO_BUILD=true
This quick tutorial is for developing and testing Kepler locally but with access to kubelet
Refer to the builder Dockerfile
Go to the root of the repo and do the following:
make _build_local
If successful, the binary is at _output/bin/_/kepler
Create the k8s role and token, copy data files, this is only needed once.
cd dev/
./create_k8s_token.sh
./prepare_dev_env.sh
Then run the Kepler binary at _output/bin/_/kepler
Kepler metrics are available under <host_ip>:8888/metrics by default
./hack/build-images.sh help
kepler
exposes standard go profiling
endpoint at /debug/pprof/profile
. Following examples show how to profile
kepler with go tool pprof
.
NOTE: These examples assume kepler
is running (or port-forwarded in case
of k8s) on localhost:8888
.
Detailed information about using pprof can be found in their documentation.
go tool pprof 'http://localhost:8888/debug/pprof/profile?seconds=30'
go tool pprof 'http://localhost:8888/debug/pprof/heap?seconds=30'
-http
option can be used to visualize existing pprof in
go tool pprof -http 0.0.0.0:8000 'http://localhost:8888/debug/pprof/heap?seconds=30'
or
go tool pprof -http 0.0.0.0:8000 <path/to/pprof-capture >.pb.gz