Repository navigation
Operations: Please allow setting nodeSelector, tolerations, and affinity on all Pods #5
Description
Activity
This is what is implemented in other operator:
NodeSelector: https://github.com/helm/charts/blob/master/stable/prometheus-operator/crds/crd-prometheus.yaml#L3223
Affinity: https://github.com/helm/charts/blob/master/stable/prometheus-operator/crds/crd-prometheus.yaml#L119
Tolerations: https://github.com/helm/charts/blob/master/stable/prometheus-operator/crds/crd-prometheus.yaml#L4523
The difference for knative operator could be that they should be defined within an array section for CRD, since we have got multiple deployments in knative.
Reacted by Adam GrayWe found PodNodeSelector and PodTolerationRestriction admission controllers.
https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#podnodeselector
https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#podtolerationrestriction
kubernetes/kubernetes#57424But most hosted K8s control plane providers do not support them because their annotations are alpha.
https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.htmlWe also found this open-source project that allows for setting node selector in namespace annotations using a webhook.
https://github.com/liangrog/admission-webhook-serverWe will likely try to contribute the other tolerations, and affinity back to this project assuming the maintainer is open to it.
- added a commit that references this issue
on Jun 15, 2020 This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with/reopen. Mark the issue as
fresh by adding the comment/remove-lifecycle stale.- addedlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.
on Sep 17, 2020 /remove-lifecycle stale
- removedlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.
on Sep 17, 2020 Is it possible to follow a pattern like in serving for setting node selectors on the serving pods such as activator, autoscale, controller, etc...
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with/reopen. Mark the issue as
fresh by adding the comment/remove-lifecycle stale.- addedlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.
on Dec 21, 2020 Bump
- removedlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.
on Jan 23, 2021 @AceHack you mean setting tolerations and node selectors for the knative serving components (autoscaler, activator etc.) via the KnativeServing CRD from the Operator, correct?
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with/reopen. Mark the issue as
fresh by adding the comment/remove-lifecycle stale.5 remaining items
- removedlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.
on May 28, 2021 I think we should start with a global config like current
spec.high-availability.
I am thinking that we can createspec.globalthen add some configurations under it like:apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: global: nodeSelector: environment: devUsers might want to customize for a specific deployment but we should start with this global one.
If no objections or other opinions, I will start creating the pull request.@nak3 shouldn't this be part of the existing
deploymentssection maybe?@markusthoemmes Ah yes,
deploymentssection would be good.
So it will be needed to configure each deployment like:apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving spec: deployments: - name: webhook nodeSelector: environment: dev - name: controller nodeSelector: environment: devI guess we could add a
globalorallconvenience section todeployments, which'd still allow to set them to all at once.Umm... The
deploymentsis a[]arraytype so I think we cannot add theglobalorallsection there?
operator/pkg/apis/operator/v1alpha1/common.go
Line 134 in 1bbdd90
DeploymentOverride []DeploymentOverride `json:"deployments,omitempty"`
operator/pkg/apis/operator/v1alpha1/common.go
Line 220 in 1bbdd90
type DeploymentOverride struct { - added a commit that references this issue
on Jun 12, 2021 Hello @nak3 @evankanderson guys,
Do you have any ETA to allow us put tolerations in the Knative operator?
For us it's blocking because we have the same issue of @AceHack
Thanks
- added a commit that references this issue
on Sep 1, 2021 All three
nodeSelector,tolerationsandaffinityare now implemented. (tolerationsandaffinitywill be available after 0.26+).This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with/reopen. Mark the issue as
fresh by adding the comment/remove-lifecycle stale.- addedlifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.Denotes an issue or PR has remained open with no activity and has become stale.
on Dec 16, 2021 - added a commit that references this issue
on Jan 5, 2023
Most companies with complex enough kubernetes deployments that have multiple different node groups require some sort of topology selection so pods will run on the correct group of nodes. Please allow setting nodeSelector, tolerations, and affinity on all Pods to accomplish this. This includes adding it to any CRDs that create pods so these values are settable.
https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
See below for example:
Related Feature Request: knative/eventing#2883