Rookout's k8s operator
- Patch deployments with init container that loads rookout agent
- Inject pod metadata into containers to be collected by the SDK
- Java (version >= 8)
- Deployment (pod resources which not part of deployment not affected by the operator)
# install the operator
kubectl apply -f ./config/samples/deployment.yaml
# deploy operator's configuration
kubectl apply -f ./config/samples/rookout_v1alpha1_rookout.yaml
# test deployment
kubectl logs deployment.apps/rookout-controller-manager -n rookout -c manager
# uinstall
kubectl delete -f ./config/samples/deployment.yaml
kubectl delete -f ./config/samples/rookout_v1alpha1_rookout.yaml
time="2021-01-20T17:49:10Z" level=info msg="operator configuration updated"
time="2021-01-20T17:49:27Z" level=info msg="adding rookout agent to container <CONTAINER> of deployment <DEPLOYMENT> in <NAMESPACE> namespace"
time="2021-01-20T17:49:27Z" level=info msg="deployment <DEPLOYMENT> patched successfully"
- Project's initial structure created by
operator-sdk init
- Operator's entry point : /controllers/rookout_controller.go
- Operator Resource API : /api/v1alpha1/rookout_types.go
- Install operator sdk:
brew install operator-sdk
- Init repo:
make all
- Move to a dev cluster
- Run make build-and-deploy
- It should create an operator on rookout namespace
- Can't inject to PID=1 on linux alpine with openjdk < 14
- Java 7 requires Suns's tools.jar
- Basic operator tutorial - here
- Inspired by this blog post
- Inspired by prometheus-jmx-exporter-operator
- Controller watches - we use them to get notified on pods events