Skip to content

Create Aerospike cluster

Sage edited this page Mar 15, 2021 · 24 revisions

To deploy an Aerospike cluster using the Operator, you will create the Aeropsike configuration file that describes what you want the cluster to look like (e.g. number of nodes, types of services, system resources, etc), and then push that configuration file into Kubernetes.

Prerequisites

Before deploying your Aerospike cluster ensure that you have:

  • Reviewed the prerequisites and system requirements
  • Downloaded the Aerospike Kubernetes Operator
  • Installed the Operator on Kubernetes, and ensure that it is up and running

Prepare the Aeropsike cluster configuration:

The Operator package contains example YAML configuration files for the cluster deployment. After unpacking the files, the resulting directory will be /aerospike-kubernetes-operator/deploy. Make sure to cd into this directory before you run the commands.

  • Specify your configuration settings in your custom resource (CR) file.
  • Identify if you plan to use cross-datacenter replication (XDR) and ensure that you are familiar with it
  • Ensure you are familiar with TLS for network security with Aerospike clusters.

Configure persistent storage

The Aerospike Operator is designed to work with dynamically provisioned storage classes. A storage class is used to dynamically provision the persistent storage. Aerospike Server pods may have different storage volumes associated with each service.

To learn more about configuring persistent storage:

  • For Amazon Elastic Kubernetes Service, the instructions are here.
  • For Google Kubernetes Engine, the instructions are here
  • For Microsoft Azure Kubernetes Service, the instructions are here.

Persistent storage on the pods will use these storage class provisioners to provision storage.

To apply a sample storage class based on your Kubernetes environment:

For GKE

$ kubectl apply -f deploy/samples/storage-classes/gce-ssd-storage-class.yaml

For EKS

$ kubectl apply -f deploy/samples/storage-classes/eks-ssd-storage-class.yaml

For MicroK8s

$ kubectl apply -f deploy/samples/storage-classes/microk8s-filesystem-storage-class.yaml

See Storage Provisioning for more details on configuring persistent storage.

Create secrets

Create secrets to setup Aerospike authentication, TLS, and feature.conf. See TLS for more details.

Aerospike secrets like TLS certificates, security credentials, and features.conf can be packaged in a single directory and converted to Kubernetes secrets like so

$ kubectl  -n aerospike create secret generic aerospike-secret --from-file=deploy/secrets

Create a secret containing the password for Aerospike cluster admin user by passing the password from the command line.

$ kubectl  -n aerospike create secret generic auth-secret --from-literal=password='admin123'

Create Aerospike cluster Custom Resource (CR)

Refer to the Configuration section for details of the Aerospike cluster CR. Sample Aerospike cluster CR files for different configurations can be found here.

This custom resource can be edited later on to make any changes/manage the Aerospike cluster.

Deploy Aerospike cluster

Use the CR yaml file create above to deploy an Aerospike cluster.

$ kubectl apply -f deploy/samples/dim_nostorage_cluster_cr.yaml

Note: Replace the file name with CR yaml file for your cluster.

Verify cluster status

Ensure that the aerospike-kubernetes-operator creates a StatefulSet for the CR.

$ kubectl get statefulset -n aerospike
NAME      READY   AGE
aerocluster-0   2/2     24s

Check the pods to confirm the status. This step may take time as the pod's provision resources, initialize, and are ready. Please wait for the pods to switch to the running state.

$ kubectl get pods -n aerospike
NAME          READY   STATUS      RESTARTS   AGE
aerocluster-0-0     1/1     Running     0          48s
aerocluster-0-1     1/1     Running     0          48s

Next

Clone this wiki locally