Skip to main content

Pod Scheduling


Pod scheduling is the general subject in Kubernetes encompassing Taints, Tolerations and Affinities. In Tangram Pro™ we have configured some default Taints and Tolerations that tend to best work with our Cloud Deployments and want to list them here for consideration by anyone deploying the platform.

note

Tangram Pro™ utilizes Helm subcharts for some services and functionality.

Taints and Tolerations

We have a helper template to add tolerations to every Tangram Pro™ pod, excluding subchart pods. These are configured using the base keys of:

# In the common Pod Specification, added to every Tangram Pro™ Pod
tolerations: []
# tolerations:
# - key: "key1"
#   operator: "Equal"
#   value: "value1"
#   effect: "NoSchedule"

There are tolerations you can configure for the pods created by the Tangram Pro™ backend.

backend:
  workflows:
    nodeAffinity:
      nodeSelectorKey: "" # tangramflex.tech/node-role
      nodeSelectorValues: "" # workflows

    toleration:
      nodeTaintKey: "" # tangramflex.tech/workflows

There are also tolerations you can configure for the pods created by the Tangram Pro™ integration controller.

controller:
  manager:
    podCreation:
      # tolerations to be applied to all pods created by this integration controller:
      tolerations:
        - key: tangramflex.tech/integrations
          operator: Equal
          value: "true"
          effect: NoExecute

Affinities

Affinities are rules to help the Kubernetes pod scheduler schedule pods to run in a way you desire that is more nuanced and customized to achieve a more desired topology for running your pods.

Node Affinity allows us to inform the scheduler how we want it to schedule pods to nodes based on rules and criteria relative to the node's labels.

Pod Affinity allows us to inform the scheduler how we want it to schedule pods to nodes based on rules and criteria relative to the node's pods already running.

We have a helper template to add affinities to every Tangram Pro™ pod (excluding subchart pods). These are configured using the root keys of:

# In the common Pod Specification, added to every Tangram Pro™ Pod
affinity: {}
# affinity:
#   nodeAffinity:
#     requiredDuringSchedulingIgnoredDuringExecution:
#       nodeSelectorTerms:
#       - matchExpressions:
#         - key: topology.kubernetes.io/zone
#           operator: In
#           values:
#           - antarctica-east1
#           - antarctica-west1
#   podAntiAffinity: |
#     preferredDuringSchedulingIgnoredDuringExecution:
#       - podAffinityTerm:
#           labelSelector:
#             matchLabels: {{- include "service.selectorLabels" . | nindent 10 }}
#           topologyKey: topology.kubernetes.io/zone
#         weight: 100
#     requiredDuringSchedulingIgnoredDuringExecution:
#       - labelSelector:
#           matchLabels: {{- include "service.selectorLabels" . | nindent 10 }}
#         topologyKey: kubernetes.io/hostname

# In the common Pod Specification, added to every Tangram Pro™ Pod
topologySpreadConstraints:
  - maxSkew: 1
    topologyKey: topology.kubernetes.io/zone
    whenUnsatisfiable: ScheduleAnyway

Node Affinities

There are affinities you can configure for the pods created by the Tangram Pro™ integration controller

# In the common Pod Specification, added to every Tangram Pro™ Pod
affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: topology.kubernetes.io/zone
          operator: In
          values:
          - antarctica-east1 # <-- Your values here.
          - antarctica-west1 # <-- Your values here.

backend:
  workflows:
    nodeAffinity:
      nodeSelectorKey: "" # tangramflex.tech/node-role
      nodeSelectorValues: "" # workflows

controller:
  manager:
    podCreation:
      # affinity configuration to be applied to all pods created by this integration controller:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/os
                    operator: In
                    values:
                      - linux

Pod Affinities

# In the common Pod Specification, added to every Tangram Pro™ Pod
affinity:
  podAntiAffinity: |
    preferredDuringSchedulingIgnoredDuringExecution:
      - podAffinityTerm:
          labelSelector:
            matchLabels: {{- include "service.selectorLabels" . | nindent 10 }}
          topologyKey: topology.kubernetes.io/zone
        weight: 100
    requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchLabels: {{- include "service.selectorLabels" . | nindent 10 }}
        topologyKey: kubernetes.io/hostname

argo-workflows:
  controller:
    affinity:
      podAntiAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 100
            podAffinityTerm:
              labelSelector:
                matchExpressions:
                  - key: app.kubernetes.io/name
                    operator: In
                    values:
                      - argo-workflows-workflows
              topologyKey: topology.kubernetes.io/zone