#Best Practice Controller for Kubernetes
##What is this controller about?
This best practice controller is an example controller written in Pure Java by using K8S Java Client SDK.
Enforcing best practice in K8S in production for multiple teams is hard.
What if there is a way to encode every lesson learnt by someone else into a controller and let this controller be the operator?
By leveraging the operator pattern, we can setup policy for production use and continuous auditing if best practices have been enforced.
This is the code for the blog:
Kubernetes Controller — Implement in Java (Part 1)
K8S Java Client SDK — Patching and update a resource
Prerequisite reads:
Coding K8S resource in Java — Part 1 of 2 (K8S API)
Coding K8S resource in Java — Part 2 (Java Client)
Some known issues with Java 11's TLS with minikube
Note: When you build this project with Java 11 and Maven, please use:
mvn clean package -Djdk.tls.client.protocols=TLSv1.2 -DskipTests
This version does not enforce best practice except showing off how:
- Deep copy works in OpenAPI generated Java SDK
- How to generate JSON Patch (imperative way) of submitted patch to the API server
- How to write a controller with indexer and informer in Java
- How event handling and reconciler loop
Do NOT use for production!