From 6040059b1405299596dfec8d84e09bbba927aea7 Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Thu, 7 Jun 2018 09:17:46 +0200 Subject: [PATCH] Improved Service documentation --- .../Kubernetes/ServicesAndLoadBalancer.md | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md b/docs/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md index d82585421..da8a8bdad 100644 --- a/docs/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md +++ b/docs/Manual/Deployment/Kubernetes/ServicesAndLoadBalancer.md @@ -39,18 +39,18 @@ If you want to create external access services manually, follow the instructions ### Single server For a single server deployment, the operator creates a single -`Service` named ``. This service has a normal cluster IP +`Service` named ``. This service has a normal cluster IP address. ### Full cluster For a full cluster deployment, the operator creates two `Services`. -- `_servers` a headless `Service` intended to provide +- `-int` a headless `Service` intended to provide DNS names for all pods created by the operator. It selects all ArangoDB & ArangoSync servers in the cluster. -- `` a normal `Service` that selects only the coordinators +- `` a normal `Service` that selects only the coordinators of the cluster. This `Service` is configured with `ClientIP` session affinity. This is needed for cursor requests, since they are bound to a specific coordinator. @@ -58,7 +58,7 @@ For a full cluster deployment, the operator creates two `Services`. When the coordinators are asked to provide endpoints of the cluster (e.g. when calling `client.SynchronizeEndpoints()` in the go driver) the DNS names of the individual `Pods` will be returned -(`._servers..svc`) +(`.-int..svc`) ### Full cluster with DC2DC @@ -66,23 +66,26 @@ For a full cluster with datacenter replication deployment, the same `Services` are created as for a Full cluster, with the following additions: -- `_sync` a normal `Service` that selects only the syncmasters +- `-sync` a normal `Service` that selects only the syncmasters of the cluster. ## Load balancer -To reach the ArangoDB servers from outside the Kubernetes cluster, you -have to deploy additional services. +If you want full control of the `Services` needed to access the ArangoDB deployment +from outside your Kubernetes cluster, set `spec.externalAccess.Type` of the `ArangoDeployment` to `None` +and create a `Service` as specified below. -You can use `LoadBalancer` or `NodePort` services, depending on your +Create a `Service` of type `LoadBalancer` or `NodePort`, depending on your Kubernetes deployment. This service should select: -- `arangodb_cluster_name: ` +- `arango_deployment: ` - `role: coordinator` -For example: +The following example yields a service of type `LoadBalancer` with a specific +load balancer IP address. +With this service, the ArangoDB cluster can now be reached on `https://1.2.3.4:8529`. ```yaml kind: Service @@ -91,7 +94,27 @@ metadata: name: arangodb-cluster-exposed spec: selector: - arangodb_cluster_name: arangodb-cluster + arango_deployment: arangodb-cluster + role: coordinator + type: LoadBalancer + loadBalancerIP: 1.2.3.4 + ports: + - protocol: TCP + port: 8529 + targetPort: 8529 +``` + +The following example yields a service of type `NodePort` with the ArangoDB +cluster exposed on port 30529 of all nodes of the Kubernetes cluster. + +```yaml +kind: Service +apiVersion: v1 +metadata: + name: arangodb-cluster-exposed +spec: + selector: + arango_deployment: arangodb-cluster role: coordinator type: NodePort ports: