Skip to main content
Loading
Version: Operator 4.0.0

Install the Aerospike Kubernetes Operator Using Helm

Overviewโ€‹

This page describes how to use Helm charts to install the Aerospike Kubernetes Operator (AKO).

Helm charts are groups of YAML files that describe Kubernetes resources and their current configurations. If you plan to use Helm charts to deploy Aerospike clusters, you also need to use Helm to install the AKO on your Kubernetes deployment.

Requirementsโ€‹

  1. Install kubectl.
  2. You need a running Kubernetes cluster.
  3. Install cert-manager. AKO uses admission webhooks, which need TLS certificates issued by cert-manager.
  4. Install Helm.
note

In Kubernetes 1.23 and later, Pod Security Admission (PSA) is enabled by default. Make sure the namespace where the AKO is installed has either baseline or privileged Pod Security Standard level set. The restricted level is not supported by Aerospike. The default Pod Security Standard level in Kubernetes 1.23 is privileged. For more details, see Apply Pod Security Standards.

Install AKOโ€‹

  1. Add the Helm repository to get the AKO Helm charts.

    helm repo add aerospike https://aerospike.github.io/aerospike-kubernetes-enterprise

    If the Helm repository is already added, update the index:

    helm repo update
  2. Install AKO on your Kubernetes cluster.

    helm install aerospike-kubernetes-operator aerospike/aerospike-kubernetes-operator --version=4.0.0 --set watchNamespaces="aerospike"

Check AKO logsโ€‹

AKO runs as two replicas by default for higher availability. Run the following command to follow the logs for the AKO pods.

