k0sctl icon indicating copy to clipboard operation
k0sctl copied to clipboard

make drain option configuable

Open walf443 opened this issue 1 year ago • 1 comments

fix #724

walf443 avatar Jun 02 '24 01:06 walf443

I think the config syntax needs some further thinking.

  1. Should it be node specific or global? 🤔 Adding node specific settings becomes quite tedious if it's something you want to set for all hosts. You can use yaml anchors, but it's not really straightforward either. I've been thinking if there should be some kind of "host groups" or "host classes" or something else that could be used to easily set some base values for a large number of hosts. Something like:

    metadata:
      hostgroups:
        longDrain:
          drainGracePrediod: 100d
        corpBastion:
          bastion:
            address: 10.0.0.1
            port: 8822
            user: ${USER}
    spec:
      hosts:
        - role: controller
          groups:
          - longDrain
          - corpBastion 
    

    Maybe there could be something like this to set something for all hosts?:

    metadata:
      hostdefaults:
        drainGracePeriod: 100d
    
  2. Maybe it should be a flag but there could be a k0sctl.yaml way to set flags? There's already --no-drain which is kind of related to these settings, so adding these new settings that are set in a different place feels slightly wrong.

    But there's also reasons to have some or all of them settable through k0sctl.yaml.

    Maybe there could be something like metadata.options as an alternate source for all flag values 🤔

kke avatar Jun 03 '24 12:06 kke