Start ArangoDB on Amazon Elastic Kubernetes Service (EKS)

Requirements:

  1. $ aws --version
  2. aws-cli/1.16.43 Python/2.7.15rc1 Linux/4.15.0-36-generic botocore/1.12.33

Create a Kubernetes cluster

clusters

Wait for cluster to be ACTIVE

cluster-active

Continue with aws client

Configure AWS client

Refer to the AWS documentationto accordingly fill in the below with your credentials.Pay special attention to the correct region information to find your cluster next.

  1. $ aws configure
  2. AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
  3. AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
  4. Default region name [None]: us-west-2
  5. Default output format [None]: json

Verify that you can see your cluster listed, when authenticated

  1. $ aws eks list-clusters
  2. {
  3. "clusters": [
  4. "ArangoDB"
  5. ]
  6. }

You should be able to verify the ACTIVE state of your cluster

  1. $ aws eks describe-cluster --name ArangoDB --query cluster.status
  2. "ACTIVE"

Integrate kubernetes configuration locally

It’s time to integrate the cluster into your local kubernetes configurations

  1. $ aws eks update-kubeconfig --name ArangoDB
  2. Added new context arn:aws:eks:us-west-2:XXXXXXXXXXX:cluster/ArangoDB to ...

At this point, we are ready to use kubectl to communicate with the cluster.

  1. $ kubectl get service
  2. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  3. kubernetes ClusterIP 10.100.0.1 <none> 443/TCP 23h
  1. $ kubectl get nodes
  2. No resources found.

Create worker Stack

On Amazon EKS, we need to launch worker nodes, as the cluster has none.Open Amazon’s cloud formation consoleand choose Create Stack by specifying this S3 template URL:

  1. https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2018-08-30/amazon-eks-nodegroup.yaml

formation-template

Worker stack details

Pay good attention to details here. If your input is not complete, your workernodes are either not spawned or you won’t be able to integrate the workersinto your kubernetes cluster.

Stack name: Choose a name for your stack. For example ArangoDB-stack

ClusterName: Important!!! Use the same name as above, refer to aws eks list-clusters.

ClusterControlPlaneSecurityGroup: Choose the same SecurityGroups value as above, when you create your EKS Cluster.

NodeGroupName: Enter a name for your node group for example ArangoDB-node-group

NodeAutoScalingGroupMinSize: Minimum number of nodes to which you may scale your workers.

NodeAutoScalingGroupMaxSize: Nomen est omen.

NodeInstanceType: Choose an instance type for your worker nodes. For this test we went with the default t2.medium instances.

NodeImageId: Dependent on the region, there are two image Ids for boxes with and without GPU support.

Regionwithout GPUwith GPU
us-west-2ami-0a54c984b9f908c81ami-0440e4f6b9713faf6
us-east-1ami-0440e4f6b9713faf6ami-058bfb8c236caae89
eu-west-1ami-0c7a4976cb6fafd3aami-0706dc8a5eed2eed9

KeyName: SSH key pair, which may be used to ssh into the nodes. This is required input.

VpcId: The same VPCId, which you get using aws eks describe-cluster —name <your-cluster-name> —query cluster.resourcesVpcConfig.vpcId

Subnets: Choose the subnets that you created in Create your Amazon EKS Cluster VPC.

Review your stack and submit

create-review

Wait for stack to get ready

eks-stack

Note down NodeInstanceRole

Once stack is ready, navigate at the bottom to the Outputs pane and note down the NodeInstanceRoleeks-stack

Integrate worker stack as Kubernetes nodes

  • Download the configuration map here:
  1. $ curl -O https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2018-08-30/aws-auth-cm.yaml
  • Modify data|mapRoles|rolearn to match the NoteInstanceRole, you acquired after your node stack was finished

  • Deploy node integration

  1. $ kubectl apply -f aws-auth-cm.yaml

Wait for nodes to join the cluster and get ready

Monitor kubectl get nodes and watch your nodes to be ready

  1. $ kubectl get nodes
  2. NAME STATUS ROLES AGE VERSION
  3. ip-172-31-20-103.us-west-2.compute.internal Ready <none> 1d v1.10.3
  4. ip-172-31-38-160.us-west-2.compute.internal Ready <none> 1d v1.10.3
  5. ip-172-31-45-199.us-west-2.compute.internal Ready <none> 1d v1.10.3

Setup helm

  • Create service account for tiller
  1. $ kubectl create serviceaccount --namespace kube-system tiller
  2. serviceaccount/tiller created
  • Allow tiller to modify the cluster
  1. $ kubectl create clusterrolebinding tiller-cluster-rule \
  2. --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
  3. clusterrolebinding.rbac.authorization.k8s.io/tiller-cluster-rule created
  • Initialize helm
  1. $ helm init --service-account tiller
  2. $HELM_HOME has been configured at ~/.helm.
  3. ...
  4. Happy Helming!

Deploy ArangoDB cluster

  1. $ kubectl apply -f https://raw.githubusercontent.com/arangodb/kube-arangodb/master/examples/simple-cluster.yaml

Wait for cluster to become ready

Get LoadBalancer address from below command to access your coordinator.

  1. $ kubectl get svc

Secure ArangoDB cluster

Do not forget to immediately assign a secure database root password once on coordinator