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

toleration diff and nodeReadinessLabel merge with manifest matchExpressions #1729

Merged
merged 8 commits into from Jan 27, 2022

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented Dec 23, 2021

When adding tolerations to the manifest it will simply be ignored since the comparison between running and desired stateful set does not yield a mismatch. This PR will introduce a rolling update trigger for toleration changes just like with nodeAffinity. Only slice length is compared for now.

With nodeAffinity we spotted another problem: If somebody specified nodeAffinity in the manifest and has configured node_readiness_label the resulting affinity on the pods will have two matchExpressions section in the nodeSelectorTerms.

  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: manifestlabelkey
            ...
        - matchExpressions:
          - key: myreadinesslabelkey
            ...

Multiple matchExpressions are evaluated with OR condition. Thus, pods could be scheduled on nodes having either one of the specified expressions. This might be fine for some users. However, we want the readiness label to be evaluated always together with other specified affinities. Therefore, we will introduce another option to choose if the config affinity should get merged under one matchExpressions (AND) or stay in it's own (OR).

Finally, this PR also tries to re-enable the taint based eviction and node readiness label tests which use the features touched here.

@FxKu FxKu added this to the 1.8 milestone Dec 23, 2021
@FxKu FxKu added the zalando label Dec 23, 2021
make taint e2e test more robust

change merge behavior of nodeSelectorTerms for node readiness label
@FxKu FxKu changed the title include toleration in statefulset comparison toleration diff and nodeReadinessLabel merge with manifest matchExpressions Jan 6, 2022
Copy link
Member

@sdudoladov sdudoladov left a comment

Choose a reason for hiding this comment

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

could you add 2 examples (for OR and AND`) to the admin docs showcasing the different behavior ?

docs/reference/operator_parameters.md Outdated Show resolved Hide resolved
docs/reference/operator_parameters.md Outdated Show resolved Hide resolved
docs/user.md Outdated Show resolved Hide resolved
pkg/cluster/cluster.go Show resolved Hide resolved
pkg/cluster/k8sres.go Outdated Show resolved Hide resolved
@FxKu
Copy link
Member Author

FxKu commented Jan 27, 2022

👍

1 similar comment
@sdudoladov
Copy link
Member

👍

@FxKu FxKu merged commit a78a619 into master Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants