Getting started locally is pretty easy. You can execute:
make e2e-buildThis installs all required operators an installs the operator within a KinD Cluster. The required binaries are also downloaded.
If you wish to test against a specific Kubernetes version, you can pass that via variable:
KIND_K8S_VERSION="v1.31.0" make e2e-buildWhen you want to quickly develop, you can scale down the operator within the cluster:
kubectl scale deploy observability-addon --replicas=0 -n observability-addonAnd then execute the binary:
go run cmd/main.go -zap-log-level=10You might need to first export the Kubeconfig for the cluster (If you are using multiple clusters at the same time):
bin/kind get kubeconfig --name observability-addon > /tmp/observability-addon
export KUBECONFIG="/tmp/observability-addon"When you are done with the development run the following commands.
For Liniting
make golintFor Unit-Testing
make testFor Unit-Testing (When running Unit-Tests there should not be any argotranslators, tenants and appprojects present):
make e2e-execWhen making changes to the Helm-Chart, Update the documentation by running:
make helm-docsLinting and Testing the chart:
make helm-lint
make helm-testUse PProf for profiling:
curl -s "http://127.0.0.1:8082/debug/pprof/profile" > ./cpu-profile.out
go tool pprof -http=:8080 ./cpu-profile.out