Skip to content

Deploy Aerospike Graph Service with Kubernetes

This page describes how to run Aerospike Graph Service (AGS) using Kubernetes and connect to an Aerospike Database cluster.

Aerospike Database requirements

  • A running Aerospike Database deployment, version 7.0 or later.
  • If access control is enabled on the Aerospike Database, AGS must have sys-admin and read-write privileges as a database user.
  • Verify the namespace AGS uses on your Aerospike Database server has the configuration option default-ttl set to 0. See the TTL configuration instructions for setting this option after the server has started.
  • If TLS is required between AGS and the Aerospike Database, enable it and provide the TLS name and port via Helm parameters. See TLS between AGS and Aerospike DB for configuration details.

Deploy AGS on Kubernetes

Select a deployment platform from the following tabs.

Deploying locally requires minikube, kubectl, and Helm.

Deploy AGS on minikube

  1. Start a Kubernetes cluster locally using minikube:

    Terminal window
    minikube start
  2. Deploy Aerospike Database on minikube.

    See Install the Aerospike Kubernetes Operator to install AKO using Helm, then go to Deploy Aerospike with Helm to deploy Aerospike on the cluster.

  3. Verify you are pointing to the right Kubernetes context:

    Terminal window
    kubectl config get-contexts

    The current context should point to your minikube cluster.

Install AGS with Helm

After setting up your Kubernetes cluster, install AGS using Helm.

  1. Add the Aerospike Helm repository:

    Terminal window
    helm repo add aerospike https://artifact.aerospike.io/helm
  2. Update the Helm repository:

    Terminal window
    helm repo update
  3. Deploy AGS using Helm.

    Replace the placeholder values with your Aerospike Database connection details:

    • AEROSPIKE_HOST: Aerospike Database IP address or hostname
    • AEROSPIKE_PORT: Aerospike Database port (default 3000)
    • AEROSPIKE_NAMESPACE: Namespace for graph data (for example, test)
    • AEROSPIKE_USERNAME: (optional) Aerospike Database username if access control is enabled
    • AEROSPIKE_PASSWORD: (optional) Aerospike Database password if access control is enabled
    Terminal window
    helm install ags aerospike/aerospike-graph \
    --set 'env[0].name=aerospike.client.host' \
    --set 'env[0].value=AEROSPIKE_HOST:AEROSPIKE_PORT' \
    --set 'env[1].name=aerospike.client.namespace' \
    --set 'env[1].value=AEROSPIKE_NAMESPACE' \
    --set 'env[2].name=aerospike.client.user' \
    --set 'env[2].value=AEROSPIKE_USERNAME' \
    --set 'env[3].name=aerospike.client.password' \
    --set 'env[3].value=AEROSPIKE_PASSWORD'

    For TLS configuration, see TLS between AGS and Aerospike DB.

Check AGS pod status

After deploying AGS, verify the pod is running and check its logs.

  1. Check the status of the Aerospike Graph pod:

    Terminal window
    kubectl get pods

    The status should be Running:

    NAME READY STATUS RESTARTS AGE
    ags-aerospike-graph-589757dd9c-d794m 1/1 Running 0 23m
  2. Check the logs to verify that AGS initialized successfully.

    Replace AEROSPIKE_GRAPH_POD_NAME with the pod name from the previous step:

    Terminal window
    kubectl logs AEROSPIKE_GRAPH_POD_NAME
  3. Get the external IP for connecting to AGS.

    The Aerospike Graph Helm chart deploys a Kubernetes Load Balancer Service by default. Its external IP will be used to connect to AGS in the next section. Run kubectl get svc to check its external IP:

    Terminal window
    kubectl get svc

Verify the deployment

Gremlin Console is a command-line interface for executing Gremlin traversals against your running graph service.

  1. Download and extract the latest Gremlin Console from the Apache TinkerPop downloads:

    Terminal window
    curl -O https://dlcdn.apache.org/tinkerpop/3.8.0/apache-tinkerpop-gremlin-console-3.8.0-bin.zip && \
    unzip apache-tinkerpop-gremlin-console-3.8.0-bin.zip && \
    rm apache-tinkerpop-gremlin-console-3.8.0-bin.zip
  2. Start the console from the extracted directory:

    Terminal window
    apache-tinkerpop-gremlin-console-3.8.0/bin/gremlin.sh
  3. Connect to the Aerospike Graph Service instance. Replace EXTERNAL_IP with the external IP from the previous section:

    gremlin> g = traversal().withRemote(DriverRemoteConnection.using("EXTERNAL_IP", 8182, "g"));
    Example response
    ==>graphtraversalsource[emptygraph[empty], standard]
  4. Once you are connected via Gremlin Console and it shows gremlin>, you can create and read a record to make sure that everything works properly:

    Run the following command to create a vertex that represents a person:

    gremlin> g.addV('person').property('name', 'Alice').property('age', 29)
    Example response
    ==>v[-1]

    List all vertices and their properties and see the newly created vertex:

    gremlin> g.V().elementMap()
    Example response
    ==>[id:-1,label:person,name:Alice,age:29]
Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?