Visit booth 3171 at Google Cloud Next to see how to unlock real-time decisions at scaleMore info
Use kubectl to Create an Aerospike Cluster on Kubernetes
To deploy an Aerospike Database Enterprise Edition (EE) cluster with AKO, create an Aerospike custom resource (CR) file with the cluster parameters, such as the number of nodes, Aerospike configuration, and system resources.
Then use kubectl to apply that configuration file to your Kubernetes cluster(s).
The Aerospike Kubernetes Operator can deploy multiple Aerospike clusters within a single Kubernetes namespace, or in multiple namespaces.
Requirements
Before deploying your Aerospike cluster, install the Aerospike Kubernetes Operator on your Kubernetes cluster(s) using either:
We recommend not using the Aerospike Kubernetes Operator’s namespace for your clusters.
Instead, use at least one namespace called aerospike for Aerospike clusters.
If this is the first cluster being launched, create and provide access for AKO to use this namespace.
You can use the kubectl or akoctl tools to grant permissions for the aerospike namespace.
Create a RoleBinding or ClusterRoleBinding to attach this service account to the aerospike-cluster ClusterRole.
This ClusterRole is created as part of AKO installation and grants Aerospike cluster permissions to the service account.
For using the Kubernetes native, pod-only network to connect to the Aerospike cluster, create a RoleBinding with the following command:
The use case for your cluster will help you determine which configuration parameters you need to set in the CR file.
3. Configure persistent storage
Persistent storage on the pods support a variety of storage class provisioners.
Aerospike provides sample storage class files in the GitHub repository available for download here: Sample storage classes
Apply one of the following sample storage classes based on your Kubernetes environment:
These file paths assume that you are running commands from the folder containing the files.
If not, replace the file name with the full path to the sample file.
Create secrets to set up features like the feature-key file (features.conf), Aerospike authentication, TLS, and the cluster admin password.
See the Manage TLS Certificates section for more details.
Use the custom resource YAML file (CR file) you created to deploy an Aerospike cluster.
If you don’t have a CR file, you can choose one of the sample files in the main Aerospike Kubernetes Operator repository.
Use kubectl get statefulset to ensure AKO creates the StatefulSets for the custom resource.
Output:
Terminal window
$kubectlgetstatefulset-naerospike
NAMEREADYAGE
aerocluster-02/224s
Use kubectl get pods to check the pods to confirm the status. This step may take time as the pods provision resources, initialize, and are ready.
Wait for the pods to switch to the Running state before you continue.
Output:
Terminal window
$kubectlgetpods-naerospike
NAMEREADYSTATUSRESTARTSAGE
aerocluster-0-01/1Running048s
aerocluster-0-11/1Running048s
If the Aerospike cluster pods do not switch to Running status in a few minutes, refer to the Troubleshooting Guide.