Skip to content

Latest commit

 

History

History
109 lines (76 loc) · 3.33 KB

README.md

File metadata and controls

109 lines (76 loc) · 3.33 KB

aerospike-kubernetes-enterprise

This project contains the init container used in Kubernetes (k8s) and the Aerospike StatefulSet definition. This manifest will allow you to deploy a fully formed Aerospike cluster in minutes.

This project uses:

Usage:

Configure:

Set environment variables (modify if necessary):

export APP_NAME=aerospike
export NAMESPACE=default
export AEROSPIKE_NODES=3
export AEROSPIKE_NAMESPACE=test
export AEROSPIKE_REPL=2
export AEROSPIKE_MEM=1
export AEROSPIKE_TTL=0
export AEROSPIKE_FEATURE_KEY_FILE=/etc/aerospike/features.conf
export AEROSPIKE_NSUP_PERIOD=0 # if AEROSPIKE_TTL is not 0, AEROSPIKE_NSUP_PERIOD should not be 0.

All AEROSPIKE_* parameters except AEROSPIKE_NODES, AEROSPIKE_MEM are optional. Default values are listed above. All other parameters are required.

NOTE: Feature key file is mandatory for running aerospike server enterprise edition.

Configuring Storage:

The statefulset definition refers to a custom StorageClass ssd. You can find the storageclass ssd definition in storageclass-aws.yaml or storageclass-gcp.yaml (Uncomment them to use). You can also define your own storageclass and use it within the statefulset definition.

Dynamic provisioning for local volumes are not supported yet. However, a local volume provisioner can be deployed to automate the provisioning of local devices. Please check examples/ for using a local volume static provisioner.

If you want to use the raw block volume mode, you need to define volumeMode as Block in the Volume Claim and use volumeDevices and devicePath instead of volumeMounts and mountPath as shown in the example below.

  volumeClaimTemplates:
  - metadata:
      name: data-dev
      labels: *AerospikeDeploymentLabels
    spec:
      volumeMode: Block
      accessModes:
        - ReadWriteOnce
      storageClassName: ssd
      resources:
        requests:
          storage: ${AEROSPIKE_MEM}Gi
.....
volumeMounts:
        - name: confdir
          mountPath: /etc/aerospike
volumeDevices:
        - name: data-dev
          devicePath: /dev/sdb
.....

For Kubernetes version > 1.11, there's a default storage class gp2 available on AWS EKS clusters, uses aws-ebs provisioner and volume type gp2.

Apply feature-key-file:

To apply feature-key-file, simply add the file to configs/ and create the ConfigMap. If using mounted volumes to apply the feature-key-file, you can use AEROSPIKE_FEATURE_KEY_FILE to specify the file path within the container.

Examples:

To view and run the examples, go to examples/

Deployment:

Please follow the below steps or run start.sh script:

  1. Expand manifest template:
cat manifests/* | envsubst > expanded.yaml
  1. Create the configmap object:
kubectl create configmap aerospike-conf -n $NAMESPACE --from-file=configs/
  1. Deploy:
kubectl create -f expanded.yaml

Helm Charts

Helm chart for the same can be found here

Requirements

  • Kubernetes 1.8+
  • Kubernetes DNS add-in