Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Server Side Apply #3334

Closed
xaviersierra opened this issue Jul 20, 2021 · 5 comments · Fixed by #3937
Closed

Add support for Server Side Apply #3334

xaviersierra opened this issue Jul 20, 2021 · 5 comments · Fixed by #3937

Comments

@xaviersierra
Copy link

xaviersierra commented Jul 20, 2021

Server Side Apply

Starting from kubernetes 1.16, Server Side Apply it's enabled by default.

This feature is very useful from a operator development point of view,
since it would require fewer requests to the Kubernetes API during the reconciliation cycle.

Using Server Side Apply has also the advantage that inform to users
who owns which field of a given resource.

Proposed Change

Add a boolean field to the io.fabric8.kubernetes.client.dsl.base.PatchContext named serverSide. That if it's true, sets the request content type to application/apply-patch+yaml.

@rohanKanojia
Copy link
Member

Related to #2454

@stale
Copy link

stale bot commented Oct 19, 2021

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@shawkins
Copy link
Contributor

shawkins commented Mar 8, 2022

Fabric8 6 will support server side apply with a patch call:

client.services().withName("name").patch(PatchContext.of(PatchType.SERVER_SIDE_APPLY), service);

you may need to force it if the resource was not created using the fabric8 server side apply:

client.services().withName("name").patch(new PatchContext.Builder().withPatchType(PatchType.SERVER_SIDE_APPLY).withForce(true).build(), service);

@tacf
Copy link

tacf commented Mar 9, 2022

@shawkins Doesn't this solution provide a way to patch through the use of manifests? As in, does this only allow patching with the use of code defined objects?

@shawkins
Copy link
Contributor

shawkins commented Mar 9, 2022

As in, does this only allow patching with the use of code defined objects?

There are other patch methods that accept the patch as a string if you don't want to use the object representation.

manusa pushed a commit that referenced this issue Mar 12, 2022
* fix #3334: adding basic support for server side apply

* setting a default user agent

* applying spotless and updating changelog

* adding ssa to the cheat sheet

also making updates for client building and generics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants