Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing affinity to ztunnel #50965

Merged
merged 3 commits into from May 13, 2024
Merged

Conversation

costinm
Copy link
Contributor

@costinm costinm commented May 9, 2024

Change-Id: Ie51df7029ce8798785f5e5d68fa31221de474abd

Please provide a description of this PR:

All other charts support affinity - this allows installing ztunnel on select nodes, CNI has a similar option.

I added 2 extra options - if controversial will remove, otherwise will add the same to cni chart.
This makes it easier to install on nodes with a specific label - I used 'ztunnel' as in the developer guide, but
probably should istio.io/mode or something similar. The end goal is to be able to designate a node as 'canary'
and have a new version of cni/ztunnel run only there. It doesn't fully work with helm - will need more work
to not re-create the service account and rbac.

Change-Id: Ie51df7029ce8798785f5e5d68fa31221de474abd
@costinm costinm requested a review from a team as a code owner May 9, 2024 19:04
@istio-policy-bot
Copy link

😊 Welcome @costinm! This is either your first contribution to the Istio istio repo, or it's been
a while since you've been here.

You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@istio-testing istio-testing added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 9, 2024
@bleggett
Copy link
Contributor

bleggett commented May 9, 2024

Not against doing this as we need to support blue/green node pool upgrades, but wouldn't we want to do this with taints+tolerations, rather than affinity?

Change-Id: If7b7232f11c833b69936dd81c015add621084d26
@istio-testing istio-testing added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 9, 2024
@costinm
Copy link
Contributor Author

costinm commented May 9, 2024 via email

Change-Id: Ic74fe84f68ffa504006de7e05dc40427bc192fff
@bleggett
Copy link
Contributor

bleggett commented May 9, 2024

We should have affinity just for consistency. Taints are for a different thing AFAIK - we can use the nodeSelector plus affinity.

Consistency with what? Both ztunnel and istio-cni are node-criticial daemonsets with unique scheduling requirements versus the rest of Istio, as a matter of current state.

I worry that affinity is more of a hint and not really a good pick for node-critical daemonsets - ztunnel is node critical, so every node must have one ztunnel pod, and no more.

If you have node set A and node set B, and you install ztunnel daemonset A and B, you don't merely want to prefer that B goes with B and A goes with A, you want explicit mutual exclusion.

IIRC you can do that with "hard" vs "soft" affinity, but "soft affinity" is basically an invalid form of affinity/footgun for ztunnel, and "hard" affinity is just equivalent to taint/tolerate - so why not just use taint/tolerate to preclude people from using affinity strategies that don't match what ztunnel/cni require?

We don't want scheduling hints we want scheduling requirements, that can be guaranteed to be mutually exclusive.

@costinm
Copy link
Contributor Author

costinm commented May 10, 2024 via email

@bleggett
Copy link
Contributor

I think taint is a good strategy for some cases. Not sure it works for everyone - we want pods to still be assigned to the node ( without having to tolerate that taint). Maybe it is possible - but I don't think that's a reason to reject having an option to use affinity with ztunnel.

I don't love using affinity for node-critical singletons but yeah - to your point we already have them on istio-cni (right or wrong) and we can iterate.

Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with caveats that having a template-able field != recommending usage of it :-)

@howardjohn howardjohn added the release-notes-none Indicates a PR that does not require release notes. label May 13, 2024
@howardjohn
Copy link
Member

/retest

@istio-testing istio-testing merged commit 85bcd21 into istio:master May 13, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes-none Indicates a PR that does not require release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants