|
| 1 | +--- |
| 2 | +weight: 20 |
| 3 | +--- |
| 4 | + |
| 5 | +# High Availability Deployment |
| 6 | + |
| 7 | +For production environments, it is recommended to deploy the Connectors system in a high availability (HA) configuration to ensure service continuity and fault tolerance. |
| 8 | + |
| 9 | +## Key Steps Overview |
| 10 | + |
| 11 | +Configuring a high-availability Connector involves three steps: |
| 12 | + |
| 13 | +1. **Set replicas ≥ 2** — Specify `spec.workloads[].replicas` on each Connectors Component. At minimum, configure ConnectorsCore (api, controller-manager, proxy) and any plugin components you use. |
| 14 | +2. **Rely on built-in anti-affinity** — The system automatically adds `preferredDuringSchedulingIgnoredDuringExecution` pod anti-affinity rules so replicas are spread across nodes with no extra configuration required. |
| 15 | +3. **Customize affinity for multi-zone clusters (optional)** — Override `spec.workloads[].template.spec.affinity` to enforce zone-level distribution using `requiredDuringSchedulingIgnoredDuringExecution` if needed. |
| 16 | + |
| 17 | +More details on each step are provided below. |
| 18 | + |
| 19 | +## Configuring Replicas |
| 20 | + |
| 21 | +You can increase the number of replicas for each workload to achieve high availability. This is done through the `workloads` field in the component spec. For production environments, we recommend configuring at least 2 replicas for each workload to ensure service continuity during node failures or rolling updates. |
| 22 | + |
| 23 | +Below are specific examples for each major connector component: |
| 24 | + |
| 25 | +### ConnectorsCore |
| 26 | + |
| 27 | +ConnectorsCore includes three main workloads: API server, controller manager, and proxy. For high availability, configure all three with multiple replicas: |
| 28 | + |
| 29 | +```yaml |
| 30 | +apiVersion: operator.connectors.alauda.io/v1alpha1 |
| 31 | +kind: ConnectorsCore |
| 32 | +metadata: |
| 33 | + name: connectors-core |
| 34 | + namespace: connectors-system |
| 35 | +spec: |
| 36 | + workloads: |
| 37 | + - name: connectors-api |
| 38 | + replicas: 2 |
| 39 | + - name: connectors-controller-manager |
| 40 | + replicas: 2 |
| 41 | + - name: connectors-proxy |
| 42 | + replicas: 2 |
| 43 | +``` |
| 44 | +
|
| 45 | +After a period of time, all pods of the connectors-core component have a replica count of 2, except for connectors-csi. |
| 46 | +
|
| 47 | +``` |
| 48 | +$ kubectl get pod -n connectors-system |
| 49 | +NAME READY STATUS RESTARTS AGE |
| 50 | +connectors-api-58fc8b45c4-9n8hc 1/1 Running 0 67s |
| 51 | +connectors-api-58fc8b45c4-12da7 1/1 Running 0 67s |
| 52 | +connectors-controller-manager-548659cdff-1d2dd 1/1 Running 0 35s |
| 53 | +connectors-controller-manager-548659cdff-s7gnn 1/1 Running 0 35s |
| 54 | +connectors-proxy-64bb994cd9-jbp2l 1/1 Running 0 61s |
| 55 | +connectors-proxy-64bb994cd9-dfade 1/1 Running 0 61s |
| 56 | +``` |
| 57 | + |
| 58 | +### ConnectorsGit |
| 59 | + |
| 60 | +ConnectorsGit runs a single plugin deployment for Git Server integration: |
| 61 | + |
| 62 | +```yaml |
| 63 | +apiVersion: operator.connectors.alauda.io/v1alpha1 |
| 64 | +kind: ConnectorsGit |
| 65 | +metadata: |
| 66 | + name: connectors-git |
| 67 | + namespace: connectors-system |
| 68 | +spec: |
| 69 | + workloads: |
| 70 | + - name: connectors-git-plugin |
| 71 | + replicas: 2 |
| 72 | +``` |
| 73 | +
|
| 74 | +After a period of time, all pods of the connectors-git component have a replica count of 2. |
| 75 | +
|
| 76 | +``` |
| 77 | +$ kubectl get pod -n connectors-system |
| 78 | +NAME READY STATUS RESTARTS AGE |
| 79 | +connectors-git-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 80 | +connectors-git-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 81 | +``` |
| 82 | + |
| 83 | +### ConnectorsOCI |
| 84 | + |
| 85 | +ConnectorsOCI runs a single plugin deployment that handles OCI registry integration: |
| 86 | + |
| 87 | +```yaml |
| 88 | +apiVersion: operator.connectors.alauda.io/v1alpha1 |
| 89 | +kind: ConnectorsOCI |
| 90 | +metadata: |
| 91 | + name: connectors-oci |
| 92 | + namespace: connectors-system |
| 93 | +spec: |
| 94 | + workloads: |
| 95 | + - name: connectors-oci-plugin |
| 96 | + replicas: 2 |
| 97 | +``` |
| 98 | +
|
| 99 | +After a period of time, all pods of the connectors-oci component have a replica count of 2. |
| 100 | +
|
| 101 | +``` |
| 102 | +$ kubectl get pod -n connectors-system |
| 103 | +NAME READY STATUS RESTARTS AGE |
| 104 | +connectors-oci-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 105 | +connectors-oci-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 106 | +``` |
| 107 | + |
| 108 | +### ConnectorsMaven |
| 109 | + |
| 110 | +ConnectorsMaven runs a single plugin deployment for Maven registry integration: |
| 111 | + |
| 112 | +```yaml |
| 113 | +apiVersion: operator.connectors.alauda.io/v1alpha1 |
| 114 | +kind: ConnectorsMaven |
| 115 | +metadata: |
| 116 | + name: connectors-maven |
| 117 | + namespace: connectors-system |
| 118 | +spec: |
| 119 | + workloads: |
| 120 | + - name: connectors-maven-plugin |
| 121 | + replicas: 2 |
| 122 | +``` |
| 123 | +
|
| 124 | +After a period of time, all pods of the connectors-maven component have a replica count of 2. |
| 125 | +
|
| 126 | +``` |
| 127 | +$ kubectl get pod -n connectors-system |
| 128 | +NAME READY STATUS RESTARTS AGE |
| 129 | +connectors-maven-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 130 | +connectors-maven-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 131 | +``` |
| 132 | + |
| 133 | +### ConnectorsHarbor |
| 134 | + |
| 135 | +ConnectorsHarbor runs a single plugin deployment for Harbor-specific features: |
| 136 | + |
| 137 | +```yaml |
| 138 | +apiVersion: operator.connectors.alauda.io/v1alpha1 |
| 139 | +kind: ConnectorsHarbor |
| 140 | +metadata: |
| 141 | + name: connectors-harbor |
| 142 | + namespace: connectors-system |
| 143 | +spec: |
| 144 | + workloads: |
| 145 | + - name: connectors-harbor-plugin |
| 146 | + replicas: 2 |
| 147 | +``` |
| 148 | +
|
| 149 | +After a period of time, all pods of the connectors-harbor component have a replica count of 2. |
| 150 | +
|
| 151 | +``` |
| 152 | +$ kubectl get pod -n connectors-system |
| 153 | +NAME READY STATUS RESTARTS AGE |
| 154 | +connectors-harbor-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 155 | +connectors-harbor-plugin-84985b9d7d-vllp6 1/1 Running 0 67s |
| 156 | +``` |
| 157 | + |
| 158 | +### Components Without Workloads |
| 159 | + |
| 160 | +The other connector components do not have Deployment workloads and therefore do not require replica configuration. |
| 161 | + |
| 162 | +## Built-in Pod Anti-Affinity |
| 163 | + |
| 164 | +The system includes built-in pod anti-affinity rules to ensure that replicas are distributed across different nodes. By default, the system uses `preferredDuringSchedulingIgnoredDuringExecution` with a weight of `100`, which means the scheduler will try to place pods on different nodes when possible, but will still schedule them on the same node if no other options are available. |
| 165 | + |
| 166 | +This default configuration ensures: |
| 167 | +- Pods are spread across different nodes when possible |
| 168 | +- Deployment remains schedulable even if the cluster has limited nodes |
| 169 | +- Automatic failover capability when a node becomes unavailable |
| 170 | + |
| 171 | +## Customizing Affinity Rules |
| 172 | + |
| 173 | +If the default affinity rules do not meet your requirements, you can override them through the `workloads` configuration. The `template.spec.affinity` field allows you to specify custom affinity rules. |
| 174 | + |
| 175 | +For multi-zone clusters, you can configure zone-aware scheduling to spread pods across availability zones. The following example uses `requiredDuringSchedulingIgnoredDuringExecution` to enforce zone-level distribution, combined with `preferredDuringSchedulingIgnoredDuringExecution` to prefer node-level distribution within each zone: |
| 176 | + |
| 177 | +```yaml |
| 178 | +apiVersion: operator.connectors.alauda.io/v1alpha1 |
| 179 | +kind: ConnectorsCore |
| 180 | +metadata: |
| 181 | + name: connectors-core |
| 182 | + namespace: connectors-system |
| 183 | +spec: |
| 184 | + workloads: |
| 185 | + - name: connectors-api |
| 186 | + replicas: 3 |
| 187 | + template: |
| 188 | + spec: |
| 189 | + affinity: |
| 190 | + podAntiAffinity: |
| 191 | + # Hard requirement: pods must be distributed across different zones |
| 192 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 193 | + - labelSelector: |
| 194 | + matchLabels: |
| 195 | + control-plane: api |
| 196 | + app.kubernetes.io/name: connectors |
| 197 | + topologyKey: topology.kubernetes.io/zone |
| 198 | + # Soft requirement: prefer distributing pods across different nodes within the same zone |
| 199 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 200 | + - weight: 100 |
| 201 | + podAffinityTerm: |
| 202 | + labelSelector: |
| 203 | + matchLabels: |
| 204 | + control-plane: api |
| 205 | + app.kubernetes.io/name: connectors |
| 206 | + topologyKey: kubernetes.io/hostname |
| 207 | +``` |
| 208 | +
|
| 209 | +This configuration ensures: |
| 210 | +- Pods are strictly distributed across different availability zones (hard requirement) |
| 211 | +- Within the same zone, pods are preferably scheduled on different nodes (soft requirement) |
| 212 | +- Provides resilience against both zone-level and node-level failures |
0 commit comments