Integrating ArangoDB with Kubernetes for Seamless Deployment

Estimated reading time: 6 minutes

Are you a database architect or DevOps architect tasked with deploying modern databases like ArangoDB on Kubernetes? Kubernetes, with its robust orchestration capabilities, provides a solid foundation for managing containerized workloads, ensuring reliability and adaptability for database deployments.

In this post, we’ll guide you through the process of deploying ArangoDB on Kubernetes, addressing common DevOps challenges like scalability, high availability, and efficient resource utilization. By the end, you'll have a practical understanding of integrating ArangoDB with Kubernetes in a way that’s both robust and future-proof.

Why ArangoDB and Kubernetes?

ArangoDB, as a multi-model database, excels at handling diverse workloads—be it document, graph, or key-value data. When paired with Kubernetes, you gain:

  • Scalability: Automatically adjust resources to meet demand.
  • Resilience: Ensure high availability through self-healing capabilities.
  • Simplicity: Streamline deployment and updates with Infrastructure as Code (IaC).
  • Automation: Minimize manual intervention with Kubernetes' built-in orchestration.

Prerequisites

Before diving into deployment, ensure you have the following ready:

  1. A Kubernetes Cluster: Local (e.g., Minikube) or cloud-based (e.g., AWS EKS, GKE).
  2. kubectl: Installed and configured to interact with your cluster.
  3. Helm: Installed for managing Kubernetes charts.

Step 1: Installing the ArangoDB Kubernetes Operator

The ArangoDB Kubernetes Operator simplifies the deployment and management of ArangoDB clusters. It automates tasks like scaling, failover, and configuration management.

Add the Helm Repository

Start by adding the ArangoDB Helm repository:

bash

helm repo add arangodb https://arangodb.github.io/kube-arangodb
helm repo update

Deploy the Operator

Install the ArangoDB operator in a dedicated namespace:

bash

helm install arango-operator arangodb/kube-arangodb --namespace arangodb --create-namespace

This deploys the operator, which manages the lifecycle of your ArangoDB cluster.

Step 2: Configuring and Deploying an ArangoDB Cluster

Create the Cluster Configuration

Write a configuration file ( e.g., arangodb-cluster.yaml ) to define your cluster. This configuration outlines the desired topology, resource allocation, and environment settings.

Yaml

apiVersion: database.arangodb.com/v1
kind: ArangoDeployment
metadata:
  name: arango-cluster
  namespace: arangodb
spec:
  mode: Cluster
  environment: Production
  image:
    repository: arangodb/arangodb
    tag: latest
  tls:
    mode: None
  authentication:
    jwtSecretName: arango-cluster-jwt
  agents:
    count: 3
    resources:
      requests:
        memory: 1Gi
        cpu: 500m
  dbservers:
    count: 3
    resources:
      requests:
        memory: 2Gi
        cpu: 500m
  coordinators:
    count: 2
    resources:
      requests:
        memory: 1Gi
        cpu: 500m

Apply the Configuration

Deploy your cluster by applying the YAML file:

bash

kubectl apply -f arangodb-cluster.yaml

Verify the deployment status:

bash

kubectl get pods -n arangodb

Step 3: Addressing DevOps Concerns

Scalability

Kubernetes' horizontal scaling ensures that your ArangoDB cluster can handle fluctuating workloads:

bash

kubectl scale deployment arango-cluster-dbserver --replicas=5 -n arangodb

High Availability

With ArangoDB's fault-tolerant architecture and Kubernetes' self-healing, you minimize downtime. For example, Kubernetes automatically restarts failed pods:

bash

kubectl describe pod <pod-name> -n arangodb

Backup and Recovery

Set up a backup strategy using Kubernetes CronJobs:

yaml

apiVersion: batch/v1
kind: CronJob
metadata:
  name: arango-backup
  namespace: arangodb
spec:
  schedule: "0 2 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: arango-backup
            image: arangodb/arangodb
            command: ["arangodump"]
            args:
              - "--output-directory=/backups"
              - "--server.database=mydb"
          restartPolicy: OnFailure

