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

Open
phillebaba opened this issue Jun 14, 2024 · 0 comments
Open

Use Server Side Apply when creating Kubernetes resources #2626

phillebaba opened this issue Jun 14, 2024 · 0 comments
Labels
tech-debt 💳 Debt that the team has charged and needs to repay

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/

@phillebaba phillebaba added the tech-debt 💳 Debt that the team has charged and needs to repay label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt 💳 Debt that the team has charged and needs to repay
Projects
Status: No status
Development

No branches or pull requests

1 participant