Affinity

Description

Affinity is an interface for specifying custom affinity settings. This field is a literal Affinity object from the Kubernetes library, so it is fully featured and applies directly to the pods. When no Affinity is specified, the defaults shown in the example below are used.

Example

apiVersion: datapower.ibm.com/v1beta3
kind: DataPowerService
metadata:
  name: example-dpservice
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
          - matchExpressions:
            - key: "beta.kubernetes.io/arch"
              operator: In
              values: ["amd64"]
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        podAffinityTerm:
          topologyKey: "kubernetes.io/hostname"
          labelSelector:
            matchLabels:
              app: datapower
              release: example-dpservice