Skip to main content

AerospikeClusterTemplate API Reference

This page documents the AerospikeClusterTemplate Custom Resource Definition (CRD) types.

API Group: acko.io API Version: v1alpha1 Kind: AerospikeClusterTemplate Short Names: asct


Overview

AerospikeClusterTemplate is a reusable configuration profile for AerospikeCluster. It lets you define shared settings (scheduling, storage, resources, Aerospike config) once and reference them from multiple clusters via spec.templateRef.

Snapshot strategy: The template spec is copied into status.templateSnapshot at cluster creation time. Subsequent template changes are not automatically propagated. To resync, set the annotation acko.io/resync-template: "true" on the cluster object.


AerospikeClusterTemplate

FieldTypeDescription
apiVersionstringacko.io/v1alpha1
kindstringAerospikeClusterTemplate
metadataObjectMetaStandard object metadata
specAerospikeClusterTemplateSpecConfiguration profile
statusAerospikeClusterTemplateStatusObserved state

AerospikeClusterTemplateSpec

FieldTypeDescription
descriptionstringHuman-readable description of the template's purpose or target environment (max 500 characters).
aerospikeConfigTemplateAerospikeConfigAerospike configuration defaults
schedulingTemplateSchedulingPod scheduling defaults
storageTemplateStorageData volume defaults
resourcesResourceRequirementsContainer CPU/memory defaults
rackConfigTemplateRackConfigRack configuration defaults
imagestringDefault Aerospike CE container image (e.g. aerospike:ce-8.1.1.1). Applied when spec.image is not set in the cluster.
sizeintegerDefault cluster size (1–8). Applied when spec.size is 0 (not set) in the cluster.
monitoringAerospikeMonitoringSpecDefault Prometheus exporter sidecar configuration. Applied when spec.monitoring is not set in the cluster.
aerospikeNetworkPolicyAerospikeNetworkPolicyDefault network access configuration. Applied when spec.aerospikeNetworkPolicy is not set in the cluster.

TemplateAerospikeConfig

FieldTypeDescription
namespaceDefaultsobjectBase configuration merged into every namespace defined in the cluster's aerospikeConfig.namespaces. Cluster-level settings override these defaults.
serviceobjectDefaults for the service section of aerospikeConfig. Cluster-level settings override these defaults.
networkTemplateNetworkConfigNetwork configuration defaults

TemplateNetworkConfig

FieldTypeDescription
heartbeatTemplateHeartbeatConfigHeartbeat configuration defaults

TemplateHeartbeatConfig

FieldTypeDescription
modestringHeartbeat mode. Must be mesh for CE.
intervalintegerHeartbeat interval in milliseconds
timeoutintegerHeartbeat timeout in milliseconds

TemplateScheduling

FieldTypeDescription
podAntiAffinityLevelstringPod anti-affinity policy: none, preferred, or required. required enforces one Aerospike pod per node.
nodeAffinityNodeAffinityNode affinity rules for pod scheduling
tolerations[]TolerationPod scheduling tolerations
topologySpreadConstraints[]TopologySpreadConstraintHow pods are spread across topology domains
podManagementPolicystringStatefulSet pod management policy: OrderedReady or Parallel

PodAntiAffinityLevel values

ValueBehavior
noneNo anti-affinity rules are injected
preferredSoft rule (weight=100): prefer spreading pods across nodes
requiredHard rule: exactly one Aerospike pod per node

TemplateStorage

FieldTypeDescription
storageClassNamestringKubernetes StorageClass for the data PVC
volumeModestringFilesystem (default) or Block
accessModes[]stringPVC access modes (default: ReadWriteOnce)
resourcesVolumeResourceRequirementsStorage size request
localPVRequiredbooleanWhen true, asserts that the StorageClass uses WaitForFirstConsumer binding mode (local PV)

TemplateRackConfig

FieldTypeDescription
maxRacksPerNodeintegerMaximum racks per Kubernetes node. When set to 1, a warning is raised if podAntiAffinityLevel is not required.

AerospikeClusterTemplateStatus

FieldTypeDescription
usedBy[]stringList of AerospikeCluster names that reference this template

Using Templates in a Cluster

Reference a template via spec.templateRef in AerospikeCluster:

apiVersion: acko.io/v1alpha1
kind: AerospikeCluster
metadata:
name: my-cluster
spec:
size: 3
image: aerospike:ce-8.1.1.1
templateRef:
name: prod # references AerospikeClusterTemplate named "prod"
overrides: # optional: override specific fields from the template
resources:
requests:
cpu: "1"
memory: "2Gi"
limits:
cpu: "2"
memory: "2Gi"

Resync after template update

Template changes are not automatically applied to clusters. To resync:

kubectl annotate aerospikecluster my-cluster acko.io/resync-template=true

The operator will re-fetch the template, update status.templateSnapshot, emit a TemplateApplied event, and remove the annotation.


Validation Rules

RuleDescription
V-T01scheduling.podAntiAffinityLevel must be none, preferred, or required
V-T02rackConfig.maxRacksPerNode must be >= 0
V-T03storage.localPVRequired=true without storageClassName raises a warning
V-T04For Guaranteed QoS, resource requests should equal limits (warning)
V-T05scheduling.podManagementPolicy must be OrderedReady or Parallel
V-T06image should contain ce- to confirm it is a Community Edition image (warning)
V-T07size must be between 1 and 8 when specified (CE cluster limit)
V-T08monitoring.port must be between 1 and 65535 when specified