Get started (free)

Pod placement

You can configure Pod placement for OPA Pods as described in Pod placement.

Defaults

The default affinity depends on the workload kind:

  • DaemonSet: none. A DaemonSet already places exactly one Pod per node.

  • Deployment: distribute all Pods of the servers role across nodes, so that multiple replicas don’t end up on the same Kubernetes node (weight 70)

The default affinity for a Deployment is:

affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - podAffinityTerm:
        labelSelector:
          matchLabels:
            app.kubernetes.io/component: server
            app.kubernetes.io/instance: cluster-name
            app.kubernetes.io/name: opa
        topologyKey: kubernetes.io/hostname
      weight: 70
The default affinity is only preferred and not enforced, because not every setup has multiple Kubernetes nodes. To enforce it, set your own requiredDuringSchedulingIgnoredDuringExecution affinity. Be aware that a Deployment with more replicas than nodes then leaves Pods unschedulable.