High Availability
By default, the SKE Operator runs one pod of Kratix and one pod of the SKE Platform Manager. When the node running a pod is drained or fails, nothing serves the platform until a new pod starts. Running more than one replica, spread across nodes, keeps SKE available while this happens.
What extra replicas give you
Kratix and the SKE Platform Manager use Kubernetes leader election:
- Only one pod is active at a time.
- If the leader pod stops, another pod takes over after about 15 to 20 seconds. Reconciliation pauses during that time.
- Every pod serves webhooks, including the pods that are not the leader.
Only the leader reconciles, so adding replicas does not make Kratix or the SKE Platform Manager reconcile faster.
Set the number of replicas
Set replicas on the Kratix resource.
deploymentConfig configures Kratix and platformManagerDeploymentConfig configures the SKE
Platform Manager:
apiVersion: platform.syntasso.io/v1alpha1
kind: Kratix
metadata:
name: kratix
spec:
version: vX.Y.Z
deploymentConfig:
replicas: 2
platformManagerDeploymentConfig:
replicas: 2
If you install with Helm, set the same fields under skeDeployment, see Replicas and pod
spreading.
- When
replicasis not set, one pod runs. replicasmust be at least 1. The Kratix resource is rejected otherwise.- The Kratix resource is ready only when every Kratix pod is available.
- The SKE Operator owns these Deployments. If you change their replica count with
kubectl scaleor a HorizontalPodAutoscaler, the operator sets it back on its next reconcile. Setreplicason the Kratix resource instead.
Spread the pods across nodes
Use topologySpreadConstraints to spread pods across different nodes. For example:
apiVersion: platform.syntasso.io/v1alpha1
kind: Kratix
metadata:
name: kratix
spec:
version: vX.Y.Z
deploymentConfig:
replicas: 2
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
nodeTaintsPolicy: Honor
matchLabelKeys:
- pod-template-hash
labelSelector:
matchLabels:
app.kubernetes.io/component: kratix-manager
See Pod topology spread constraints for documentation of every available field.
Keep pods running during node maintenance
The SKE Operator does not create a PodDisruptionBudget. You can create one yourself. The example below keeps at least one Kratix pod running:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: kratix-manager
namespace: kratix-platform-system
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/component: kratix-manager
# use app.kubernetes.io/component: ske-platform for the SKE Platform Manager
If minAvailable is equal to replicas, no pod can be evicted and kubectl drain never finishes.
Keep minAvailable lower than replicas, and update the budget when you change replicas.
