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

Use Server Side Apply when creating Kubernetes resources #2626

Closed
phillebaba opened this issue Jun 14, 2024 · 0 comments · Fixed by #3075
Closed

Use Server Side Apply when creating Kubernetes resources #2626

phillebaba opened this issue Jun 14, 2024 · 0 comments · Fixed by #3075
Assignees

Comments

@phillebaba
Copy link
Member

Describe what should be investigated or refactored

We have a couple of places in Zarf where we need to do a create or update on a resource. This is handled in a couple of different ways currently. Either the resource is deleted first and then created. Alternatively we use a verbose logic to try creating and falling back to an update if the resource already exists.

A much better way is to switch over to SSA instead. This moves any responsibility to the API server instead, removing any need for us to deal with checking if a resource exists or not first

Links to any relevant code

https://github.com/defenseunicorns/zarf/blob/7415967772410ceeb77aae7b61367dad85b1516f/src/pkg/cluster/state.go#L114-L127

Additional context

https://kubernetes.io/docs/reference/using-api/server-side-apply/
https://kubernetes.io/blog/2022/10/20/advanced-server-side-apply/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants