Install CRDs into kubernetes that periodically monitor resources. Currently handles HTTP, but could be extended to handle more.
Data is exported as prometheus metrics, which may be used to send alerts.
See samples.
See metrics.go.
The grafana dashboard may be found in the kustomize-based deployment repo.
This project uses kubebuilder as a way of generating code.
To install kubebuilder:
os=$(go env GOOS)
arch=$(go env GOARCH)
# download kubebuilder and extract it to tmp
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch}/bin/kubebuilder /usr/local/
- update
*_types.go
file make manifests
- generate CRD YAML inconfig/crd/bases/
make generate
- generate GO code
kubebuilder create api --group monitoring.raisingthefloor.org --version v1alpha1 --kind [new kind]
- fill in
api/v1alpha1/[new kind]_types.go
- implement
controllers/[new kind]_controller.go
make manifests generate
This project uses KIND and tilt for rapid development.
For setup:
export KUBECONFIG=kind-kubeconfig.yaml
# Sets up a KIND cluster and a local registry connected to it
sh kind-up.sh
# start tilt. Hit space after to open tilt in your browser (recommended)
# Local changes will automatically be built and pushed to kube.
tilt up
# To shut down:
tilt down
sh kind-down.sh