You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consequently, it is now recommended to get the client instance from the `ConfigurationService`.
49
+
50
+
### Operator
51
+
52
+
It is now recommended to configure your Operator instance by using a
53
+
`ConfigurationServiceOverrider` when creating it. This allows you to change the default
54
+
configuration values as needed. In particular, instead of passing a Kubernetes client instance
55
+
explicitly to the Operator constructor, it is now recommended to provide that value using
56
+
`ConfigurationServiceOverrider.withKubernetesClient` as shown above.
57
+
58
+
## Using Server-Side Apply in Dependent Resources
59
+
60
+
From this version by
61
+
default [Dependent Resources](https://javaoperatorsdk.io/docs/dependent-resources) use
62
+
[Server Side Apply (SSA)](https://kubernetes.io/docs/reference/using-api/server-side-apply/) to
63
+
create and
64
+
update Kubernetes resources. A
65
+
new [default matching](https://github.com/java-operator-sdk/java-operator-sdk/blob/e95f9c8a8b8a8561c9a735e60fc5d82b7758df8e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/KubernetesDependentResource.java#L163-L163)
66
+
algorithm is provided for `KubernetesDependentResource` that is based on `managedFields` of SSA. For
67
+
details
68
+
see [SSABasedGenericKubernetesResourceMatcher](https://github.com/java-operator-sdk/java-operator-sdk/blob/e95f9c8a8b8a8561c9a735e60fc5d82b7758df8e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/SSABasedGenericKubernetesResourceMatcher.java)
69
+
70
+
Since those features are hard to completely test, we provided feature flags to revert to the
71
+
legacy behavior if needed,
72
+
see those
73
+
in [ConfigurationService](https://github.com/java-operator-sdk/java-operator-sdk/blob/e95f9c8a8b8a8561c9a735e60fc5d82b7758df8e/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L268-L289)
74
+
75
+
Note that it is possible to override the related methods/behavior on class level when extending
Copy file name to clipboardExpand all lines: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java
+7
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,13 @@ public ConfigurationServiceOverrider withWorkflowExecutorService(
105
105
returnthis;
106
106
}
107
107
108
+
/**
109
+
* Replaces the default {@link KubernetesClient} instance by the specified one. This is the
110
+
* preferred mechanism to configure which client will be used to access the cluster.
111
+
*
112
+
* @param client the fully configured client to use for cluster access
113
+
* @return this {@link ConfigurationServiceOverrider} for chained customization
0 commit comments