Open VannTen opened 10 months ago
split up kubespray-defaults into defaults/main.yml in the role where the variable is used (when the variable is used by multiple role, have a separate _defaults role as a role dependency in every user, where is the most logical user / (dns_mode -> coredns for instance)
I have mixed feeling about that. For variable that can be self contained in their own roles, sure I think that's a good idea to remove those from kubespray-default and include it directly in their own roles. For other variables not sure, IMO we should cleanup kubespray-default first and then decide depending on the resulting file if it's worth it.
eliminate all instances of default filter in roles => var should have a default defined only once
:100:
eliminates docs/vars.md and either use the default files directly as documentation (enforcing proper comment) or generates docs from them => the point being one single source of truth
:+1:
eliminate inventory samples covering all possible variables combination (see https://github.com/kubernetes-sigs/kubespray/issues/10645 , this causes confusions for users) and replace them with minimal samples changing only what's needed.
So yes indeed the current upgrade workflow is not the best, however I and possibly many other use the sample as documentation purposes. I guess an additional minimal template with only popular choices/recommended default could help here but removing the sample should depends on what we do on the previous point about doc as well...
For other variables not sure, IMO we should cleanup kubespray-default first and then decide depending on the resulting file if it's worth it.
Good point. This is not gonna fit in one PR anyway, so I agree, we should do the obvious first and only then see what's left.
... however I and possibly many other use the sample as documentation purposes.
I think the problem mentionned in the linked issue is that the sample is used both as a template for new inventory (which IMO it should not)
and as documentation (which is fine). If our defaults
files are organized correctly, generating an equivalent to that should not be hard
(find -name 'defaults/**/*.yml' -exec cat {} + > all_vars
, something like that).
The issue with the "sample as template" is that user copy the sample as their inventory and once they upgrade kubespray, the sample is no longer reflecting reality. (new vars are fine, but what about changed defaults ? => argument could be made about incompatible defaults change).
Another thing (I'll add to OP): I think we should have a more clear separation between defaults (= user can customize) and vars (= internal
use) and use defaults
for the former and vars
for the latter. We have some variables which I don't think anyone should modify, and
codifying that expectation would be IMO helpful.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale /lifecycle active
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/lifecycle frozen /remove-lifecycle stale
It should be possible to run kubespray without any variable defined in in inventory/group_vars
(all defaults are enough)
and with tags (e.g run only 'etcd'). I'm not sure if it's still tested in the CI, if not we should add back the test.
From what I remember kubespray-default was introduced to be able to do that. There are many variable that are across many roles (think bin_dir
).
Yes to generate doc from defaults.
What would you like to be added:
[ ] split up kubespray-defaults into defaults/main.yml in the role where the variable is used (when the variable is used by multiple role, have a separate_defaults role as a role dependency in every user, where is the most logical user / (dns_mode -> coredns for instance)
[ ] eliminate all instances of
default
filter in roles => var should have a default defined only once[ ] eliminates
docs/vars.md
and either use the default files directly as documentation (enforcing proper comment) or generates docs from them => the point being one single source of truth[ ] eliminate inventory samples covering all possible variables combination (see #10645 , this causes confusions for users) and replace them with minimal samples changing only what's needed. This also hides "missing default value in roles" bugs.
[ ] establish a clear distinction between
defaults
(=> user customisable) andvars
(=> internal use)Why is this needed:
kubespray-defaults
invocations(I've started #10626 which is part of that)
Opinions ? @floryut @yankay @MrFreezeex