Step 4: Monitoring and Maintenance

Use Kubernetes-native tools like Prometheus and Grafana to monitor your ArangoDB deployment. Enable metrics collection by annotating your pods:

yaml

metadata:
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "8529"

Summary

Integrating ArangoDB with Kubernetes offers an elegant solution for managing complex database workloads. By leveraging Kubernetes' orchestration capabilities, you can ensure your database is scalable, resilient, and easy to manage. Whether you're a seasoned DevOps professional or new to container orchestration, this setup will provide a reliable foundation for your ArangoDB deployment.

Happy deploying!

More info...

Document Update with arangoimp: ArangoDB Data Management

Inspired by the feature request in Github issue #1298, we added update and replace support for ArangoDB’s import facilities.

This extends ArangoDB’s HTTP REST API for importing documents plus the arangoimp binary so they can not only insert new documents but also update existing ones.

Inserts and updates can also be mixed in a single import run. What exactly will happen is configurable by setting arangoimp’s new command-line option --on-duplicate.

By default, error will be reported if a document already exists. This behavior can be changed by setting --on-duplicate to a value of update, replace or ignore. Here is an example result of an import with duplicated keys:

> arangoimp --file data.json --collection users --on-duplicate update

created:          1
warnings/errors:  0
updated/replaced: 2
ignored:          0

So, if you want to aggregate data from several data files, you can try the new import command-line option --on-duplicate.

In a blog post, Jan provides a few usage examples.

More info...

ArangoDB Cookbook: Recipes for Database Optimization

It’s new – and just for you! With the new ArangoDB Cookbook we want to guide you thru various challenges that might arise in your daily business with NoSQL – and ArangoDB in particular.

You have a problem with or need an introduction to NoSQL data modeling / scaling ArangoDB / building Foxx apps / graph processing or something related to your favorite programming language? Then have a look if there’s a recipe match in the Cookbook!

Create your own recipes and help others in the ArangoDB community. We appreciate every participation that makes the cookbook a valuable source for ArangoDB users. Just write your problem description and solution in plain markdown and start a pull request on Github.

Need an example?

Lets assume you checked the foxx introduction on our website and now you want to build your own Foxx app, but you don’t know how to start.

(more…)

More info...

Documentation Review & Roadmap: ArangoDB Updates

We want to present you our growing documentation. A few weeks ago we published the new documentation with a completely new look and a far better structure than before.

Since than we fixed some small issues and rewrote some of the sections. In addition you can fold the code examples for a better overview. Now these code examples will be generated before the release of a new documentation. Because of that the code will be accurate. Now you have the possibility to download .epub or .mobi for your ebook-reader. This way you can explore ArangoDB comfortable on a trip even if you have no internet.

The foundation of our new documentation is build and we think it will help you to understand ArangoDB and its functions. Of course there are some plans for the near future to make our documentation more extensive.

We want to make the documentation even more clearer. So you can find everything you desire as soon as possible. It is planned to add an extra subchapter in most of the chapters with a list of all functions. This way you have a better overview about all functions with a brief explanation. With this list you don’t have to scroll through a whole chapter to find a specific function.

(more…)

More info...

New ArangoDB Documentation Released: Explore Now!

Dear ArangoDB users, we are proud to announce our new manual for ArangoDB. It is a complete overhaul, with huge changes and improvements, which became necessary because the old manual grew so fast and was edited by so many people, that it became inconsistent. We would appreciate if you could give us feedback. Either by writing comments in the google groups or by opening issues in the GitHub repository.

You can find our new manual here.

Changes highlights:

  • Everything in one place: user manual, developers manual and adminstrators manual
  • Completely new, consistent and themable design
  • Improved navigation through sidebar
  • Powerful search function
More info...

Useful ArangoSH Tips and Tricks | ArangoDB 2012

arangosh, The ArangoDB shell, provides some options that may simplify an ArangoDB user’s life. Some of these options have been added in version 1.1.2, and some options have been around for a while but are probably still less known. It’s time to showcase them.
(more…)

More info...

Get the latest tutorials,
blog posts and news: