Skip to content

Commit 6ba45ea

Browse files
committed
Update nonssa-vs-ssa.md
1 parent 5450eab commit 6ba45ea

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

docs/content/en/blog/news/nonssa-vs-ssa.md

+19-28
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ date: 2025-02-25
44
---
55

66
From version 5 of Java Operator SDK [server side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/)
7-
is a first-class feature, and used by default to update resources.
8-
As we will see, unfortunately (or fortunately) to use of it requires changes for your reconciler implementation.
7+
is a first-class feature and is used by default to update resources.
8+
As we will see, unfortunately (or fortunately), using it requires changes for your reconciler implementation.
99

10-
For this reason, we prepared a feature flag, which you can flip if not prepared to migrate yet:
10+
For this reason, we prepared a feature flag, which you can flip if you are not prepared to migrate yet:
1111
[`ConfigurationService.useSSAToPatchPrimaryResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L493)
1212

1313
Setting this flag to false will make the operations done by `UpdateControl` using the former approach (not SSA).
1414
Similarly, the finalizer handling won't utilize SSA handling.
15-
The plan is to keep this flag and allow to use the former approach (non-SSA) also in future releases.
15+
The plan is to keep this flag and allow the use of the former approach (non-SSA) also in future releases.
1616

1717
For dependent resources, a separate flag exists (this was true also before v5) to use SSA or not:
1818
[`ConfigurationService.ssaBasedCreateUpdateMatchForDependentResources`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java#L373)
1919

2020

2121
## Resource handling without and with SSA
2222

23-
Until version 5 changing primary resource through `UpdateControl` did not use server-side apply.
24-
So usually the implementation of reconciler looked something like this:
23+
Until version 5, changing primary resources through `UpdateControl` did not use server-side apply.
24+
So usually, the implementation of the reconciler looked something like this:
2525

2626
```java
2727

@@ -36,15 +36,15 @@ So usually the implementation of reconciler looked something like this:
3636

3737
```
3838

39-
In other words, after reconciliation of managed resources, the reconciler updates the status on the
40-
primary resource passed as argument to the reconciler.
41-
Such changes on primary are fine since we don't work directly with the cached object, the argument is
39+
In other words, after the reconciliation of managed resources, the reconciler updates the status of the
40+
primary resource passed as an argument to the reconciler.
41+
Such changes on the primary are fine since we don't work directly with the cached object, the argument is
4242
already cloned.
4343

44-
So how does this change with SSA?
44+
So, how does this change with SSA?
4545
For SSA, the updates should contain (only) the "fully specified intent".
46-
In other words, we should fill only the values that we care about.
47-
In practice means creating a **fresh copy** of the resource and setting only what is necessary:
46+
In other words, we should only fill in the values we care about.
47+
In practice, it means creating a **fresh copy** of the resource and setting only what is necessary:
4848

4949
```java
5050

@@ -64,35 +64,26 @@ public UpdateControl<WebPage> reconcile(WebPage webPage, Context<WebPage> contex
6464
}
6565
```
6666

67-
Note that we just filled the status here, since we patch the status (not the resource spec).
67+
Note that we just filled out the status here since we patched the status (not the resource spec).
6868
Since the status is a sub-resource in Kubernetes, it will only update the status part.
6969

70-
Every controller you register will have its own default [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#managers).
70+
Every controller you register will have its default [field manager](https://kubernetes.io/docs/reference/using-api/server-side-apply/#managers).
7171
You can override the field manager name using [`ControllerConfiguration.fieldManager`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java#L89).
72-
That will set the field manager for the updates of the primary resource and dependent resources.
72+
That will set the field manager for the primary resource and dependent resources as well.
7373

7474
## Migrating to SSA
7575

7676
Using the legacy or the new SSA way of resource management works well.
7777
However, migrating existing resources to SSA might be a challenge.
78-
So we strongly encourage everyone to test the migration, thus write an integration test where
79-
a custom resource is created using legacy approach is getting managed by new approach.
78+
We strongly recommend testing the migration, thus implementing an integration test where
79+
a custom resource is created using the legacy approach and is managed by the new approach.
8080

81-
We prepared an integration test to demonstrate how such migration even in a simple case can go wrong,
81+
We prepared an integration test to demonstrate how such migration, even in a simple case, can go wrong,
8282
and how to fix it.
8383

8484
To fix some cases, you might need to [strip managed fields](https://kubernetes.io/docs/reference/using-api/server-side-apply/#clearing-managedfields)
8585
from the custom resource.
8686

8787
See [`StatusPatchSSAMigrationIT`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuspatchnonlocking/StatusPatchSSAMigrationIT.java) for details.
8888

89-
Also feel free to report common issues, so we can in case prepare some utilities to handle them.
90-
91-
92-
93-
94-
95-
96-
97-
98-
89+
Feel free to report common issues, so we can prepare some utilities to handle them.

0 commit comments

Comments
 (0)