mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
Improving constraints
This commit is contained in:
parent
df6fd67e56
commit
76b447a7f4
1 changed files with 26 additions and 33 deletions
|
@ -3,10 +3,13 @@
|
||||||
The ArangoDB operator tries to honor various constraints to support high availability of
|
The ArangoDB operator tries to honor various constraints to support high availability of
|
||||||
the ArangoDB cluster.
|
the ArangoDB cluster.
|
||||||
|
|
||||||
## Run agents on separate machines
|
## Run agents and dbservers on separate machines
|
||||||
|
|
||||||
It is essential for HA that agents are running on separate nodes.
|
It is essential for resilience and high availability that no two agents
|
||||||
To ensure this, the agent Pods are configured with pod-anti-affinity.
|
are running on the same node and no two dbservers are running running
|
||||||
|
on the same node.
|
||||||
|
|
||||||
|
To ensure this, the agent and dbserver Pods are configured with pod-anti-affinity.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
kind: Pod
|
kind: Pod
|
||||||
|
@ -29,38 +32,28 @@ spec:
|
||||||
- key: role
|
- key: role
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- agent
|
- agent (or dbserver)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run dbservers on separate machines
|
The settings used for pod affinity are based on the `spec.environment` setting.
|
||||||
|
|
||||||
It is needed for HA that dbservers are running on separate nodes.
|
For a `development` environment we use `preferredDuringSchedulingIgnoredDuringExecution`
|
||||||
To ensure this, the dbserver Pods are configured with pod-anti-affinity.
|
so deployments are still possible on tiny clusters like `minikube`.
|
||||||
|
|
||||||
```yaml
|
For `production` environments we enforce (anti-)affinity using
|
||||||
kind: Pod
|
`requiredDuringSchedulingIgnoredDuringExecution`.
|
||||||
spec:
|
|
||||||
affinity:
|
|
||||||
podAntiAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
- weight: 100
|
|
||||||
podAffinityTerm:
|
|
||||||
labelSelector:
|
|
||||||
matchExpressions:
|
|
||||||
- key: app
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- arangodb
|
|
||||||
- key: arangodb_cluster_name
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- <cluster-name>
|
|
||||||
- key: role
|
|
||||||
operator: In
|
|
||||||
values:
|
|
||||||
- dbserver
|
|
||||||
```
|
|
||||||
|
|
||||||
Q: Do we want to allow multiple dbservers on a single node?
|
## Run coordinators on separate machines
|
||||||
If so, we should use `preferredDuringSchedulingIgnoredDuringExecution`
|
|
||||||
antiy-affinity.
|
It is preferred to run coordinators of separate machines.
|
||||||
|
|
||||||
|
To achieve this, the coordinator Pods are configured with pod-anti-affinity
|
||||||
|
using the `preferredDuringSchedulingIgnoredDuringExecution` setting.
|
||||||
|
|
||||||
|
## Run syncworkers on same machine as dbserver
|
||||||
|
|
||||||
|
It is preferred to run syncworkers on the same machine as
|
||||||
|
dbservers.
|
||||||
|
|
||||||
|
To achieve this, the syncworker Pods are configured with pod-affinity
|
||||||
|
using the `preferredDuringSchedulingIgnoredDuringExecution` setting.
|
||||||
|
|
Loading…
Reference in a new issue