No description
| bundle | ||
| config | ||
| controllers | ||
| hack | ||
| .dockerignore | ||
| .gitignore | ||
| bundle.Dockerfile | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| Makefile | ||
| PROJECT | ||
| README.md | ||
| README_generated.md | ||
Operator that puts a pod's node name in the pod labels
I needed this and couldn't find it, so I made it. Most of the files here were generated by the operator-sdk program. The meat of the operator is in controllers/pod_controller.go.
Basically, if you annotate a pod with the annotation k8s.maxweiss.io/label-pod-node: "true" then the pod will magically get a label called "node-name" which matches the pod's spec.nodeName.
To build the docker image yourself, just run make docker-build.
To generate the Kubernetes resources in order to install this, go to the config/default directory and run kustomize build. Once you apply the output to your cluster, you're good to go.