actions icon indicating copy to clipboard operation
actions copied to clipboard

setup-kind action: add feature-gates input

Open norbjd opened this issue 1 year ago • 3 comments

Hello :wave:

First, thanks for the setup-kind action, it's very useful to remove boilerplate in all repositories requiring KinD.

For one of my projects, I was missing the featureGates parameter in my KinD config with this action. This is something possible (see docs about feature gates), so I've decided to add it here and contribute upstream to also benefit others.

With this change, we can define one or multiple (or zero) feature gates, separated by commas:

- name: Setup KinD with 1 feature gate
  uses: norbjd/actions/setup-kind@add-feature-gates-to-setup-kind
  with:
    k8s-version: 1.28.x
    kind-worker-count: 1
    feature-gates: InPlacePodVerticalScaling,HPAScaleToZero,ConsistentListFromCache # NEW!

And this will create a KinD config with these feature gates enabled:

apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
# existing stuff, I have not touched that
featureGates:
  InPlacePodVerticalScaling: true
  HPAScaleToZero: true
  ConsistentListFromCache: true

I have created a test repository using this action to see if my change works correctly: https://github.com/norbjd/test-setup-kind-action/blob/main/.github/workflows/test.yaml.

I have tested the following cases:

  • use 1 feature gate: https://github.com/norbjd/test-setup-kind-action/actions/runs/6677787095/job/18148138768#step:2:188 :heavy_check_mark:
  • use multiple feature gates: https://github.com/norbjd/test-setup-kind-action/actions/runs/6677787095/job/18148138861#step:2:187 :heavy_check_mark:
  • don't use any feature gate (just to catch regressions): https://github.com/norbjd/test-setup-kind-action/actions/runs/6677787095/job/18148138963#step:2:186 :heavy_check_mark: (no featureGates section in yaml)

Hope this is something you can consider adding in that action.

Thanks! :pray:

norbjd avatar Oct 28 '23 15:10 norbjd

Just to clarify, I've used a comma-separated value for feature-gates because as far as I can tell, it's not possible to define an action input with list type, something like the following:

- name: Not possible
  uses: norbjd/actions/setup-kind@add-feature-gates-to-setup-kind
  with:
    # ...
    feature-gates:
      - InPlacePodVerticalScaling
      - HPAScaleToZero
      - ConsistentListFromCache

Tell me if I'm wrong though.

norbjd avatar Oct 29 '23 12:10 norbjd

Hello :wave:

Sorry about the late reply. I've added some documentation in the README.md as asked: 9a9a4f7. I didn't add it initially because I thought only required fields were documented in the README.md.

Anyway, I hope this is clear enough :grin: otherwise feel free to propose me something and I'll gladly add it.

Thanks!

norbjd avatar Dec 03 '23 13:12 norbjd

Hello @cpanato, just a kind up :innocent:

Are you happy with the last changes? Otherwise, feel free to tell me! Thanks :slightly_smiling_face:

norbjd avatar Mar 17 '24 14:03 norbjd