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 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.
|
||||
To ensure this, the agent Pods are configured with pod-anti-affinity.
|
||||
It is essential for resilience and high availability that no two agents
|
||||
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
|
||||
kind: Pod
|
||||
|
@ -29,38 +32,28 @@ spec:
|
|||
- key: role
|
||||
operator: In
|
||||
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.
|
||||
To ensure this, the dbserver Pods are configured with pod-anti-affinity.
|
||||
For a `development` environment we use `preferredDuringSchedulingIgnoredDuringExecution`
|
||||
so deployments are still possible on tiny clusters like `minikube`.
|
||||
|
||||
```yaml
|
||||
kind: Pod
|
||||
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
|
||||
```
|
||||
For `production` environments we enforce (anti-)affinity using
|
||||
`requiredDuringSchedulingIgnoredDuringExecution`.
|
||||
|
||||
Q: Do we want to allow multiple dbservers on a single node?
|
||||
If so, we should use `preferredDuringSchedulingIgnoredDuringExecution`
|
||||
antiy-affinity.
|
||||
## Run coordinators on separate machines
|
||||
|
||||
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