garden
garden copied to clipboard
[FEATURE]: Add server-side apply option to kubernetes action
Feature Request
Background / Motivation
When applying manifests using kubectl apply, theres a limitation of 256kb because of how annotations work.
If you use kubectl apply --server-side then it doesn't suffer from this limitation, however there may be added complications with resolving conflicts.
https://kubernetes.io/docs/reference/using-api/server-side-apply/
What should the user be able to do?
For a given kubenetes module you should be able to enable the --server-side switch when garden executes kubectl apply
Why do they want to do this? What problem does it solve?
Suggested Implementation(s)
How important is this feature for you/your team?
π₯ Crucial, Garden is unusable for us without it
π΅ Not having this feature makes using Garden painful
πΉ Itβs a nice to have, but nice things are nice π
Given server-side apply is required for anything over 256k, I'd say this is actually quite important for many people (like OLM's CRDs, they must be SSA'ed).
I've a similar issue with adding CRDs from TiDB. Maybe it make sense to add something like this
like https://docs.garden.io/reference/action-types/deploy/kubernetes#spec.kustomize.extraargs
spec:
apply:
extraArgs:
- "--server-side=true"
or
like: https://docs.garden.io/reference/action-types/build/container#spec.buildargs
spec:
applyArgs:
- "--server-side=true"
or
spec:
apply:
serverSide: true
Just for testing, adding
args.push("--server-side=true")
after line 122 in https://github.com/garden-io/garden/blob/main/core/src/plugins/kubernetes/kubectl.ts#L122 is working for me :sweat_smile:
Do you maybe have a hint for me, how i should get and pass the spec.XY arg from config to the apply function? Just started to open a PR ;) https://github.com/garden-io/garden/pull/6107