<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Documentation on Java Operator SDK</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/</link><description>Recent content in Documentation on Java Operator SDK</description><generator>Hugo</generator><language>en</language><atom:link href="https://javaoperatorsdk.io/v5.4/docs/documentation/index.xml" rel="self" type="application/rss+xml"/><item><title>Implementing a reconciler</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/reconciler/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/reconciler/</guid><description>&lt;h2 id="how-reconciliation-works"&gt;How Reconciliation Works&lt;/h2&gt;
&lt;p&gt;The reconciliation process is event-driven and follows this flow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Event Reception&lt;/strong&gt;: Events trigger reconciliation from:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Primary resources&lt;/strong&gt; (usually custom resources) when created, updated, or deleted&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Secondary resources&lt;/strong&gt; through registered event sources&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Reconciliation Execution&lt;/strong&gt;: Each reconciler handles a specific resource type and listens for events from the Kubernetes API server. When an event arrives, it triggers reconciliation unless one is already running for that resource. The framework ensures no concurrent reconciliation occurs for the same resource.&lt;/p&gt;</description></item><item><title>Error handling and retries</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/error-handling-retries/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/error-handling-retries/</guid><description>&lt;h2 id="how-automatic-retries-work"&gt;How Automatic Retries Work&lt;/h2&gt;
&lt;p&gt;JOSDK automatically schedules retries whenever your &lt;code&gt;Reconciler&lt;/code&gt; throws an exception. This robust retry mechanism helps handle transient issues like network problems or temporary resource unavailability.&lt;/p&gt;
&lt;h3 id="default-retry-behavior"&gt;Default Retry Behavior&lt;/h3&gt;
&lt;p&gt;The default retry implementation covers most typical use cases with exponential backoff:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000"&gt;GenericRetry&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;.&lt;/span&gt;&lt;span style="color:#c4a000"&gt;defaultLimitedExponentialRetry&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;()&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;.&lt;/span&gt;&lt;span style="color:#c4a000"&gt;setInitialInterval&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;5000&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#8f5902;font-style:italic"&gt;// Start with 5-second delay&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;.&lt;/span&gt;&lt;span style="color:#c4a000"&gt;setIntervalMultiplier&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;1&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;.&lt;/span&gt;&lt;span style="color:#c4a000"&gt;5D&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#8f5902;font-style:italic"&gt;// Increase delay by 1.5x each retry&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;.&lt;/span&gt;&lt;span style="color:#c4a000"&gt;setMaxAttempts&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;5&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;);&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt; &lt;/span&gt;&lt;span style="color:#8f5902;font-style:italic"&gt;// Maximum 5 attempts&lt;/span&gt;&lt;span style="color:#f8f8f8"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="configuration-options"&gt;Configuration Options&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Using the &lt;code&gt;@GradualRetry&lt;/code&gt; annotation:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Rate limiting</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/rate-limiting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/rate-limiting/</guid><description>&lt;p&gt;It is possible to rate limit reconciliation on a per-resource basis. The rate limit takes
precedence over retry/reschedule configurations: for example, even if a retry would reschedule a reconciliation
but this request would make the resource go over its rate limit, the next
reconciliation will be postponed according to the rate limiting rules. Note that the
reconciliation is never cancelled, it will just be executed as early as possible based on rate
limitations.&lt;/p&gt;</description></item><item><title>Event sources and related topics</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/eventing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/eventing/</guid><description>&lt;h2 id="handling-related-events-with-event-sources"&gt;Handling Related Events with Event Sources&lt;/h2&gt;
&lt;p&gt;See also
this &lt;a href="https://csviri.medium.com/java-operator-sdk-introduction-to-event-sources-a1aab5af4b7b"&gt;blog post&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;Event sources are a simple yet powerful and extensible mechanism for triggering controller
executions, usually in response to changes to managed resources. You need an event source
whenever your &lt;code&gt;Reconciler&lt;/code&gt; must react to something happening on a &lt;em&gt;secondary&lt;/em&gt; resource that
affects your primary resource&amp;rsquo;s state. By default, a &lt;code&gt;Reconciler&lt;/code&gt; only listens to events on the
primary resource type it is configured for.&lt;/p&gt;</description></item><item><title>Working with EventSource caches</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/working-with-es-caches/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/working-with-es-caches/</guid><description>&lt;p&gt;As described in &lt;a href="https://javaoperatorsdk.io/v5.4/docs/documentation/eventing/"&gt;Event sources and related topics&lt;/a&gt;, event sources serve as the backbone
for caching resources and triggering reconciliation for primary resources that are related
to these secondary resources.&lt;/p&gt;
&lt;p&gt;In the Kubernetes ecosystem, the component responsible for this is called an Informer. Without delving into
the details (there are plenty of excellent resources online about informers), informers
watch resources, cache them, and emit events when resources change.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;EventSource&lt;/code&gt; is a generalized concept that extends the Informer pattern to non-Kubernetes resources,
allowing you to cache external resources and trigger reconciliation when those resources change.&lt;/p&gt;</description></item><item><title>Testing</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/testing/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/testing/</guid><description>&lt;p&gt;Testing is a critical part of building reliable operators. JOSDK supports multiple testing
strategies, from fast unit tests that mock the Kubernetes API, to full integration tests that run
your operator against a real cluster.&lt;/p&gt;
&lt;h2 id="unit-testing-reconcilers"&gt;Unit Testing Reconcilers&lt;/h2&gt;
&lt;p&gt;The fastest way to test reconciler logic is to unit test the &lt;code&gt;reconcile&lt;/code&gt; method directly. You can
construct a mock or stub &lt;code&gt;Context&lt;/code&gt; and call your reconciler without starting an operator or
connecting to a cluster.&lt;/p&gt;</description></item><item><title>Other Features</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/features/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/features/</guid><description>&lt;p&gt;The Java Operator SDK (JOSDK) is a high-level framework and tooling suite for implementing Kubernetes operators. By default, features follow best practices in an opinionated way. However, configuration options and feature flags are available to fine-tune or disable these features.&lt;/p&gt;
&lt;h2 id="support-for-well-known-kubernetes-resources"&gt;Support for Well-Known Kubernetes Resources&lt;/h2&gt;
&lt;p&gt;Controllers can be registered for standard Kubernetes resources (not just custom resources), such as &lt;code&gt;Ingress&lt;/code&gt;, &lt;code&gt;Deployment&lt;/code&gt;, and others.&lt;/p&gt;
&lt;p&gt;See the &lt;a href="https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/deployment"&gt;integration test&lt;/a&gt; for an example of reconciling deployments.&lt;/p&gt;</description></item><item><title>Architecture and Internals</title><link>https://javaoperatorsdk.io/v5.4/docs/documentation/architecture/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://javaoperatorsdk.io/v5.4/docs/documentation/architecture/</guid><description>&lt;p&gt;This document provides an overview of the Java Operator SDK&amp;rsquo;s internal structure and components to help developers understand and contribute to the project. While not a comprehensive reference, it introduces core concepts that should make other components easier to understand.&lt;/p&gt;
&lt;h2 id="the-big-picture-and-core-components"&gt;The Big Picture and Core Components&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://javaoperatorsdk.io/v5.4/images/architecture.svg" alt="JOSDK architecture"&gt;&lt;/p&gt;
&lt;p&gt;An &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/Operator.java"&gt;Operator&lt;/a&gt; is a set of independent &lt;a href="https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/Controller.java"&gt;controllers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Controller&lt;/code&gt; class is an internal class managed by the framework and typically shouldn&amp;rsquo;t be interacted with directly. It manages all processing units involved with reconciling a single type of Kubernetes resource.&lt;/p&gt;</description></item></channel></rss>