@systemcraftsman We need more than just containers kubernetes ? Scheduling Decide where to deploy containers Lifecycle and health Keep containers running despite failures Discovery Find other containers on the network Monitoring Visibility into running containers Security Control who can do what Scaling Scale containers up and down Persistence Survive data beyond container lifecycle Aggregation Compose apps from multiple containers
@systemcraftsman What is Kubernetes? Kubernetes is an open-source system for automating deployment, operations, and scaling of containerized applications across multiple hosts kubernetes
@systemcraftsman The Control Loop In robotics and automation, a control loop is a non-terminating loop that regulates the state of a system. In Kubernetes, controllers are control loops that watch the state of your cluster, then make or request changes where needed.
@systemcraftsman Developing Controllers You can develop Controllers with any language, such as: To manage Kubernetes resources by using: ● Labels ● Annotations ● ConfigMaps
@systemcraftsman Java Operator SDK https://javaoperatorsdk.io/ Java Operator SDK is a higher level framework and related tooling to support writing Kubernetes Operators in Java. It makes it easy to implement best practices and patterns for an Operator. It provides a controller runtime, support for testing operators, and related tooling. In addition to that implementing conversion hooks and dynamic admission controllers are supported as a separate projects.
@systemcraftsman Java Operator SDK https://github.com/java-operator-sdk/java-operator-sdk ● Wraps Fabric8 and configures it for listening to changes on the specified Custom Resources, thus hiding the boilerplate code required for this. ● Provides a clean interface to implement the reconciliation loop for a particular resource type. ● Schedules change events to be executed in an efficient manner. Filtering obsolete events and executing unrelated events in parallel. ● Retry failed reconciliation attempts.
@systemcraftsman Reconciliation in Java Operator SDK # Reconciliation execution is always triggered by an event. # Events typically come from a primary resource, most of the time a custom resource. Reconciler implementations are associated with a given resource type. # No concurrent reconciliation happens for any given resource. # If an exception is thrown during execution, then it schedules a retry. # If new events are received during the controller execution, then a new reconciliation is scheduled. # If the reconcilier instructed the SDK to reschedule a reconciliation at a later date, then a timer event with the specified delay is scheduled.
@systemcraftsman Reconciliation in Java Operator SDK Controller Level Eventing Level Reconciliation Level An Operator is a set of independent controllers. The Controller class, however, is an internal class managed by the framework itself and usually shouldn’t interacted with directly by end users. It manages all the processing units involved with reconciling a single type of Kubernetes resource.
@systemcraftsman Other Features of Java Operator SDK ● Finalizer Support ● Support for Well Known (non-custom) Kubernetes Resources ● Max Interval Between Reconciliations ● Automatic Retries on Error ● Reconciliation Rate Limiting ● Dynamically Changing Target Namespaces ● Automatic Generation of CRDs ● …and many more at https://javaoperatorsdk.io/docs/features
@systemcraftsman Quarkus Operator SDK Features ● Automatically generates a main class ● Provides CDI for the Kubernetes client ● Automatically generates CRDs for all CustomResource implementations used by reconcilers ● Provides a bundle generator ● All Quarkus features such as: ○ The Quarkus Dev mode ○ Native binary generation ○ CDI ○ All MicroProfile Spec benefits (SmallRye is the implementation) ■ Health Check ■ Reactive Messaging ■ … ● For more: https://quarkiverse.github.io/quarkiverse-docs/quarkus-operator-sdk