garden icon indicating copy to clipboard operation
garden copied to clipboard

[FEATURE]: Add server-side apply option to kubernetes action

Open ashwiren opened this issue 2 years ago β€’ 1 comments
trafficstars

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 πŸ™‚

ashwiren avatar Feb 24 '23 02:02 ashwiren

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).

24601 avatar Feb 24 '23 07:02 24601

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:

ManAnRuck avatar May 20 '24 08:05 ManAnRuck

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

ManAnRuck avatar May 30 '24 08:05 ManAnRuck