Skip to content

Commit af41092

Browse files
committed
Change KEP to new plan
1 parent 0c4a1d5 commit af41092

File tree

2 files changed

+93
-57
lines changed

2 files changed

+93
-57
lines changed

keps/sig-cli/3805-ssa-default/README.md

Lines changed: 89 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ apply` now would come with a cost.
8080
We’re proposing a way forward toward toggling the `--server-side` flag
8181
by default.
8282

83-
8483
## Motivation
8584

8685
While changing from client-side to server-side is difficult because it
@@ -102,23 +101,29 @@ For maintainers:
102101
- kubectl has a lot of code to maintain SMP and other client-side apply
103102
mechanisms. Removing the feature can greatly reduce the complexity of
104103
kubectl
104+
- Removes some ugly server-side code meant to deal with transition from
105+
client-side apply to server-side apply.
105106

106107
### Goals
107108

108109
The goal is to increase usage of Server-Side Apply so that users can
109110
benefits from the feature, mostly by turning the feature on by default.
111+
We also want to reach that goal by making the transition as smooth as
112+
possible, and limit the risk of converting objects from client-side to
113+
server-side mode.
110114

111115
### Non-Goals
112116

113-
Good question.
117+
N/A
114118

115119
## Proposal
116120

117-
The feature consists of adding a new `auto` value to the `--server-side`
118-
flag for `kubectl apply` (and corresponding `kubectl diff`) and make
119-
this the default value. All the other values for the flag would continue
120-
to work as expected (for reference, `false` continues to client-side
121-
apply, and `true` continues to server-side apply).
121+
The feature, in its alpha phase, consists of adding a new `auto` value
122+
to the `--server-side` flag for `kubectl apply` (and corresponding
123+
`kubectl diff`) while keeping `false` as the default value. All the
124+
other values for the flag would continue to work as expected (for
125+
reference, `false` continues to client-side apply, and `true` continues
126+
to server-side apply).
122127

123128
The meaning of `auto` goes as follows:
124129
- Resources continue to be fetched (GET) before-hand
@@ -129,36 +134,64 @@ The meaning of `auto` goes as follows:
129134
- If the resource already exists but doesn't have the `last-applied`
130135
annotation, the resource is server-side applied
131136

137+
We are also planning on switch the `--server-side` flag to `true` in
138+
three releases, by adding a warning message (and a blog-post) in kubectl
139+
1.27 to let people know that the change will happen.
140+
141+
<<[UNRESOLVED What default value for --force-conflict]>>
142+
We're not entirely sure what the value of `--force-conflict` should be
143+
when we switch to `server-side=true`.
144+
145+
A few thoughts. The question can be summarized with the following
146+
trade-off: Are conflicts worth breaking people? We would also have to
147+
change the value of `--force-conflict`, which will break some people,
148+
but arguably a much smaller set of people.
149+
150+
We don't know yet, but I'll assume we don't flip the switch in the rest
151+
of the document since that use-case is more complicated.
152+
<<[/UNRESOLVED]>>
153+
154+
<<[UNRESOLVED Removal of CSA]>>
155+
We considered removing the
156+
`--server-side` flag altogether 2-3 releases after `true` becomes the
157+
default. Curious if other folks think this is an option.
158+
<<[/UNRESOLVED]>>
159+
132160
### User Stories (Optional)
133161

134162
#### Story 1
135163

136-
User 1 starts using `kubectl` for the first time or on a new
137-
project, everything will always be server-side applied, they will get
138-
conflicts and all the good things about server-side apply.
164+
User 1 uses `--server-side=auto` and starts using `kubectl` for the
165+
first time, creates a new project, everything will always be server-side
166+
applied, they will never have any object to migrate from client-side to
167+
server-side apply. When the flag eventually fips, they
168+
already have the hard-coded auto value so they don't really see a
169+
change, but they can decide to remove the flag if they want.
139170

140171
#### Story 2
141172

142-
User 2 only uses server-side apply all the time, they may have
143-
`--server-side` inserted in some scripts or configuration, or they must
144-
remember to always include the flag. Thanks the feature, forgetting the
145-
flag is now doing the right thing by server-side applying all their
146-
resources as expected, causing less confusion and risks of messing up.
173+
User 2 uses `--server-side=auto` and periodically re-creates their
174+
project, at first, their project might have a mix of server-side applied
175+
and client-side applied resources, but they will eventually have only
176+
server-side applied resources, without ever having to migrate any
177+
resource from one to the other. When the flag eventually fips, they
178+
already have the hard-coded auto value so they don't really see a
179+
change, but they can decide to remove the flag if they want.
147180

148181
#### Story 3
149182

150-
User 3 has never used server-side apply and always used the default
151-
value of `--server-side`. Applying their existing resources will
152-
continue to work as expected. New resources, on the other hand, will at
153-
first apply the same but may eventually show-up with a conflict. They
154-
may have to update scripts to continue to work with
155-
`--server-side=false` if they want to, or they can update their
156-
scripts/workflow to address the conflicts properly.
183+
Users 3 who use either the default value of `--server-side` or an
184+
existing value will see no immediate change to the behavior. They will
185+
get the warning if running manually and possibly try it out, or they may
186+
miss the warning in scripts. In 3 releases, people who have completely
187+
missed the warning will see their thing break, they can either fix it by
188+
changing the value of `--server-side=false` or the value of
189+
`--force-conflict=true`, a fairly easy change.
157190

158191
### Risks and Mitigations
159192

160193
This design has no impact on security, but some consequences on UX, since the
161-
default UX of `kubectl apply` will change:
194+
default UX of `kubectl apply` will change, 3 releases from now:
162195
- Currently, it can never fail because of conflict, since they are
163196
overridden by default. The new default for Server-Side Apply is to
164197
fail on conflicts, unless the `--force-conflict` flag is used. While
@@ -174,7 +207,9 @@ default UX of `kubectl apply` will change:
174207
object on the server. SSA has more complicated semantics for removing
175208
fields (e.g. if another user manages fields)
176209

177-
<!-- Missing mitigation here -->
210+
This will be mitigated by laying out a plan to address these issues for
211+
people who meet them, through a blog-post. Actual mitigation is to set
212+
`--server-side=false` or `--force-conflict=true`.
178213

179214
## Design Details
180215

@@ -187,21 +222,22 @@ applied by default.
187222
The `last-applied` annotation is used to detect previous client-side
188223
applied object, hence it is not inserted for server-side objects.
189224

190-
The interaction with other `kubectl apply` flags can be described as
191-
follows:
192-
- `--force-conflicts` only applies to existing resources that are
193-
server-side applied
194-
- `--fieldmanager` applies to all resources
195-
- The `--prune` family of flags, I have no idea
196-
- `--overwrite` only applies to client-side applied resources
225+
`kubectl apply` flags that are specific to client-side apply will
226+
continue to work for client-side applied objects (prune, overwrite),
227+
while server-side apply flags will apply to existing server-side applied
228+
resources and new resources. Notably, the `--force-conflict` flag is
229+
somewhat incompatible with `--server-side=false` today, it will be
230+
possible to use the flag with `auto` (and we will entirely disallow it
231+
with `--server-side=false`).
197232

198233
Some other commands might be impacted. `kubectl create` (and family)
199234
notably have a `--save-config` flag that create the last-applied
200235
annotation. While I don't know how many people actually use the flag,
201236
the idea of saving this as a config is confusing, since people don't
202237
actually have the file and so the situation doesn't really fit well the
203238
`apply` workflow. We suggest adding a warning when this flag is used, as
204-
well as updating its documentation to suggest not using it.
239+
well as updating its documentation to suggest not using it, and possibly
240+
deprecate it in the future.
205241

206242
Because `kubectl diff` is supposed to map the behavior of `kubectl
207243
apply` as closely as possible, the change will also be done for that
@@ -277,23 +313,26 @@ Alpha is the current level of the feature since server-side apply is
277313
currently enabled by default in Kubernetes, but enabled on-demand by
278314
kubectl users.
279315

280-
The feature already has a fair amount of usage though since tools
281-
(sometimes outside of kubectl) have used it both as "clients" and in
282-
controllers.
316+
The feature already has a fair amount of usage since tools (sometimes
317+
outside of kubectl) have used it both as "clients" and in controllers.
283318

284319
#### Beta
285320

321+
<!--
322+
To be re-evaluated later:
286323
Server-Side Apply has a very limited set of bugs or feature requests as
287324
this point and is definitely mature. Enabling client-side will allow
288325
increased usage and reduce burden cost for kubectl to maintain both
289-
mecahnisms.
326+
mechanisms. -->
290327

291328
#### GA
292329

330+
<!--
331+
To be re-evaluated later:
293332
Kubectl doesn't have real-time metrics for usage. The decision to move
294333
to server-side entirely by default (if ever enabled) will be driven by
295334
bug reports and complaints from customers. Also by the ability to
296-
migrate existing client-side usage to server-side.
335+
migrate existing client-side usage to server-side. -->
297336

298337
#### Deprecation
299338

@@ -303,8 +342,6 @@ We are not intending to deprecate the flag, but we might remove the
303342
Same thing applies for `--save-config` and other client-side related
304343
flags in kubectl which we might remove.
305344

306-
No deprecation is planned at that time though.
307-
308345
### Upgrade / Downgrade Strategy
309346

310347
While upgrade / downgrade doesn't really apply to a kubectl feature, we
@@ -326,8 +363,7 @@ N/A.
326363
- [x] Other
327364
- Describe the mechanism:
328365

329-
People can actively use the `--server-side=false` flag to disable the
330-
feature entirely and go back to the former behavior.
366+
Feature is enabled on-demand, and can stop using it at any time.
331367

332368
- Will enabling / disabling the feature require downtime of the control
333369
plane?
@@ -341,8 +377,7 @@ Feature is client-side only, no.
341377

342378
###### Does enabling the feature change any default behavior?
343379

344-
Yes. The feature is a change to the default behavior, which can be
345-
reverted by using the former value of the flag.
380+
No, enabling the `auto` feature means actively selecting it.
346381

347382
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
348383

@@ -352,7 +387,7 @@ way to configure it's default value.
352387
###### What happens if we reenable the feature if it was previously rolled back?
353388

354389
Toggling the flag value can have impact, but that's already the case.
355-
Changing the default to an automatic detection will actually help with
390+
Changing the value to an automatic detection will actually help with
356391
that.
357392

358393
###### Are there any tests for feature enablement/disablement?
@@ -390,12 +425,12 @@ I need to add the tests here.
390425

391426
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
392427

393-
This will change the default behavior of `kubectl apply` in possibly
394-
surprising way. `kubectl apply` can now fail because of a conflict,
395-
which it wouldn't before on newly created objects. Another surprising
396-
behavior is that since fields can be owned by multiple actors, removing
397-
a field will not necessarily remove the field from the cluster's
398-
resource.
428+
This will eventually change the default behavior of `kubectl apply` in
429+
possibly surprising way. `kubectl apply` can now fail because of a
430+
conflict, which it wouldn't before on newly created objects. Another
431+
surprising behavior is that since fields can be owned by multiple
432+
actors, removing a field will not necessarily remove the field from the
433+
cluster's resource.
399434

400435
### Monitoring Requirements
401436

@@ -509,9 +544,10 @@ There are basically three different alternatives to the current design:
509544
server-side applied. The drawback of this approach is that the baby
510545
step doens't really get us anywhere close to where we want: having
511546
server-side apply enabled by default.
512-
3. Enable `--server-side=true` by default, this is what we're aiming for
513-
in GA, but we think we should ease things by first going with
514-
`--server-side=auto` to help the transition.
547+
3. Make `--server-side=auto` the default, but that doesn't get us closer
548+
to what we want: have the feature enabled by default, or test the
549+
migration.
550+
515551

516552
## Infrastructure Needed (Optional)
517553

keps/sig-cli/3805-ssa-default/kep.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ approvers:
1515
see-also:
1616
- "/keps/sig-api-machinery/555-server-side-apply"
1717
replaces:
18-
stage: beta
18+
stage: alpha
1919
latest-milestone: "v1.27"
2020
milestone:
21-
alpha: "v1.22" # Feature is alpha since SSA is GA
22-
beta: "v1.27"
23-
stable: "v1.30" # Provisional
21+
alpha: "v1.27"
22+
beta: "v1.30" # Provisional
23+
stable: "v1.32" # Provisional
2424
feature-gates: # N/A
2525
disable-supported: false
2626
metrics: # N/A

0 commit comments

Comments
 (0)