From 76b447a7f4b9651463e98d739ffb4e5976352db5 Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Thu, 8 Feb 2018 11:20:00 +0100 Subject: [PATCH] Improving constraints --- docs/constraints.md | 59 ++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/docs/constraints.md b/docs/constraints.md index 1cc78d822..1ca3aae25 100644 --- a/docs/constraints.md +++ b/docs/constraints.md @@ -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: - - - - 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.