admiraltyio / admiralty

A system of Kubernetes controllers that intelligently schedules workloads across clusters.
https://admiralty.io
Apache License 2.0
674 stars 87 forks source link

Cluster level scheduling constaints not making it to delegate pod #127

Closed Mhectoratt closed 2 years ago

Mhectoratt commented 2 years ago

When using the multicluster.admiralty.io/use-constraints-from-spec-for-proxy-pod-scheduling pod level annotation, the proxy pod correctly gets the cluster level scheduling constraints from the original deployment. However, it makes it no further since they are stripped out in the model/delegatepod/model.go class in the following lines:

     if _, ok := srcPod.Annotations[common.AnnotationKeyUseConstraintsFromSpecForProxyPodScheduling]; ok {
              delegatePod.Spec.NodeSelector = nil
              delegatePod.Spec.Tolerations = nil
              delegatePod.Spec.Affinity = nil
              delegatePod.Spec.TopologySpreadConstraints = nil
      }

Removing these lines allowed the cluster level scheduling constraints to flow to the delegate pod.

adrienjt commented 2 years ago

This is by design. Proxy and candidate pod scheduling constraints are defined separately:

Are you able to define your use case within this framework?

Mhectoratt commented 2 years ago

Thank you! I did not understand how to use multicluster.admiralty.io/proxy-pod-scheduling-constraints. It works as you have explained.