kubectl -n <release-namespace> logs -f deployment/aerospike-kubernetes-operator manager
Sample output:
2025-02-04T07:59:36Z    INFO    setup   Initializing webhook certificate watcher using provided certificates    {"webhook-cert-path": "/tmp/k8s-webhook-server/serving-certs", "webhook-cert-name": "tls.crt", "webhook-cert-key": "tls.key"}
2025-02-04T07:59:36Z INFO controller-runtime.certwatcher Updated current TLS certificate
2025-02-04T07:59:36Z INFO setup Init aerospike-server config schemas
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "6.3.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "6.4.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "7.0.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "7.1.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "7.2.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "6.0.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "6.1.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "6.2.0"}
2025-02-04T07:59:36Z DEBUG setup Config schema added {"version": "8.0.0"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a mutating webhook {"GVK": "asdb.aerospike.com/v1, Kind=AerospikeCluster", "path": "/mutate-asdb-aerospike-com-v1-aerospikecluster"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/mutate-asdb-aerospike-com-v1-aerospikecluster"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a validating webhook {"GVK": "asdb.aerospike.com/v1, Kind=AerospikeCluster", "path": "/validate-asdb-aerospike-com-v1-aerospikecluster"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/validate-asdb-aerospike-com-v1-aerospikecluster"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a mutating webhook {"GVK": "asdb.aerospike.com/v1beta1, Kind=AerospikeBackupService", "path": "/mutate-asdb-aerospike-com-v1beta1-aerospikebackupservice"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/mutate-asdb-aerospike-com-v1beta1-aerospikebackupservice"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a validating webhook {"GVK": "asdb.aerospike.com/v1beta1, Kind=AerospikeBackupService", "path": "/validate-asdb-aerospike-com-v1beta1-aerospikebackupservice"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/validate-asdb-aerospike-com-v1beta1-aerospikebackupservice"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a mutating webhook {"GVK": "asdb.aerospike.com/v1beta1, Kind=AerospikeBackup", "path": "/mutate-asdb-aerospike-com-v1beta1-aerospikebackup"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/mutate-asdb-aerospike-com-v1beta1-aerospikebackup"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a validating webhook {"GVK": "asdb.aerospike.com/v1beta1, Kind=AerospikeBackup", "path": "/validate-asdb-aerospike-com-v1beta1-aerospikebackup"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/validate-asdb-aerospike-com-v1beta1-aerospikebackup"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a mutating webhook {"GVK": "asdb.aerospike.com/v1beta1, Kind=AerospikeRestore", "path": "/mutate-asdb-aerospike-com-v1beta1-aerospikerestore"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/mutate-asdb-aerospike-com-v1beta1-aerospikerestore"}
2025-02-04T07:59:36Z INFO controller-runtime.builder Registering a validating webhook {"GVK": "asdb.aerospike.com/v1beta1, Kind=AerospikeRestore", "path": "/validate-asdb-aerospike-com-v1beta1-aerospikerestore"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Registering webhook {"path": "/validate-asdb-aerospike-com-v1beta1-aerospikerestore"}
2025-02-04T07:59:36Z INFO setup Adding webhook certificate watcher to manager
2025-02-04T07:59:36Z INFO setup Starting manager
2025-02-04T07:59:36Z INFO controller-runtime.metrics Starting metrics server
2025-02-04T07:59:36Z INFO setup disabling http/2
2025-02-04T07:59:36Z INFO starting server {"name": "health probe", "addr": "[::]:8081"}
2025-02-04T07:59:36Z INFO controller-runtime.webhook Starting webhook server
2025-02-04T07:59:36Z INFO setup disabling http/2
2025-02-04T07:59:36Z INFO controller-runtime.webhook Serving webhook server {"host": "", "port": 9443}

Grant permissions to the target namespacesโ€‹

AKO is installed in the <release-namespace> namespace. Grant additional permissions by configuring ServiceAccounts and RoleBindings or ClusterRoleBindings for the target Kubernetes namespace where the Aerospike clusters are created.

You can use the kubectl or akoctl tools to grant permissions for the aerospike namespace.

  1. Create the Kubernetes namespace if not already created.

    kubectl create namespace aerospike
  2. Create a service account.

    kubectl -n aerospike create serviceaccount aerospike-operator-controller-manager
  3. 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:

      kubectl -n aerospike create rolebinding aerospike-cluster --clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-manager
    • For connecting to the Aerospike cluster from outside Kubernetes, create a ClusterRoleBinding with the following command:

      kubectl create clusterrolebinding aerospike-cluster --clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-manager
      tip

      For attaching multiple service accounts of different namespaces at one time, add multiple --serviceaccount parameters to the previous command.

      Example: To attach service accounts of the aerospike and aerospike1 namespaces:

      kubectl create clusterrolebinding aerospike-cluster --clusterrole=aerospike-cluster --serviceaccount=aerospike:aerospike-operator-controller-manager --serviceaccount=aerospike1:aerospike-operator-controller-manager
  4. If the required ClusterRoleBinding already exists in the cluster, edit it to attach a new service account.

    kubectl edit clusterrolebinding aerospike-cluster
  5. The kubectl edit command launches an editor. Append the following lines to the subjects section:

      # A new entry for aerospike.
    # Replace aerospike with your namespace
    - kind: ServiceAccount
    name: aerospike-operator-controller-manager
    namespace: aerospike
  6. Save and ensure that the changes are applied.

Configuration referenceโ€‹

NameDescriptionDefault
replicasNumber of AKO replicas2
operatorImage.repositoryAKO image repositoryaerospike/aerospike-kubernetes-operator
operatorImage.tagAKO image tag4.0.0
operatorImage.pullPolicyImage pull policyIfNotPresent
imagePullSecretsSecrets containing credentials to pull AKO image from a private registry{} (nil)
rbac.createSet this to true to let helm chart automatically create RBAC resources necessary for AKOtrue
rbac.serviceAccountNameIf rbac.create=false, provide a service account name to be used with the AKO deploymentdefault
healthPortHealth port8081
metricsPortMetrics port8080
certs.createSet this to true to let Helm chart automatically create certificates using cert-managertrue
certs.webhookServerCertSecretNameKubernetes secret name that contains webhook server certificateswebhook-server-cert
watchNamespacesNamespaces to watch. AKO watches for AerospikeCluster custom resources in these namespaces.default
aerospikeKubernetesInitRegistryRegistry used to pull aerospike-init imagedocker.io
resourcesResource requests and limits for the AKO podsrequests.cpu: 10m, requests.memory: 64Mi , limits.cpu: 200m, limits.memory: 256Mi
affinityAffinity rules for the AKO deployment{} (nil)
extraEnvExtra environment variables that are passed into the AKO pods{} (nil)
nodeSelectorNode selectors for scheduling the AKO pods based on node labels{} (nil)
tolerationsTolerations for scheduling the AKO pods based on node taints{} (nil)
annotationsAnnotations for the AKO deployment{} (nil)
labelsLabels for the AKO deployment{} (nil)
podAnnotationsAnnotations for the AKO pods{} (nil)
podLabelsLabels for the AKO pods{} (nil)
metricsService.labelsLabels for the AKO metrics service{} (nil)
metricsService.annotationsAnnotations for the AKO metrics service{} (nil)
metricsService.portThe AKO metrics service port8443
metricsService.typeThe AKO metrics service typeClusterIP
webhookService.labelsLabels for the AKO webhook service{} (nil)
webhookService.annotationsAnnotations for the AKO webhook service{} (nil)
webhookService.portThe AKO webhook service port443
webhookService.targetPortThe AKO webhook target port9443
webhookService.typeThe AKO webhook service typeClusterIP
podSecurityContextSecurity context for the AKO pods{} (nil)
securityContex.allowPrivilegeEscalationSet allowPrivilegeEscalation in Security context for the AKO containerfalse
livenessProbeLiveliness probe for the AKO containerinitialDelaySeconds: 15, periodSeconds: 20, timeoutSeconds: 1, successThreshold: 1, failureThreshold: 3
readinessProbeReadiness probe for the AKO containerinitialDelaySeconds: 5, periodSeconds: 10, timeoutSeconds: 1, successThreshold: 1, failureThreshold: 3