Install with Helm Chart on Kubernetes
This page describes how to set up Aerospike Vector Search (AVS) using Google Kubernetes Engine and Helm.
Setting up AVS using Kubernetes and Helm takes place in the following stages:
- Create a Kubernetes cluster
- Use Aerospike Kubernetes Operator (AKO) to deploy an Aerospike cluster
- Deploy the AVS cluster and necessary operators, configurations, and node pools
- Configure monitoring using Prometheus
- Deploy a specific Helm chart for AVS
Prerequisites
- git CLI
- gcloud CLI
- GKE Auth Plugin
- Helm 3+ CLI
- dig CLI
- A valid feature-key file
features.conf
with thevector-service
feature enabled.
- git CLI
- eksctl CLI
- Helm 3+ CLI
- dig CLI
- A valid feature-key file
features.conf
with thevector-service
feature enabled.
Install AVS with a deployment script
-
Clone and navigate to the AVS Examples GitHub repository, which includes a bash script to install all the necessary components.
Terminal window git clone https://github.com/aerospike/aerospike-vector.git && \cd aerospike-vector/kubernetes/ -
Verify that your feature-key file is locally available in the repository. In this example,
features.conf
gets copied from the Downloads folder toaerospike-vector/kubernetes/
Terminal window cp ~/Downloads/features.conf . -
Run the bash script and specify a cluster name. In this example, the cluster name is
vector
. -
Test your cluster setup with the following scripts. The script provides your external IP.
Terminal window echo "$(kubectl get nodes \--selector=aerospike.io/node-pool=avs \--output=jsonpath='{.items[0].status.addresses[?(@.type=="ExternalIP")].address}'):$(kubectl get svc avs-app-aerospike-vector-search \--namespace avs \--output=jsonpath='{.spec.ports[0].nodePort}')"If accessing externally you must open a port in your firewall.
Terminal window gcloud compute firewall-rules create avs-allow-5000 \--network default \--direction INGRESS \--action ALLOW \--rules tcp:5000 \--source-ranges 0.0.0.0/0
-
Clone and navigate to the AVS Examples GitHub repository, which includes a bash script to install all the necessary components.
Terminal window git clone https://github.com/aerospike/aerospike-vector.git && \cd aerospike-vector/kubernetes/ -
Verify that your feature-key file is locally available in the repository. In this example,
features.conf
gets copied from the Downloads folder toaerospike-vector/kubernetes/
Terminal window cp ~/Downloads/features.conf . -
Run the bash script and specify a cluster name. In this example, the cluster name is
vector
.Terminal window ./full-create-and-install-eks.sh --cluster-name vector --run-insecure -
Test your cluster setup with the following scripts. The script provides your external IP.
Terminal window kubectl get services -n istio-ingress
Next, you can do any of the following.
Download and install asvec
Use the asvec CLI tool to connect to the cluster and see your nodes. You can do this to confirm your connection or to manage your index and users.
Try a basic search
Use our basic search notebook to walk through the using the Python client in your application.
Install dashboards and connect monitoring
-
Download and install the dashboards.
Terminal window git clone https://github.com/aerospike/aerospike-monitoring.git && \./import-dashboards.sh ./aerospike-monitoring/config/grafana/dashboardsNow you can check the monitoring to see the health of your cluster.
-
Port forward to your Grafana instance.
kubectl port-forward deployments/monitoring-stack-grafana 3000:3000 -n monitoringOpen http://localhost:3000/login in a browser. The default credentials are
admin:prom-operator
.Navigate to the Aerospike Vector Search dashboard.
Install manually (GKE Only)
The full-create-and-install-gke.sh
script contains the following commands.
You can run these commands one section at a time to install manually.
-
Set environment variables. The script relies on the following environment variables, which you can configure to your preference.
Terminal window export PROJECT_ID="$(gcloud config get-value project)"export CLUSTER_NAME="aerospike-vector-search"export NODE_POOL_NAME_AEROSPIKE="aerospike-pool"export NODE_POOL_NAME_AVS="avs-pool"export ZONE="us-central1-c"export FEATURES_CONF="./features.conf" -
Create a single-node Kubernetes cluster that you will expand later by adding node pools for Aerospike Database and AVS.
Terminal window if ! gcloud container clusters create "$CLUSTER_NAME" \--project "$PROJECT_ID" \--zone "$ZONE" \--num-nodes 1 \--disk-type "pd-standard" \--disk-size "100"; thenecho "Failed to create GKE cluster"elseecho "GKE cluster created successfully."fi -
Create and configure the Aerospike Database Node Pool. This section creates a node pool for Aerospike, labels the nodes, and handles any errors in the process. The node pool ensures that Aerospike Database runs on dedicated nodes rather than potentially sharing resources with other applications running on GKE from other users.
Terminal window if ! gcloud container node-pools create "$NODE_POOL_NAME_AEROSPIKE" \--cluster "$CLUSTER_NAME" \--project "$PROJECT_ID" \--zone "$ZONE" \--num-nodes 3 \--local-ssd-count 2 \--disk-type "pd-standard" \--disk-size "100" \--machine-type "n2d-standard-2"; thenecho "Failed to create Aerospike node pool"elseecho "Aerospike node pool added successfully."fikubectl get nodes -l cloud.google.com/gke-nodepool="$NODE_POOL_NAME_AEROSPIKE" -o name | \xargs -I {} kubectl label {} aerospike.com/node-pool=default-rack --overwrite -
Install Aerospike Kubernetes Operator (AKO). This set of commands downloads and installs the Operator Lifecycle Manager, deploys AKO with a configuration file, waits for it to be fully available, and then labels nodes in the node pool to designate them for Aerospike workloads.
Terminal window curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/install.sh | bash -s v0.25.0kubectl create -f https://operatorhub.io/install/aerospike-kubernetes-operator.yamlwhile true; doif kubectl --namespace operators get deployment/aerospike-operator-controller-manager &> /dev/null; thenkubectl --namespace operators wait \--for=condition=available --timeout=180s deployment/aerospike-operator-controller-managerbreakelseecho "AKO added successfully."fidonekubectl get nodes -l cloud.google.com/gke-nodepool="$NODE_POOL_NAME_AEROSPIKE" -o name | \xargs -I {} kubectl label {} aerospike.com/node-pool=default-rack --overwrite -
Install the Aerospike Database using AKO and configure the appropriate secrets and storage settings.
Terminal window curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/install.sh | bash -s v0.25.0kubectl create -f https://operatorhub.io/install/aerospike-kubernetes-operator.yamlwhile true; doif kubectl --namespace operators get deployment/aerospike-operator-controller-manager &> /dev/null; thenkubectl --namespace operators wait \--for=condition=available --timeout=180s deployment/aerospike-operator-controller-managerbreakelsesleep 10fidonekubectl create namespace aerospikekubectl --namespace aerospike create serviceaccount aerospike-operator-controller-managerkubectl create clusterrolebinding aerospike-cluster \--clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-managerkubectl --namespace aerospike create secret generic aerospike-secret --from-file=features.conf="$FEATURES_CONF"kubectl --namespace aerospike create secret generic auth-secret --from-literal=password='admin123'kubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-operator/master/config/samples/storage/gce_ssd_storage_class.yamlkubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/ssd_storage_cluster_cr.yaml -
Validate the installation by verifying that the pods are healthy in the
aerospike
namespace. This is the last step before starting to install AVS.Terminal window kubectl get pods -n aerospikeNAME READY STATUS RESTARTS AGEaerocluster-0-0 2/2 Running 0 109saerocluster-0-1 2/2 Running 0 109saerocluster-0-2 2/2 Running 0 109s -
Create and configure a new node pool for AVS.
Terminal window if ! gcloud container node-pools create "$NODE_POOL_NAME_AVS" \--cluster "$CLUSTER_NAME" \--project "$PROJECT_ID" \--zone "$ZONE" \--num-nodes 3 \--disk-type "pd-standard" \--disk-size "100" \--machine-type "e2-highmem-4"; thenecho "Failed to create avs node pool"elseecho "avs node pool added successfully."fikubectl get nodes -l cloud.google.com/gke-nodepool="$NODE_POOL_NAME_AVS" -o name | \xargs -I {} kubectl label {} aerospike.com/node-pool=avs --overwrite -
Configure AVS namespace and secrets. The following commands set up the
avs
namespace and create secrets for the AVS cluster.Terminal window kubectl create namespace avskubectl --namespace avs create secret generic aerospike-secret --from-file=features.conf="$FEATURES_CONF"kubectl --namespace avs create secret generic auth-secret --from-literal=password='admin123' -
Deploy AVS using the Helm chart.
Terminal window helm repo add aerospike-helm https://artifact.aerospike.io/artifactory/api/helm/aerospike-helmhelm repo updatehelm install avs-gke --values https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/avs-values.yaml --namespace avs aerospike-helm/aerospike-vector-search --version 0.4.0 --wait -
Validate the installation:
Terminal window kubectl get pods -n avsNAME READY STATUS RESTARTS AGEavs-gke-aerospike-vector-search-0 1/1 Running 0 60savs-gke-aerospike-vector-search-1 1/1 Running 0 60savs-gke-aerospike-vector-search-2 1/1 Running 0 60s
Install networking and monitoring (optional)
This section describes how to set up the Prometheus monitoring stack and Istio networking stack. These steps are optional, and you may consider other monitoring and networking options.
-
Deploy and configure the Prometheus monitoring stack. These commands set up the monitoring stack using Prometheus and apply additional monitoring configurations:
Terminal window helm repo add prometheus-community https://prometheus-community.github.io/helm-chartshelm repo updatehelm install monitoring-stack prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespacekubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/monitoring/aerospike-exporter-service.yamlkubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/monitoring/aerospike-servicemonitor.yamlkubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/monitoring/avs-servicemonitor.yaml -
Deploy and configure Istio. These commands deploy Istio for application load balancing. A layer 7 load balancer is recommended.
Terminal window helm repo add istio https://istio-release.storage.googleapis.com/chartshelm repo updatehelm install istio-base istio/base --namespace istio-system --set defaultRevision=default --create-namespace --waithelm install istiod istio/istiod --namespace istio-system --create-namespace --waithelm install istio-ingress istio/gateway \--values https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/istio/istio-ingressgateway-values.yaml \--namespace istio-ingress \--create-namespace \--waitkubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/istio/gateway.yamlkubectl apply -f https://raw.githubusercontent.com/aerospike/aerospike-vector/main/kubernetes/manifests/istio/avs-virtual-service.yaml
Supported configuration
The following table describes all supported configuration parameters in the AVS Helm chart:
Parameter | Description | Default |
---|---|---|
replicaCount | Configures the number of AVS instance pods to run. | ‘1’ |
image | Configures AVS image repository, tag and pull policy. | See values.yaml. |
imagePullSecrets | For private Docker registries, when authentication is needed. | See values.yaml. |
aerospikeVectorSearchConfig | AVS cluster configuration deployed to /etc/aerospike-vector-search/aerospike-vector-search.yml . | See values.yaml. |
initContainers | List of initContainers added to each AVS pod for custom cluster behavior. | |
serviceAccount | Service Account details like name and annotations. | See values.yaml. |
podAnnotations | Additional pod annotations. Must be specified as a map of annotation names to annotation values. | {} |
podLabels | Additional pod labels. Must be specified as a map of label names to label values. | {} |
podSecurityContext | Pod security context | {} |
securityContext | Container security context | {} |
service | Load balancer configuration. For more details see Load Balancer Service. | {} |
resources | Resource requests and limits for the AVS pods. | {} |
autoscaling | Enable the horizontal pod auto-scaler. | See values.yaml. |
extraVolumes | List of additional volumes to attach to the AVS pod. | See values.yaml. |
extraVolumeMounts | Extra volume mounts corresponding to the volumes added to extraVolumes . | See values.yaml. |
extraSecretVolumeMounts | Extra secret volume mounts corresponding to the volumes added to extraVolumes . | See values.yaml. |
affinity | Affinity rules if any for the pods. | {} |
nodeSelector | Node selector for the pods. | {} |
tolerations | Tolerations for the pods. | {} |