diff --git a/config/ha/kustomization.yaml b/config/ha/kustomization.yaml new file mode 100644 index 000000000..60dc69b9f --- /dev/null +++ b/config/ha/kustomization.yaml @@ -0,0 +1,17 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: kubeslice-system + +resources: + - ../default + - operator_pdb.yaml + +patches: + - path: manager_ha_patch.yaml + target: + group: apps + version: v1 + kind: Deployment + name: operator + diff --git a/config/ha/manager_ha_patch.yaml b/config/ha/manager_ha_patch.yaml new file mode 100644 index 000000000..5ca73f4ee --- /dev/null +++ b/config/ha/manager_ha_patch.yaml @@ -0,0 +1,18 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: operator + namespace: system +spec: + replicas: 2 + template: + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + topologyKey: kubernetes.io/hostname + labelSelector: + matchLabels: + control-plane: controller-manager diff --git a/config/ha/operator_pdb.yaml b/config/ha/operator_pdb.yaml new file mode 100644 index 000000000..93e43bef0 --- /dev/null +++ b/config/ha/operator_pdb.yaml @@ -0,0 +1,10 @@ +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: kubeslice-operator-pdb + namespace: system +spec: + minAvailable: 1 + selector: + matchLabels: + control-plane: controller-manager