├── .gitignore ├── helm ├── charts │ └── .gitkeep ├── .helmignore ├── files │ ├── alertmanager.yaml │ ├── aerospike.template.conf │ ├── ape.toml.template │ └── aerospike_rules.yaml ├── templates │ ├── _helpers.tpl │ ├── NOTES.txt │ ├── serviceaccount.yaml │ ├── secrets.yaml │ ├── clusterrolebinding.yaml │ ├── grafana-service.yaml │ ├── alertmanager-service.yaml │ ├── clusterrole.yaml │ ├── prometheus-service.yaml │ ├── alertmanager-operated-service.yaml │ ├── service.yaml │ ├── nodeportservices.yaml │ ├── loadbalancerservices.yaml │ ├── alertmanager-configmap.yaml │ ├── configmap.yaml │ ├── prometheus-configmap.yaml │ ├── externalipservices.yaml │ ├── alertmanager-statefulset.yaml │ ├── prometheus-statefulset.yaml │ ├── grafana-statefulset.yaml │ └── statefulset.yaml ├── Chart.yaml ├── CHANGELOG.md └── values.yaml ├── docs ├── aerospike-enterprise-4.6.0.tgz ├── aerospike-enterprise-4.7.0.tgz ├── aerospike-enterprise-4.8.0.tgz ├── aerospike-enterprise-4.9.0.tgz ├── aerospike-enterprise-5.0.0.tgz ├── aerospike-enterprise-5.1.0.tgz ├── aerospike-enterprise-5.2.0.tgz ├── aerospike-enterprise-5.3.0.tgz ├── aerospike-enterprise-5.4.0.tgz ├── aerospike-enterprise-5.5.0.tgz ├── aerospike-enterprise-5.5.1.tgz └── artifacthub-repo.yml ├── start.sh ├── examples ├── shadow-device │ ├── namespace.yaml │ ├── storageclass-gcp.yaml │ ├── storageclass-aws.yaml │ ├── service.yaml │ ├── configmap │ │ └── aerospike.template.conf │ ├── aerospike-local-volume-provisioner.yaml │ ├── statefulset-shadow-device.yaml │ └── README.md └── storage-engine-device │ ├── namespace.yaml │ ├── service.yaml │ ├── configmap │ └── aerospike.template.conf │ ├── aerospike-local-volume-provisioner.yaml │ ├── statefulset-raw-device.yaml │ └── README.md ├── manifests ├── namespace.yaml ├── storageclass-gcp.yaml ├── storageclass-aws.yaml ├── service.yaml └── statefulset.yaml ├── configs └── aerospike.template.conf ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /helm/charts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/aerospike-enterprise-4.6.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-4.6.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-4.7.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-4.7.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-4.8.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-4.8.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-4.9.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-4.9.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-5.0.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-5.0.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-5.1.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-5.1.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-5.2.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-5.2.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-5.3.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-5.3.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-5.4.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-5.4.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-5.5.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-5.5.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-enterprise-5.5.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes-enterprise/HEAD/docs/aerospike-enterprise-5.5.1.tgz -------------------------------------------------------------------------------- /helm/.helmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .git/ 3 | .gitignore 4 | # Common backup files 5 | *.swp 6 | *.bak 7 | *.tmp 8 | *~ 9 | # Various IDEs 10 | .project 11 | .idea/ 12 | *.tmproj 13 | .vscode/ 14 | -------------------------------------------------------------------------------- /helm/files/alertmanager.yaml: -------------------------------------------------------------------------------- 1 | # This is an example alertmanager.yaml which sends alert notifications to a slack channel. 2 | # Use "--set-file alertmanager.alertmanagerConfFile=" during "helm install" or "helm upgrade" to use custom alertmanager.yaml. 3 | # or, 4 | # Use "--set alertmanager.alertmanagerConfFileBase64=" during "helm install" or "helm upgrade" to use custom alertmanager.yaml. 5 | 6 | global: 7 | slack_api_url: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX" 8 | route: 9 | group_by: ['alertname', 'cluster', 'service'] 10 | receiver: slack_general 11 | 12 | receivers: 13 | - name: slack_general 14 | slack_configs: 15 | - channel: '#channel' 16 | text: "summary: {{ "{{" }} .CommonAnnotations.summary {{ "}}" }}\ndescription: {{ "{{" }} .CommonAnnotations.description {{ "}}" }}" -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | RED='\033[0;31m' 3 | NC='\033[0m' 4 | GREEN='\033[0;32m' 5 | PINK='\033[0;35m' 6 | cat manifests/* | envsubst '$APP_NAME $NAMESPACE $AEROSPIKE_NODES $AEROSPIKE_NAMESPACE $AEROSPIKE_REPL $AEROSPIKE_MEM $AEROSPIKE_TTL $AEROSPIKE_FEATURE_KEY_FILE $AEROSPIKE_NSUP_PERIOD' > expanded.yaml 7 | if [ $? != 0 ]; then printf "Creating ${PINK}expanded.yaml${NC} - ${RED}Failed${NC}\n\n"; else printf "Creating ${PINK}expanded.yaml${NC} - ${GREEN}Success${NC}\n\n"; fi 8 | kubectl create configmap aerospike-conf -n $NAMESPACE --from-file=configs/ 9 | if [ $? != 0 ]; then printf "Creating ${PINK}ConfigMap${NC} object - ${RED}Failed${NC}\n\n"; else printf "Creating ${PINK}ConfigMap${NC} object - ${GREEN}Success${NC}\n\n"; fi 10 | kubectl create -f expanded.yaml 11 | if [ $? != 0 ]; then printf "${PINK}Deployment${NC} - ${RED}Failed${NC}\n\n"; else printf "${PINK}Deployment${NC} - ${GREEN}Success${NC}\n\n"; fi 12 | -------------------------------------------------------------------------------- /examples/shadow-device/namespace.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # Namespace 19 | apiVersion: v1 20 | kind: Namespace 21 | metadata: 22 | name: dev 23 | --- 24 | -------------------------------------------------------------------------------- /helm/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Define aerospike.name 4 | */}} 5 | {{- define "aerospike.name" -}} 6 | {{- default .Chart.Name -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Define aerospike.fullname 11 | */}} 12 | {{- define "aerospike.fullname" -}} 13 | {{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Define aerospike.chart 18 | */}} 19 | {{- define "aerospike.chart" -}} 20 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 21 | {{- end -}} 22 | 23 | {{/* 24 | Define aerospike.labels 25 | */}} 26 | {{- define "aerospike.labels" -}} 27 | app.kubernetes.io/name: {{ include "aerospike.name" . }} 28 | helm.sh/chart: {{ include "aerospike.chart" . }} 29 | app.kubernetes.io/instance: {{ .Release.Name }} 30 | {{- if .Chart.AppVersion }} 31 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 32 | {{- end }} 33 | app.kubernetes.io/managed-by: {{ .Release.Service }} 34 | {{- end -}} 35 | -------------------------------------------------------------------------------- /manifests/namespace.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # Namespace 19 | apiVersion: v1 20 | kind: Namespace 21 | metadata: 22 | name: $NAMESPACE 23 | 24 | --- 25 | -------------------------------------------------------------------------------- /examples/storage-engine-device/namespace.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # Namespace 19 | apiVersion: v1 20 | kind: Namespace 21 | metadata: 22 | name: dev 23 | --- 24 | -------------------------------------------------------------------------------- /examples/shadow-device/storageclass-gcp.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | kind: StorageClass 19 | apiVersion: storage.k8s.io/v1 20 | metadata: 21 | name: shadow 22 | provisioner: kubernetes.io/gce-pd 23 | parameters: 24 | type: pd-ssd 25 | --- 26 | -------------------------------------------------------------------------------- /manifests/storageclass-gcp.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # kind: StorageClass 19 | # apiVersion: storage.k8s.io/v1 20 | # metadata: 21 | # name: ssd 22 | # provisioner: kubernetes.io/gce-pd 23 | # parameters: 24 | # type: pd-ssd 25 | # --- 26 | -------------------------------------------------------------------------------- /docs/artifacthub-repo.yml: -------------------------------------------------------------------------------- 1 | # Artifact Hub repository metadata file 2 | # 3 | # Some settings like the verified publisher flag or the ignored packages won't 4 | # be applied until the next time the repository is processed. Please keep in 5 | # mind that the repository won't be processed if it has not changed since the 6 | # last time it was processed. Depending on the repository kind, this is checked 7 | # in a different way. For Helm http based repositories, we consider it has 8 | # changed if the `index.yaml` file changes. For git based repositories, it does 9 | # when the hash of the last commit in the branch you set up changes. This does 10 | # NOT apply to ownership claim operations, which are processed immediately. 11 | # 12 | #repositoryID: The ID of the Artifact Hub repository where the packages will be published to (optional, but it enables verified publisher) 13 | owners: # (optional, used to claim repository ownership) 14 | - name: Aerospike 15 | email: developers@aerospike.com 16 | - name: Joe Martin 17 | email: joem@aerospike.com 18 | - name: Joe Martin 19 | email: jmartin@aerospike.com 20 | - name: Sudhanshu Ranjan 21 | email: sudhanshu@aerospike.com -------------------------------------------------------------------------------- /helm/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 2 | Thank you for installing {{ .Chart.Name }}-{{ .Chart.AppVersion }}. 3 | Release Name - {{ .Release.Name }}. 4 | __ 5 | / \ 6 | / \ 7 | / /\ \ 8 | | / \ | 9 | | / \ | 10 | /\ | | ( ) | | /\ 11 | / \ | | ( ) | | / \ 12 | |----| | | | | |----| 13 | | | | /| . |\ | | | 14 | | | / | . | \ | | 15 | | / | . | \ | 16 | | / | . | \ | 17 | |/ | . | \| 18 | / AEROSPIKE| . |AEROSPIKE \ 19 | ( | | ) Launched! 20 | | | |--| |--| | | 21 | / \-----/ \/ \-----/ \ 22 | \\// \\//\\// \\// 23 | \/ \/ \/ \/ 24 | 25 | Run the following commands to get more information about deployment: 26 | 27 | For Helm v2, 28 | $ helm status {{ .Release.Name }} 29 | $ helm get {{ .Release.Name }} 30 | 31 | For Helm v3, 32 | $ helm status {{ .Release.Name }} 33 | $ helm get all {{ .Release.Name }} 34 | 35 | $ kubectl get all --namespace {{ .Release.Namespace }} -l "release={{ .Release.Name }}, chart={{ $.Chart.Name }}" 36 | -------------------------------------------------------------------------------- /manifests/storageclass-aws.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # kind: StorageClass 19 | # apiVersion: storage.k8s.io/v1 20 | # metadata: 21 | # name: ssd 22 | # annotations: 23 | # storageclass.kubernetes.io/is-default-class: "true" 24 | # provisioner: kubernetes.io/aws-ebs 25 | # parameters: 26 | # type: gp2 27 | # encrypted: "false" 28 | # --- 29 | -------------------------------------------------------------------------------- /examples/shadow-device/storageclass-aws.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # kind: StorageClass 19 | # apiVersion: storage.k8s.io/v1 20 | # metadata: 21 | # name: shadow 22 | # annotations: 23 | # storageclass.kubernetes.io/is-default-class: "true" 24 | # provisioner: kubernetes.io/aws-ebs 25 | # parameters: 26 | # type: gp2 27 | # encrypted: "false" 28 | # --- 29 | -------------------------------------------------------------------------------- /helm/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | --- 18 | {{- if .Values.rbac.create -}} 19 | apiVersion: v1 20 | kind: ServiceAccount 21 | metadata: 22 | labels: 23 | app: {{ template "aerospike.name" . }} 24 | chart: {{ .Chart.Name }} 25 | release: {{ .Release.Name }} 26 | name: {{ template "aerospike.fullname" . }} 27 | namespace: {{ .Release.Namespace }} 28 | {{- end -}} -------------------------------------------------------------------------------- /examples/shadow-device/service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # Headless service to provide DNS lookup 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | annotations: 23 | service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" 24 | name: aerospike 25 | namespace: dev 26 | labels: 27 | app: aerospike-test 28 | spec: 29 | publishNotReadyAddresses: true 30 | ports: 31 | - port: 3000 32 | name: aerospike-client 33 | # *.aerospike.default.svc.cluster.local 34 | clusterIP: None 35 | selector: 36 | app: aerospike-test 37 | --- 38 | -------------------------------------------------------------------------------- /examples/storage-engine-device/service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # Headless service to provide DNS lookup 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | annotations: 23 | service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" 24 | name: aerospike 25 | namespace: dev 26 | labels: 27 | app: aerospike-test 28 | spec: 29 | publishNotReadyAddresses: true 30 | ports: 31 | - port: 3000 32 | name: aerospike-client 33 | # *.aerospike.default.svc.cluster.local 34 | clusterIP: None 35 | selector: 36 | app: aerospike-test 37 | --- 38 | -------------------------------------------------------------------------------- /helm/templates/secrets.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: {{ .Release.Name }}-secrets 5 | namespace: {{ .Release.Namespace }} 6 | labels: 7 | app: {{ template "aerospike.name" . }} 8 | chart: {{ .Chart.Name }} 9 | release: {{ .Release.Name }} 10 | type: Opaque 11 | data: 12 | {{- if and .Values.featureKeyFilePath .Values.featureKeyFile }} 13 | {{ fail "Both legacy(featureKeyFilePath) and new(featureKeyFile) are configured! Use only one!" }} 14 | {{- end }} 15 | 16 | {{- if and (or .Values.featureKeyFilePath .Values.featureKeyFile) (.Values.featureKeyFileBase64) }} 17 | {{ fail "Both featureKeyFilePath/featureKeyFile and featureKeyFileBase64 are configured! Use only one!" }} 18 | {{- end }} 19 | 20 | {{- if and (not .Values.featureKeyFile) (not .Values.featureKeyFilePath) (not .Values.featureKeyFileBase64) (not .Values.aerospikeFeatureKeyFilePath) }} 21 | {{ fail "feature key file not provided!" }} 22 | {{- end }} 23 | 24 | # Old config for feature key file 25 | {{- if (.Values.featureKeyFilePath) }} 26 | features.conf: {{ .Values.featureKeyFilePath | b64enc | quote }} 27 | {{- end }} 28 | 29 | # New config for feature key file 30 | {{- if (.Values.featureKeyFile) }} 31 | features.conf: {{ .Values.featureKeyFile | b64enc | quote }} 32 | {{- end }} 33 | 34 | # feature key file as base64 directly 35 | {{- if (.Values.featureKeyFileBase64) }} 36 | features.conf: {{ .Values.featureKeyFileBase64 | quote }} 37 | {{- end }} 38 | -------------------------------------------------------------------------------- /helm/templates/clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | --- 18 | {{- if .Values.rbac.create -}} 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRoleBinding 21 | metadata: 22 | labels: 23 | app: {{ template "aerospike.name" . }} 24 | chart: {{ .Chart.Name }} 25 | release: {{ .Release.Name }} 26 | name: {{ template "aerospike.fullname" . }} 27 | roleRef: 28 | apiGroup: rbac.authorization.k8s.io 29 | kind: ClusterRole 30 | name: {{ template "aerospike.fullname" . }} 31 | subjects: 32 | - kind: ServiceAccount 33 | name: {{ template "aerospike.fullname" . }} 34 | namespace: {{ .Release.Namespace }} 35 | {{- end -}} -------------------------------------------------------------------------------- /helm/templates/grafana-service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ .Release.Name }}-grafana 23 | namespace: {{ .Release.Namespace }} 24 | labels: 25 | app: {{ template "aerospike.name" . }}-grafana 26 | chart: {{ .Chart.Name }} 27 | release: {{ .Release.Name }} 28 | app.kubernetes.io/component: grafana 29 | spec: 30 | ports: 31 | - name: http 32 | port: 80 33 | protocol: TCP 34 | targetPort: {{ .Values.grafana.httpPort | default 3000 }} 35 | selector: 36 | app: {{ template "aerospike.name" . }}-grafana 37 | {{- end }} 38 | -------------------------------------------------------------------------------- /helm/templates/alertmanager-service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ .Release.Name }}-alertmanager 23 | labels: 24 | app: {{ template "aerospike.name" . }}-alertmanager 25 | chart: {{ .Chart.Name }} 26 | release: {{ .Release.Name }} 27 | app.kubernetes.io/component: alertmanager 28 | spec: 29 | ports: 30 | - name: http 31 | port: {{ .Values.alertmanager.webPort | default 9093 }} 32 | protocol: TCP 33 | targetPort: {{ .Values.alertmanager.webPort | default 9093 }} 34 | selector: 35 | app: {{ template "aerospike.name" . }}-alertmanager 36 | type: "ClusterIP" 37 | {{- end }} 38 | -------------------------------------------------------------------------------- /helm/templates/clusterrole.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | --- 18 | {{- if .Values.rbac.create -}} 19 | apiVersion: rbac.authorization.k8s.io/v1 20 | kind: ClusterRole 21 | metadata: 22 | labels: 23 | app: {{ template "aerospike.name" . }} 24 | chart: {{ .Chart.Name }} 25 | release: {{ .Release.Name }} 26 | name: {{ template "aerospike.fullname" . }} 27 | rules: 28 | - apiGroups: 29 | - "" 30 | resources: 31 | - namespaces 32 | - pods 33 | - statefulsets 34 | - configmaps 35 | - secrets 36 | - services 37 | - nodes 38 | - nodes/metrics 39 | - endpoints 40 | verbs: 41 | - list 42 | - watch 43 | - get 44 | - nonResourceURLs: ["/metrics"] 45 | verbs: ["get"] 46 | {{- end -}} -------------------------------------------------------------------------------- /helm/templates/prometheus-service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | kind: Service 20 | apiVersion: v1 21 | metadata: 22 | name: {{ .Release.Name }}-prometheus 23 | namespace: {{ .Release.Namespace }} 24 | labels: 25 | app: {{ template "aerospike.name" . }}-prometheus 26 | chart: {{ .Chart.Name }} 27 | release: {{ .Release.Name }} 28 | app.kubernetes.io/component: prometheus 29 | spec: 30 | ports: 31 | - name: http 32 | port: {{ .Values.prometheus.serverPort | default 9090 }} 33 | protocol: TCP 34 | targetPort: {{ .Values.prometheus.serverPort | default 9090 }} 35 | sessionAffinity: ClientIP 36 | selector: 37 | app: {{ template "aerospike.name" . }}-prometheus 38 | {{- end }} 39 | -------------------------------------------------------------------------------- /helm/Chart.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | apiVersion: v1 19 | appVersion: 5.5.0.7 20 | # The Aerospike Server Enterprise Edition on Kubernetes chart is deprecated and no longer maintained. 21 | deprecated: true 22 | description: "DEPRECATED: This Helm chart is no longer actively developed, instead use (https://artifacthub.io/packages/helm/aerospike/aerospike-kubernetes-operator) 23 | for complete life cycle management on Kubernetes" 24 | name: aerospike-enterprise 25 | version: 5.5.1 26 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 27 | sources: 28 | - https://github.com/aerospike/aerospike-server-enterprise.docker 29 | - https://github.com/aerospike/aerospike-kubernetes-enterprise 30 | - https://github.com/aerospike/aerospike-kubernetes-init 31 | - https://github.com/aerospike/aerospike-prometheus-exporter 32 | -------------------------------------------------------------------------------- /manifests/service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # Headless service to provide DNS lookup 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | # deprecation in 1.10, supported until at least 1.13, breaks peer-finder/kube-dns if not used 23 | annotations: 24 | service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" 25 | name: aerospike 26 | namespace: $NAMESPACE 27 | labels: 28 | app: $APP_NAME 29 | spec: 30 | # deprecates service.alpha.kubernetes.io/tolerate-unready-endpoints as of 1.10? see: kubernetes/kubernetes#49239 Fixed in 1.11 as of #63742 31 | publishNotReadyAddresses: true 32 | ports: 33 | - port: 3000 34 | name: aerospike-client 35 | # *.aerospike.default.svc.cluster.local 36 | clusterIP: None 37 | selector: 38 | # Tells which pods are part of the DNS record 39 | app: $APP_NAME 40 | --- 41 | -------------------------------------------------------------------------------- /helm/templates/alertmanager-operated-service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ .Release.Name }}-alertmanager-operated 23 | labels: 24 | app: {{ template "aerospike.name" . }}-alertmanager 25 | chart: {{ .Chart.Name }} 26 | release: {{ .Release.Name }} 27 | app.kubernetes.io/component: alertmanager 28 | spec: 29 | type: "ClusterIP" 30 | clusterIP: None 31 | selector: 32 | app: {{ template "aerospike.name" . }}-alertmanager 33 | ports: 34 | - name: mesh 35 | port: {{ .Values.alertmanager.meshPort | default 9094 }} 36 | protocol: TCP 37 | targetPort: {{ .Values.alertmanager.meshPort | default 9094 }} 38 | - name: http 39 | port: {{ .Values.alertmanager.webPort | default 9093 }} 40 | protocol: TCP 41 | targetPort: {{ .Values.alertmanager.webPort | default 9093 }} 42 | {{- end }} 43 | -------------------------------------------------------------------------------- /configs/aerospike.template.conf: -------------------------------------------------------------------------------- 1 | # Aerospike database configuration file. 2 | 3 | # This stanza must come first. 4 | service { 5 | user root 6 | group root 7 | paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. 8 | pidfile /var/run/aerospike/asd.pid 9 | proto-fd-max 15000 10 | feature-key-file ${FEATURE_KEY_FILE} 11 | } 12 | 13 | logging { 14 | 15 | # Log file must be an absolute path. 16 | file ${LOGFILE} { 17 | context any info 18 | } 19 | 20 | # Send log messages to stdout 21 | console { 22 | context any info 23 | } 24 | } 25 | 26 | 27 | network { 28 | service { 29 | address ${SERVICE_ADDRESS} 30 | port ${SERVICE_PORT} 31 | 32 | # Uncomment the following to set the `access-address` parameter to the 33 | # IP address of the Docker host. This will the allow the server to correctly 34 | # publish the address which applications and other nodes in the cluster to 35 | # use when addressing this node. 36 | # access-address 37 | } 38 | 39 | heartbeat { 40 | 41 | address ${HB_ADDRESS} 42 | # mesh is used for environments that do not support multicast 43 | mode mesh 44 | port ${HB_PORT} 45 | 46 | # use asinfo -v 'tip:host=;port=3002' to inform cluster of 47 | # other mesh nodes 48 | # mesh-seed-placeholder 49 | 50 | interval 150 51 | timeout 10 52 | } 53 | 54 | fabric { 55 | address ${FABRIC_ADDRESS} 56 | port ${FABRIC_PORT} 57 | } 58 | 59 | } 60 | 61 | namespace ${NAMESPACE} { 62 | replication-factor ${REPL_FACTOR} 63 | memory-size ${MEM_GB}G 64 | default-ttl ${DEFAULT_TTL} 65 | nsup-period ${NSUP_PERIOD} 66 | 67 | # storage-engine memory 68 | 69 | # To use file storage backing, comment out the line above and use the 70 | # following lines instead. 71 | 72 | storage-engine device { 73 | file /opt/aerospike/data/${MY_POD_NAME}-${NAMESPACE}.dat 74 | filesize ${MEM_GB}G 75 | data-in-memory true # Store data in memory in addition to file. 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /examples/storage-engine-device/configmap/aerospike.template.conf: -------------------------------------------------------------------------------- 1 | # Aerospike database configuration file. 2 | 3 | # This stanza must come first. 4 | service { 5 | user root 6 | group root 7 | paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. 8 | pidfile /var/run/aerospike/asd.pid 9 | service-threads ${SERVICE_THREADS} 10 | proto-fd-max 15000 11 | feature-key-file ${FEATURE_KEY_FILE} 12 | } 13 | 14 | logging { 15 | 16 | # Log file must be an absolute path. 17 | file ${LOGFILE} { 18 | context any info 19 | } 20 | 21 | # Send log messages to stdout 22 | console { 23 | context any info 24 | } 25 | } 26 | 27 | 28 | network { 29 | service { 30 | address ${SERVICE_ADDRESS} 31 | port ${SERVICE_PORT} 32 | 33 | # Uncomment the following to set the `access-address` parameter to the 34 | # IP address of the Docker host. This will the allow the server to correctly 35 | # publish the address which applications and other nodes in the cluster to 36 | # use when addressing this node. 37 | # access-address 38 | } 39 | 40 | heartbeat { 41 | 42 | address ${HB_ADDRESS} 43 | # mesh is used for environments that do not support multicast 44 | mode mesh 45 | port ${HB_PORT} 46 | 47 | # use asinfo -v 'tip:host=;port=3002' to inform cluster of 48 | # other mesh nodes 49 | # mesh-seed-placeholder 50 | 51 | interval 150 52 | timeout 10 53 | } 54 | 55 | fabric { 56 | address ${FABRIC_ADDRESS} 57 | port ${FABRIC_PORT} 58 | } 59 | 60 | info { 61 | address ${INFO_ADDRESS} 62 | port ${INFO_PORT} 63 | } 64 | } 65 | 66 | namespace ${NAMESPACE} { 67 | replication-factor ${REPL_FACTOR} 68 | memory-size ${MEM_GB}G 69 | default-ttl ${DEFAULT_TTL} 70 | 71 | storage-engine device { 72 | device /dev/xvdb 73 | # (optional) another raw device. 74 | # device /dev/ 75 | write-block-size 128K 76 | # data-in-memory true # Store data in memory in addition to file. 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /helm/files/aerospike.template.conf: -------------------------------------------------------------------------------- 1 | # Aerospike database configuration file. 2 | 3 | # This stanza must come first. 4 | service { 5 | user root 6 | group root 7 | paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. 8 | pidfile /var/run/aerospike/asd.pid 9 | proto-fd-max 15000 10 | feature-key-file ${FEATURE_KEY_FILE} 11 | } 12 | 13 | logging { 14 | 15 | # Log file must be an absolute path. 16 | file ${LOGFILE} { 17 | context any info 18 | } 19 | 20 | # Send log messages to stdout 21 | console { 22 | context any info 23 | } 24 | } 25 | 26 | 27 | network { 28 | service { 29 | address ${SERVICE_ADDRESS} 30 | port ${SERVICE_PORT} 31 | 32 | # Uncomment the following to set the `access-address` parameter to the 33 | # IP address of the Docker host. This will the allow the server to correctly 34 | # publish the address which applications and other nodes in the cluster to 35 | # use when addressing this node. 36 | # access-address 37 | } 38 | 39 | heartbeat { 40 | 41 | address ${HB_ADDRESS} 42 | # mesh is used for environments that do not support multicast 43 | mode mesh 44 | port ${HB_PORT} 45 | 46 | # use asinfo -v 'tip:host=;port=3002' to inform cluster of 47 | # other mesh nodes 48 | # mesh-seed-placeholder 49 | 50 | interval 150 51 | timeout 10 52 | } 53 | 54 | fabric { 55 | address ${FABRIC_ADDRESS} 56 | port ${FABRIC_PORT} 57 | } 58 | 59 | info { 60 | address ${INFO_ADDRESS} 61 | port ${INFO_PORT} 62 | } 63 | } 64 | 65 | namespace ${NAMESPACE} { 66 | replication-factor ${REPL_FACTOR} 67 | memory-size ${MEM_GB}G 68 | default-ttl ${DEFAULT_TTL} 69 | 70 | # storage-engine memory 71 | 72 | # To use file storage backing, comment out the line above and use the 73 | # following lines instead. 74 | 75 | storage-engine device { 76 | file /opt/aerospike/data/${MY_POD_NAME}-${NAMESPACE}.dat 77 | filesize ${MEM_GB}G 78 | data-in-memory true # Store data in memory in addition to file. 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /examples/shadow-device/configmap/aerospike.template.conf: -------------------------------------------------------------------------------- 1 | # Aerospike database configuration file. 2 | 3 | # This stanza must come first. 4 | service { 5 | user root 6 | group root 7 | paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1. 8 | pidfile /var/run/aerospike/asd.pid 9 | service-threads ${SERVICE_THREADS} 10 | proto-fd-max 15000 11 | feature-key-file ${FEATURE_KEY_FILE} 12 | } 13 | 14 | logging { 15 | 16 | # Log file must be an absolute path. 17 | file ${LOGFILE} { 18 | context any info 19 | } 20 | 21 | # Send log messages to stdout 22 | console { 23 | context any info 24 | } 25 | } 26 | 27 | 28 | network { 29 | service { 30 | address ${SERVICE_ADDRESS} 31 | port ${SERVICE_PORT} 32 | 33 | # Uncomment the following to set the `access-address` parameter to the 34 | # IP address of the Docker host. This will the allow the server to correctly 35 | # publish the address which applications and other nodes in the cluster to 36 | # use when addressing this node. 37 | # access-address 38 | } 39 | 40 | heartbeat { 41 | 42 | address ${HB_ADDRESS} 43 | # mesh is used for environments that do not support multicast 44 | mode mesh 45 | port ${HB_PORT} 46 | 47 | # use asinfo -v 'tip:host=;port=3002' to inform cluster of 48 | # other mesh nodes 49 | # mesh-seed-placeholder 50 | 51 | interval 150 52 | timeout 10 53 | } 54 | 55 | fabric { 56 | address ${FABRIC_ADDRESS} 57 | port ${FABRIC_PORT} 58 | } 59 | 60 | info { 61 | address ${INFO_ADDRESS} 62 | port ${INFO_PORT} 63 | } 64 | } 65 | 66 | namespace ${NAMESPACE} { 67 | replication-factor ${REPL_FACTOR} 68 | memory-size ${MEM_GB}G 69 | default-ttl ${DEFAULT_TTL} 70 | 71 | storage-engine device { 72 | device /dev/xvdb /dev/xvdf # Shadow device configuration. 73 | # device /dev/ /dev/ # (optional) another raw device / shadow device. 74 | write-block-size 128K 75 | # data-in-memory true # Store data in memory in addition to file. 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /helm/templates/service.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # Headless service to provide DNS lookup 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | annotations: 23 | service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" 24 | name: {{ template "aerospike.fullname" . }} 25 | namespace: {{ .Release.Namespace }} 26 | labels: 27 | app: {{ template "aerospike.name" . }} 28 | chart: {{ .Chart.Name }} 29 | release: {{ .Release.Name }} 30 | spec: 31 | publishNotReadyAddresses: true 32 | ports: 33 | - port: {{ .Values.aerospikeClientPort | default 3000 }} 34 | name: aerospike-client 35 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 36 | - port: {{ .Values.exporter.agentBindPort | default 9145 }} 37 | name: aerospike-prometheus-exporter 38 | {{- end }} 39 | # *.aerospike.default.svc.cluster.local 40 | clusterIP: None 41 | selector: 42 | # Tells which pods are part of the DNS record 43 | app: {{ template "aerospike.name" . }} 44 | chart: {{ .Chart.Name }} 45 | release: {{ .Release.Name }} 46 | unique-app: {{ .Release.Name }}-aerospike 47 | {{- with .Values.labels }}{{ toYaml . | nindent 4 }}{{ end }} 48 | {{- with .Values.podLabels }}{{ toYaml . | nindent 4 }}{{ end }} 49 | --- 50 | -------------------------------------------------------------------------------- /helm/templates/nodeportservices.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if or .Values.enableNodePortServices .Values.nodePortServices.enabled }} 19 | {{- $dot := . }} 20 | {{ range $podIndex := until (int .Values.dbReplicas) -}} 21 | --- 22 | apiVersion: v1 23 | kind: Service 24 | metadata: 25 | name: "nodeport-{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 26 | namespace: {{ $.Release.Namespace }} 27 | labels: 28 | app: {{ template "aerospike.name" $dot }} 29 | chart: {{ $.Chart.Name }} 30 | release: {{ $.Release.Name }} 31 | {{- if $.Values.nodePortServices.labels }} 32 | {{- with $.Values.nodePortServices.labels }}{{ toYaml . | nindent 4 }}{{ end }} 33 | {{- end }} 34 | {{- if $.Values.nodePortServices.annotations }} 35 | {{- with $.Values.nodePortServices.annotations }} 36 | annotations: {{- toYaml . | nindent 4 }} 37 | {{- end }} 38 | {{- end }} 39 | spec: 40 | type: NodePort 41 | externalTrafficPolicy: Local 42 | ports: 43 | {{- if $.Values.aerospikeNetworkTLSConfig.service }} 44 | - name: aerospike-tls 45 | port: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 }} 46 | {{- if ne (default false $.Values.aerospikeNetworkTLSConfig.service.tlsOnly) true }} 47 | - name: aerospike-plain 48 | port: {{ $.Values.aerospikeClientPort | default 3000 }} 49 | {{- end }} 50 | {{- else }} 51 | - name: aerospike-plain 52 | port: {{ $.Values.aerospikeClientPort | default 3000 }} 53 | {{- end }} 54 | selector: 55 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 56 | {{ end -}} 57 | {{- end }} 58 | --- 59 | -------------------------------------------------------------------------------- /helm/templates/loadbalancerservices.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if or .Values.enableLoadBalancerServices .Values.loadBalancerServices.enabled }} 19 | {{- $dot := . }} 20 | {{ range $podIndex := until (int .Values.dbReplicas) -}} 21 | --- 22 | apiVersion: v1 23 | kind: Service 24 | metadata: 25 | name: "loadbalancer-{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 26 | namespace: {{ $.Release.Namespace }} 27 | labels: 28 | app: {{ template "aerospike.name" $dot }} 29 | chart: {{ $.Chart.Name }} 30 | release: {{ $.Release.Name }} 31 | {{- if $.Values.loadBalancerServices.labels }} 32 | {{- with $.Values.loadBalancerServices.labels }}{{ toYaml . | nindent 4 }}{{ end }} 33 | {{- end }} 34 | {{- if $.Values.loadBalancerServices.annotations }} 35 | {{- with $.Values.loadBalancerServices.annotations }} 36 | annotations: {{- toYaml . | nindent 4 }} 37 | {{- end }} 38 | {{- end }} 39 | spec: 40 | type: LoadBalancer 41 | externalTrafficPolicy: Local 42 | ports: 43 | {{- if $.Values.aerospikeNetworkTLSConfig.service }} 44 | - name: aerospike-tls 45 | port: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 }} 46 | targetPort: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 }} 47 | {{- if ne (default false $.Values.aerospikeNetworkTLSConfig.service.tlsOnly) true }} 48 | - name: aerospike-plain 49 | port: {{ $.Values.aerospikeClientPort | default 3000 }} 50 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 51 | {{- end }} 52 | {{- else }} 53 | - name: aerospike-plain 54 | port: {{ $.Values.aerospikeClientPort | default 3000 }} 55 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 56 | {{- end }} 57 | selector: 58 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 59 | {{ end -}} 60 | {{- end }} 61 | --- 62 | -------------------------------------------------------------------------------- /helm/templates/alertmanager-configmap.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: v1 20 | kind: ConfigMap 21 | metadata: 22 | name: {{ .Release.Name }}-alertmanager-config 23 | labels: 24 | app: {{ template "aerospike.name" . }}-alertmanager 25 | chart: {{ .Chart.Name }} 26 | release: {{ .Release.Name }} 27 | app.kubernetes.io/component: alertmanager 28 | data: 29 | # default alertmanager configuration file 30 | {{ if .Files.Get "files/alertmanager.yaml" }} 31 | alertmanager.yaml: {{ tpl (.Files.Get "files/alertmanager.yaml") . | quote }} 32 | {{ end }} 33 | 34 | {{- if and .Values.alertmanager.alertmanagerConfFilePath .Values.alertmanager.alertmanagerConfFile }} 35 | {{ fail "Both legacy(alertmanager.alertmanagerConfFilePath) and new(alertmanager.alertmanagerConfFile) are configured! Use only one!" }} 36 | {{- end }} 37 | 38 | {{- if and (or .Values.alertmanager.alertmanagerConfFilePath .Values.alertmanager.alertmanagerConfFile) (.Values.alertmanager.alertmanagerConfFileBase64) }} 39 | {{ fail "Both alertmanager.alertmanagerConfFilePath/alertmanager.alertmanagerConfFile and alertmanager.alertmanagerConfFileBase64 are configured! Use only one!" }} 40 | {{- end }} 41 | 42 | # old config for alertmanager configuration file 43 | {{ if (.Values.alertmanager.alertmanagerConfFilePath) }} 44 | alertmanager.yaml: |- 45 | {{ .Values.alertmanager.alertmanagerConfFilePath | nindent 4 | trim }} 46 | {{ end }} 47 | 48 | # new config for alertmanager configuration file 49 | {{ if (.Values.alertmanager.alertmanagerConfFile) }} 50 | alertmanager.yaml: |- 51 | {{ .Values.alertmanager.alertmanagerConfFile | nindent 4 | trim }} 52 | {{ end }} 53 | 54 | # alertmanager configuration file provided as base64 encoded string 55 | {{ if (.Values.alertmanager.alertmanagerConfFileBase64) }} 56 | alertmanager.yaml: |- 57 | {{ .Values.alertmanager.alertmanagerConfFileBase64 | b64dec | nindent 4 | trim }} 58 | {{ end }} 59 | {{- end }} 60 | -------------------------------------------------------------------------------- /helm/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | # ConfigMap for aerospike and exporter configuration files 19 | 20 | apiVersion: v1 21 | kind: ConfigMap 22 | metadata: 23 | name: {{ .Release.Name }}-conf 24 | namespace: {{ .Release.Namespace }} 25 | labels: 26 | app: {{ template "aerospike.name" . }} 27 | chart: {{ .Chart.Name }} 28 | release: {{ .Release.Name }} 29 | data: 30 | # default aerospike configuration file 31 | {{ if .Files.Get "files/aerospike.template.conf" }} 32 | aerospike.template.conf: {{ tpl (.Files.Get "files/aerospike.template.conf") . | quote }} 33 | {{ end }} 34 | 35 | {{- if and .Values.confFilePath .Values.aerospikeConfFile }} 36 | {{ fail "Both legacy(confFilePath) and new(aerospikeConfFile) are configured! Use only one!" }} 37 | {{- end }} 38 | 39 | {{- if and (or .Values.confFilePath .Values.aerospikeConfFile) (.Values.aerospikeConfFileBase64) }} 40 | {{ fail "Both confFilePath/aerospikeConfFile and aerospikeConfFileBase64 are configured! Use only one!" }} 41 | {{- end }} 42 | 43 | # old config for aerospike configuration file 44 | {{ if (.Values.confFilePath) }} 45 | aerospike.template.conf: |- 46 | {{ .Values.confFilePath | nindent 4 | trim }} 47 | {{ end }} 48 | 49 | # new config for aerospike configuration file 50 | {{ if (.Values.aerospikeConfFile) }} 51 | aerospike.template.conf: |- 52 | {{ .Values.aerospikeConfFile | nindent 4 | trim }} 53 | {{ end }} 54 | 55 | # aerospike configuration file provided as base64 encoded string 56 | {{ if (.Values.aerospikeConfFileBase64) }} 57 | aerospike.template.conf: |- 58 | {{ .Values.aerospikeConfFileBase64 | b64dec | nindent 4 | trim }} 59 | {{ end }} 60 | 61 | # Add aerospike-prometheus-exporter config template to config if monitoring is enabled and if the file is available 62 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 63 | {{ if .Files.Get "files/ape.toml.template" }} 64 | ape.toml.template: {{ tpl (.Files.Get "files/ape.toml.template") . | quote }} 65 | {{ end }} 66 | {{- end }} 67 | --- 68 | -------------------------------------------------------------------------------- /helm/files/ape.toml.template: -------------------------------------------------------------------------------- 1 | [Agent] 2 | # File paths should be double quoted. 3 | # Certificate file for the metric servers for prometheus 4 | cert_file = "${AGENT_CERT_FILE}" 5 | 6 | # Key file for the metric servers for prometheus 7 | key_file = "${AGENT_KEY_FILE}" 8 | 9 | # labels to add to the prometheus metrics for e.g. labels={zone="asia-south1-a", platform="google compute engine"} 10 | labels = {${METRIC_LABELS}} 11 | 12 | bind = "${AGENT_BIND_HOST}:${AGENT_BIND_PORT}" 13 | 14 | # metrics server timeout in seconds 15 | timeout = ${AGENT_TIMEOUT} 16 | 17 | # Exporter logging configuration 18 | # Log file path (optional, logs to console by default) 19 | # Level can be info|warning,warn|error,err|debug|trace ('info' by default) 20 | log_file = "${AGENT_LOG_FILE}" 21 | log_level = "${AGENT_LOG_LEVEL}" 22 | 23 | # Basic HTTP authentication for '/metrics'. 24 | basic_auth_username="${BASIC_AUTH_USERNAME}" 25 | basic_auth_password="${BASIC_AUTH_PASSWORD}" 26 | 27 | [Aerospike] 28 | db_host="${AS_HOST}" 29 | db_port=${AS_PORT} 30 | 31 | # certificate file 32 | cert_file="${AS_CERT_FILE}" 33 | 34 | # key file 35 | key_file="${AS_KEY_FILE}" 36 | 37 | # Passphrase for encrypted key_file. Supports below formats, 38 | # 1. Passphrase directly - "" 39 | # 2. Passphrase via file - "file:" 40 | # 3. Passphrase via environment variable - "env:" 41 | key_file_passphrase="${AS_KEY_FILE_PASSPHRASE}" 42 | 43 | # node TLS name for authentication 44 | node_tls_name="${AS_NODE_TLS_NAME}" 45 | 46 | # root certificate file 47 | root_ca="${AS_ROOT_CA}" 48 | 49 | # authentication mode: internal (for server), external (LDAP, etc.) 50 | auth_mode="${AS_AUTH_MODE}" 51 | 52 | # database user 53 | user="${AS_AUTH_USER}" 54 | 55 | # database password 56 | password="${AS_AUTH_PASSWORD}" 57 | 58 | # timeout for sending commands to the server node in seconds 59 | timeout=${TICKER_TIMEOUT} 60 | 61 | # Metrics Allowlist - If specified, only these metrics will be scraped. An empty list will exclude all metrics. 62 | # Commenting out the below allowlist configs will disable metrics filtering (i.e. all metrics will be scraped). 63 | 64 | # Namespace metrics allowlist 65 | # namespace_metrics_allowlist=[${NAMESPACE_METRICS_ALLOWLIST}] 66 | 67 | # Set metrics allowlist 68 | # set_metrics_allowlist=[${SET_METRICS_ALLOWLIST}] 69 | 70 | # Node metrics allowlist 71 | # node_metrics_allowlist=[${NODE_METRICS_ALLOWLIST}] 72 | 73 | # XDR metrics allowlist (only for Aerospike versions 5.0 and above) 74 | # xdr_metrics_allowlist=[${XDR_METRICS_ALLOWLIST}] 75 | 76 | # Metrics Blocklist - If specified, these metrics will be NOT be scraped. 77 | 78 | # Namespace metrics blocklist 79 | # namespace_metrics_blocklist=[${NAMESPACE_METRICS_BLOCKLIST}] 80 | 81 | # Set metrics blocklist 82 | # set_metrics_blocklist=[${SET_METRICS_BLOCKLIST}] 83 | 84 | # Node metrics blocklist 85 | # node_metrics_blocklist=[${NODE_METRICS_BLOCKLIST}] 86 | 87 | # XDR metrics blocklist (only for Aerospike versions 5.0 and above) 88 | # xdr_metrics_blocklist=[${XDR_METRICS_BLOCKLIST}] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aerospike-kubernetes-enterprise 2 | 3 | This project contains the init container used in Kubernetes (k8s) and the Aerospike StatefulSet definition. 4 | This manifest will allow you to deploy a fully formed Aerospike cluster in minutes. 5 | 6 | This project uses: 7 | 8 | - [aerospike-server-enterprise docker image](https://hub.docker.com/r/aerospike/aerospike-server-enterprise) 9 | - [aerospike-kubernetes-init docker image](https://hub.docker.com/r/aerospike/aerospike-kubernetes-init) 10 | 11 | ## Usage: 12 | 13 | ### Configure: 14 | 15 | Set environment variables (modify if necessary): 16 | 17 | ```sh 18 | export APP_NAME=aerospike 19 | export NAMESPACE=default 20 | export AEROSPIKE_NODES=3 21 | export AEROSPIKE_NAMESPACE=test 22 | export AEROSPIKE_REPL=2 23 | export AEROSPIKE_MEM=1 24 | export AEROSPIKE_TTL=0 25 | export AEROSPIKE_FEATURE_KEY_FILE=/etc/aerospike/features.conf 26 | export AEROSPIKE_NSUP_PERIOD=0 # if AEROSPIKE_TTL is not 0, AEROSPIKE_NSUP_PERIOD should not be 0. 27 | ``` 28 | 29 | All `AEROSPIKE_*` parameters except AEROSPIKE\_NODES, AEROSPIKE_MEM are optional. Default values are listed above. 30 | All other parameters are required. 31 | 32 | **NOTE:** Feature key file is mandatory for running aerospike server enterprise edition. 33 | 34 | 35 | ### Configuring Storage: 36 | 37 | The [statefulset definition](manifests/statefulset.yaml) refers to a custom StorageClass `ssd`. 38 | You can find the storageclass `ssd` definition in [storageclass-aws.yaml](manifests/storageclass-aws.yaml) or [storageclass-gcp.yaml](manifests/storageclass-gcp.yaml) (Uncomment them to use). You can also define your own storageclass and use it within the statefulset definition. 39 | 40 | > 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/`](examples/) for using a local volume static provisioner. 41 | 42 | 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. 43 | 44 | ``` 45 | volumeClaimTemplates: 46 | - metadata: 47 | name: data-dev 48 | labels: *AerospikeDeploymentLabels 49 | spec: 50 | volumeMode: Block 51 | accessModes: 52 | - ReadWriteOnce 53 | storageClassName: ssd 54 | resources: 55 | requests: 56 | storage: ${AEROSPIKE_MEM}Gi 57 | ``` 58 | ``` 59 | ..... 60 | volumeMounts: 61 | - name: confdir 62 | mountPath: /etc/aerospike 63 | volumeDevices: 64 | - name: data-dev 65 | devicePath: /dev/sdb 66 | ..... 67 | ``` 68 | 69 | 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`. 70 | 71 | ### Apply feature-key-file: 72 | 73 | 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. 74 | 75 | 76 | ### Examples: 77 | 78 | To view and run the examples, go to [`examples/`](examples/) 79 | 80 | ### Deployment: 81 | 82 | Please follow the below steps or run `start.sh` script: 83 | 84 | 1. Expand manifest template: 85 | 86 | ```sh 87 | cat manifests/* | envsubst > expanded.yaml 88 | ``` 89 | 90 | 2. Create the configmap object: 91 | 92 | ```sh 93 | kubectl create configmap aerospike-conf -n $NAMESPACE --from-file=configs/ 94 | ``` 95 | 96 | 3. Deploy: 97 | 98 | ```sh 99 | kubectl create -f expanded.yaml 100 | ``` 101 | 102 | ### Helm Charts 103 | 104 | Helm chart for the same can be found [here](helm/) 105 | 106 | ## Requirements 107 | 108 | * Kubernetes 1.8+ 109 | * Kubernetes DNS add-in 110 | -------------------------------------------------------------------------------- /examples/shadow-device/aerospike-local-volume-provisioner.yaml: -------------------------------------------------------------------------------- 1 | # Provisioner ConfigMap 2 | # 3 | apiVersion: v1 4 | kind: ConfigMap 5 | metadata: 6 | name: local-provisioner-config 7 | namespace: dev 8 | labels: 9 | heritage: "Tiller" 10 | release: "RELEASE-NAME" 11 | chart: provisioner-2.3.3 12 | data: 13 | useNodeNameOnly: "true" 14 | storageClassMap: | 15 | aerospike-ssds: 16 | hostDir: /mnt/disks 17 | mountDir: /mnt/disks 18 | blockCleanerCommand: 19 | - "/scripts/shred.sh" 20 | - "2" 21 | volumeMode: Block 22 | --- 23 | 24 | # Daemonset 25 | # Local volume Provisioner 26 | apiVersion: apps/v1 27 | kind: DaemonSet 28 | metadata: 29 | name: local-volume-provisioner 30 | namespace: dev 31 | labels: 32 | app: local-volume-provisioner 33 | heritage: "Tiller" 34 | release: "RELEASE-NAME" 35 | chart: provisioner-2.3.3 36 | spec: 37 | selector: 38 | matchLabels: 39 | app: local-volume-provisioner 40 | template: 41 | metadata: 42 | labels: 43 | app: local-volume-provisioner 44 | spec: 45 | serviceAccountName: local-storage-admin 46 | containers: 47 | - image: "quay.io/external_storage/local-volume-provisioner:v2.3.3" 48 | name: provisioner 49 | securityContext: 50 | privileged: true 51 | env: 52 | - name: MY_NODE_NAME 53 | valueFrom: 54 | fieldRef: 55 | fieldPath: spec.nodeName 56 | - name: MY_NAMESPACE 57 | valueFrom: 58 | fieldRef: 59 | fieldPath: metadata.namespace 60 | - name: JOB_CONTAINER_IMAGE 61 | value: "quay.io/external_storage/local-volume-provisioner:v2.3.3" 62 | volumeMounts: 63 | - mountPath: /etc/provisioner/config 64 | name: provisioner-config 65 | readOnly: true 66 | - mountPath: /mnt/disks 67 | name: aerospike-ssds 68 | mountPropagation: "HostToContainer" 69 | volumes: 70 | - name: provisioner-config 71 | configMap: 72 | name: local-provisioner-config 73 | - name: aerospike-ssds 74 | hostPath: 75 | path: /mnt/disks 76 | --- 77 | 78 | # Storage Class 'aerospike-ssds' 79 | # 80 | apiVersion: storage.k8s.io/v1 81 | kind: StorageClass 82 | metadata: 83 | name: aerospike-ssds 84 | labels: 85 | heritage: "Tiller" 86 | release: "RELEASE-NAME" 87 | chart: provisioner-2.3.3 88 | provisioner: kubernetes.io/no-provisioner 89 | volumeBindingMode: WaitForFirstConsumer 90 | reclaimPolicy: Delete 91 | 92 | --- 93 | 94 | # Provisioner Service Account 95 | # 96 | apiVersion: v1 97 | kind: ServiceAccount 98 | metadata: 99 | name: local-storage-admin 100 | namespace: dev 101 | labels: 102 | heritage: "Tiller" 103 | release: "RELEASE-NAME" 104 | chart: provisioner-2.3.3 105 | 106 | --- 107 | 108 | # Provisioner Cluster Role Binding 109 | # 110 | apiVersion: rbac.authorization.k8s.io/v1 111 | kind: ClusterRoleBinding 112 | metadata: 113 | name: local-storage-provisioner-pv-binding 114 | labels: 115 | heritage: "Tiller" 116 | release: "RELEASE-NAME" 117 | chart: provisioner-2.3.3 118 | subjects: 119 | - kind: ServiceAccount 120 | name: local-storage-admin 121 | namespace: dev 122 | roleRef: 123 | kind: ClusterRole 124 | name: system:persistent-volume-provisioner 125 | apiGroup: rbac.authorization.k8s.io 126 | --- 127 | 128 | apiVersion: rbac.authorization.k8s.io/v1 129 | kind: ClusterRole 130 | metadata: 131 | name: local-storage-provisioner-node-clusterrole 132 | labels: 133 | heritage: "Tiller" 134 | release: "RELEASE-NAME" 135 | chart: provisioner-2.3.3 136 | rules: 137 | - apiGroups: [""] 138 | resources: ["nodes"] 139 | verbs: ["get"] 140 | --- 141 | 142 | apiVersion: rbac.authorization.k8s.io/v1 143 | kind: ClusterRoleBinding 144 | metadata: 145 | name: local-storage-provisioner-node-binding 146 | labels: 147 | heritage: "Tiller" 148 | release: "RELEASE-NAME" 149 | chart: provisioner-2.3.3 150 | subjects: 151 | - kind: ServiceAccount 152 | name: local-storage-admin 153 | namespace: dev 154 | roleRef: 155 | kind: ClusterRole 156 | name: local-storage-provisioner-node-clusterrole 157 | apiGroup: rbac.authorization.k8s.io 158 | --- 159 | -------------------------------------------------------------------------------- /examples/storage-engine-device/aerospike-local-volume-provisioner.yaml: -------------------------------------------------------------------------------- 1 | # Provisioner ConfigMap 2 | # 3 | apiVersion: v1 4 | kind: ConfigMap 5 | metadata: 6 | name: local-provisioner-config 7 | namespace: dev 8 | labels: 9 | heritage: "Tiller" 10 | release: "RELEASE-NAME" 11 | chart: provisioner-2.3.3 12 | data: 13 | useNodeNameOnly: "true" 14 | storageClassMap: | 15 | aerospike-ssds: 16 | hostDir: /mnt/disks 17 | mountDir: /mnt/disks 18 | blockCleanerCommand: 19 | - "/scripts/shred.sh" 20 | - "2" 21 | volumeMode: Block 22 | --- 23 | 24 | # Daemonset 25 | # Local volume Provisioner 26 | apiVersion: apps/v1 27 | kind: DaemonSet 28 | metadata: 29 | name: local-volume-provisioner 30 | namespace: dev 31 | labels: 32 | app: local-volume-provisioner 33 | heritage: "Tiller" 34 | release: "RELEASE-NAME" 35 | chart: provisioner-2.3.3 36 | spec: 37 | selector: 38 | matchLabels: 39 | app: local-volume-provisioner 40 | template: 41 | metadata: 42 | labels: 43 | app: local-volume-provisioner 44 | spec: 45 | serviceAccountName: local-storage-admin 46 | containers: 47 | - image: "quay.io/external_storage/local-volume-provisioner:v2.3.3" 48 | name: provisioner 49 | securityContext: 50 | privileged: true 51 | env: 52 | - name: MY_NODE_NAME 53 | valueFrom: 54 | fieldRef: 55 | fieldPath: spec.nodeName 56 | - name: MY_NAMESPACE 57 | valueFrom: 58 | fieldRef: 59 | fieldPath: metadata.namespace 60 | - name: JOB_CONTAINER_IMAGE 61 | value: "quay.io/external_storage/local-volume-provisioner:v2.3.3" 62 | volumeMounts: 63 | - mountPath: /etc/provisioner/config 64 | name: provisioner-config 65 | readOnly: true 66 | - mountPath: /mnt/disks 67 | name: aerospike-ssds 68 | mountPropagation: "HostToContainer" 69 | volumes: 70 | - name: provisioner-config 71 | configMap: 72 | name: local-provisioner-config 73 | - name: aerospike-ssds 74 | hostPath: 75 | path: /mnt/disks 76 | --- 77 | 78 | # Storage Class 'aerospike-ssds' 79 | # 80 | apiVersion: storage.k8s.io/v1 81 | kind: StorageClass 82 | metadata: 83 | name: aerospike-ssds 84 | labels: 85 | heritage: "Tiller" 86 | release: "RELEASE-NAME" 87 | chart: provisioner-2.3.3 88 | provisioner: kubernetes.io/no-provisioner 89 | volumeBindingMode: WaitForFirstConsumer 90 | reclaimPolicy: Delete 91 | 92 | --- 93 | 94 | # Provisioner Service Account 95 | # 96 | apiVersion: v1 97 | kind: ServiceAccount 98 | metadata: 99 | name: local-storage-admin 100 | namespace: dev 101 | labels: 102 | heritage: "Tiller" 103 | release: "RELEASE-NAME" 104 | chart: provisioner-2.3.3 105 | 106 | --- 107 | 108 | # Provisioner Cluster Role Binding 109 | # 110 | apiVersion: rbac.authorization.k8s.io/v1 111 | kind: ClusterRoleBinding 112 | metadata: 113 | name: local-storage-provisioner-pv-binding 114 | labels: 115 | heritage: "Tiller" 116 | release: "RELEASE-NAME" 117 | chart: provisioner-2.3.3 118 | subjects: 119 | - kind: ServiceAccount 120 | name: local-storage-admin 121 | namespace: dev 122 | roleRef: 123 | kind: ClusterRole 124 | name: system:persistent-volume-provisioner 125 | apiGroup: rbac.authorization.k8s.io 126 | --- 127 | 128 | apiVersion: rbac.authorization.k8s.io/v1 129 | kind: ClusterRole 130 | metadata: 131 | name: local-storage-provisioner-node-clusterrole 132 | labels: 133 | heritage: "Tiller" 134 | release: "RELEASE-NAME" 135 | chart: provisioner-2.3.3 136 | rules: 137 | - apiGroups: [""] 138 | resources: ["nodes"] 139 | verbs: ["get"] 140 | --- 141 | 142 | apiVersion: rbac.authorization.k8s.io/v1 143 | kind: ClusterRoleBinding 144 | metadata: 145 | name: local-storage-provisioner-node-binding 146 | labels: 147 | heritage: "Tiller" 148 | release: "RELEASE-NAME" 149 | chart: provisioner-2.3.3 150 | subjects: 151 | - kind: ServiceAccount 152 | name: local-storage-admin 153 | namespace: dev 154 | roleRef: 155 | kind: ClusterRole 156 | name: local-storage-provisioner-node-clusterrole 157 | apiGroup: rbac.authorization.k8s.io 158 | --- 159 | -------------------------------------------------------------------------------- /helm/templates/prometheus-configmap.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: v1 20 | kind: ConfigMap 21 | metadata: 22 | name: {{ .Release.Name }}-prometheus-config 23 | namespace: {{ .Release.Namespace }} 24 | labels: 25 | app: {{ template "aerospike.name" . }}-prometheus 26 | chart: {{ .Chart.Name }} 27 | release: {{ .Release.Name }} 28 | app.kubernetes.io/component: prometheus 29 | data: 30 | prometheus.yaml: |- 31 | global: 32 | scrape_interval: {{ .Values.prometheus.scrapeInterval | default "15s" | quote }} 33 | evaluation_interval: {{ .Values.prometheus.evaluationInterval | default "15s" | quote }} 34 | 35 | alerting: 36 | alertmanagers: 37 | - scheme: http 38 | static_configs: 39 | - targets: 40 | - "{{ .Release.Name }}-alertmanager:{{ .Values.alertmanager.webPort | default 9093 }}" 41 | 42 | rule_files: 43 | - "/etc/prometheus/aerospike_rules.yaml" 44 | 45 | scrape_configs: 46 | - job_name: 'aerospike' 47 | 48 | {{- if .Values.exporter.httpBasicAuthUsername }} 49 | basic_auth: 50 | username: {{ .Values.exporter.httpBasicAuthUsername }} 51 | password: {{ .Values.exporter.httpBasicAuthPassword }} 52 | {{- end }} 53 | 54 | kubernetes_sd_configs: 55 | - role: endpoints 56 | namespaces: 57 | names: 58 | - {{ .Release.Namespace }} 59 | relabel_configs: 60 | - source_labels: [__meta_kubernetes_service_label_app] 61 | separator: ; 62 | regex: {{ template "aerospike.name" . }} 63 | replacement: $1 64 | action: keep 65 | - source_labels: [__meta_kubernetes_endpoint_port_name] 66 | separator: ; 67 | regex: aerospike-prometheus-exporter 68 | replacement: $1 69 | action: keep 70 | - source_labels: [__meta_kubernetes_namespace] 71 | separator: ; 72 | regex: {{ .Release.Namespace }} 73 | target_label: namespace 74 | replacement: $1 75 | action: replace 76 | 77 | # default aerospike alert rules file 78 | {{ if .Files.Get "files/aerospike_rules.yaml" }} 79 | aerospike_rules.yaml: {{ tpl (.Files.Get "files/aerospike_rules.yaml") . | quote }} 80 | {{ end }} 81 | 82 | {{- if and .Values.prometheus.aerospikeAlertRulesFilePath .Values.prometheus.aerospikeAlertRulesFile }} 83 | {{ fail "Both legacy(prometheus.aerospikeAlertRulesFilePath) and new(prometheus.aerospikeAlertRulesFile) are configured! Use only one!" }} 84 | {{- end }} 85 | 86 | {{- if and (or .Values.prometheus.aerospikeAlertRulesFilePath .Values.prometheus.aerospikeAlertRulesFile) (.Values.prometheus.aerospikeAlertRulesFileBase64) }} 87 | {{ fail "Both prometheus.aerospikeAlertRulesFilePath/prometheus.aerospikeAlertRulesFile and prometheus.aerospikeAlertRulesFileBase64 are configured! Use only one!" }} 88 | {{- end }} 89 | 90 | # old config for aerospike alert rules file 91 | {{ if (.Values.prometheus.aerospikeAlertRulesFilePath) }} 92 | aerospike_rules.yaml: |- 93 | {{ .Values.prometheus.aerospikeAlertRulesFilePath | nindent 4 | trim }} 94 | {{ end }} 95 | 96 | # new config for aerospike alert rules file 97 | {{ if (.Values.prometheus.aerospikeAlertRulesFile) }} 98 | aerospike_rules.yaml: |- 99 | {{ .Values.prometheus.aerospikeAlertRulesFile | nindent 4 | trim }} 100 | {{ end }} 101 | 102 | # aerospike alert rules file provided as base64 encoded string 103 | {{ if (.Values.prometheus.aerospikeAlertRulesFileBase64) }} 104 | aerospike_rules.yaml: |- 105 | {{ .Values.prometheus.aerospikeAlertRulesFileBase64 | b64dec | nindent 4 | trim }} 106 | {{ end }} 107 | {{- end }} 108 | -------------------------------------------------------------------------------- /manifests/statefulset.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | apiVersion: apps/v1 19 | kind: StatefulSet 20 | metadata: 21 | name: aerospike 22 | namespace: $NAMESPACE 23 | labels: &AerospikeDeploymentLabels 24 | app: $APP_NAME 25 | spec: 26 | serviceName: aerospike 27 | selector: 28 | matchLabels: 29 | app: $APP_NAME 30 | replicas: $AEROSPIKE_NODES 31 | template: 32 | metadata: 33 | labels: *AerospikeDeploymentLabels 34 | spec: 35 | terminationGracePeriodSeconds: 30 36 | containers: 37 | - name: aerospike 38 | image: aerospike/aerospike-server-enterprise 39 | ports: 40 | - containerPort: 3000 41 | name: aero-clients 42 | - containerPort: 3002 43 | name: aero-mesh 44 | - containerPort: 3003 45 | name: aero-info 46 | # Do not stop node before migrations are complete 47 | lifecycle: 48 | preStop: 49 | exec: 50 | command: 51 | - /bin/sh 52 | - -c 53 | - "while true; do finished=0; for part in $( asadm --no-config-file -e 'asinfo -v statistics -l' | grep migrate_partitions_remaining | cut -d= -f2); do if [ $part != 0 ]; then finished=0; break; fi; finished=1; done; if [ $finished != 1 ]; then sleep 15; else exit 0; fi; done" 54 | livenessProbe: 55 | exec: 56 | command: 57 | - /bin/sh 58 | - -c 59 | - "asinfo -v build" 60 | initialDelaySeconds: 30 61 | periodSeconds: 60 62 | readinessProbe: 63 | tcpSocket: 64 | port: 3000 65 | initialDelaySeconds: 10 66 | timeoutSeconds: 1 67 | periodSeconds: 10 68 | volumeMounts: 69 | - name: confdir 70 | mountPath: /etc/aerospike 71 | - name: datadir 72 | mountPath: /opt/aerospike/data 73 | env: 74 | - name: NAMESPACE 75 | value: "$AEROSPIKE_NAMESPACE" 76 | - name: REPL_FACTOR 77 | value: "$AEROSPIKE_REPL" 78 | - name: MEM_GB 79 | value: "$AEROSPIKE_MEM" 80 | - name: DEFAULT_TTL 81 | value: "$AEROSPIKE_TTL" 82 | - name: FEATURE_KEY_FILE 83 | value: "$AEROSPIKE_FEATURE_KEY_FILE" 84 | - name: NSUP_PERIOD 85 | value: "$AEROSPIKE_NSUP_PERIOD" 86 | # Downward API: 87 | - name: MY_POD_NAME 88 | valueFrom: 89 | fieldRef: 90 | fieldPath: metadata.name 91 | - name: MY_POD_NAMESPACE 92 | valueFrom: 93 | fieldRef: 94 | fieldPath: metadata.namespace 95 | - name: MY_POD_IP 96 | valueFrom: 97 | fieldRef: 98 | fieldPath: status.podIP 99 | initContainers: 100 | - name: aerospike-init 101 | image: aerospike/aerospike-kubernetes-init:1.1.0 102 | volumeMounts: 103 | - name: confdir 104 | mountPath: /etc/aerospike 105 | - name: initconfigs 106 | mountPath: /configs 107 | env: # Variables needed by peer-finder for discovery 108 | - name: POD_NAMESPACE 109 | valueFrom: 110 | fieldRef: 111 | fieldPath: metadata.namespace 112 | - name: SERVICE 113 | value: aerospike 114 | volumes: 115 | - name: confdir 116 | emptyDir: {} 117 | - name: initconfigs 118 | configMap: 119 | name: aerospike-conf 120 | volumeClaimTemplates: 121 | - metadata: 122 | name: datadir 123 | labels: *AerospikeDeploymentLabels 124 | spec: 125 | accessModes: 126 | - ReadWriteOnce 127 | storageClassName: ssd 128 | resources: 129 | requests: 130 | storage: ${AEROSPIKE_MEM}Gi 131 | --- 132 | -------------------------------------------------------------------------------- /examples/storage-engine-device/statefulset-raw-device.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | apiVersion: apps/v1 19 | kind: StatefulSet 20 | metadata: 21 | name: aerospike 22 | namespace: dev 23 | labels: &AerospikeDeploymentLabels 24 | app: aerospike-test 25 | spec: 26 | serviceName: aerospike 27 | selector: 28 | matchLabels: 29 | app: aerospike-test 30 | replicas: $AEROSPIKE_NODES 31 | template: 32 | metadata: 33 | labels: *AerospikeDeploymentLabels 34 | spec: 35 | terminationGracePeriodSeconds: 30 36 | containers: 37 | - name: aerospike 38 | image: aerospike/aerospike-server-enterprise 39 | ports: 40 | - containerPort: 3000 41 | name: aero-clients 42 | - containerPort: 3002 43 | name: aero-mesh 44 | - containerPort: 3003 45 | name: aero-info 46 | # Do not stop node before migrations are complete 47 | lifecycle: 48 | preStop: 49 | exec: 50 | command: 51 | - /bin/sh 52 | - -c 53 | - "while true; do finished=0; for part in $( asadm --no-config-file -e 'asinfo -v statistics -l' | grep migrate_partitions_remaining | cut -d= -f2); do if [ $part != 0 ]; then finished=0; break; fi; finished=1; done; if [ $finished != 1 ]; then sleep 15; else exit 0; fi; done" 54 | livenessProbe: 55 | exec: 56 | command: 57 | - /bin/sh 58 | - -c 59 | - "asinfo -v build" 60 | initialDelaySeconds: 30 61 | periodSeconds: 60 62 | readinessProbe: 63 | tcpSocket: 64 | port: 3000 65 | initialDelaySeconds: 10 66 | timeoutSeconds: 1 67 | periodSeconds: 10 68 | volumeMounts: 69 | - name: confdir 70 | mountPath: /etc/aerospike 71 | volumeDevices: 72 | - name: data-dev 73 | devicePath: /dev/xvdb 74 | env: 75 | - name: NAMESPACE 76 | value: "$AEROSPIKE_NAMESPACE" 77 | - name: REPL_FACTOR 78 | value: "$AEROSPIKE_REPL" 79 | - name: MEM_GB 80 | value: "$AEROSPIKE_MEM" 81 | - name: DEFAULT_TTL 82 | value: "$AEROSPIKE_TTL" 83 | - name: FEATURE_KEY_FILE 84 | value: "$AEROSPIKE_FEATURE_KEY_FILE" 85 | # Downward API: 86 | - name: MY_POD_NAME 87 | valueFrom: 88 | fieldRef: 89 | fieldPath: metadata.name 90 | - name: MY_POD_NAMESPACE 91 | valueFrom: 92 | fieldRef: 93 | fieldPath: metadata.namespace 94 | - name: MY_POD_IP 95 | valueFrom: 96 | fieldRef: 97 | fieldPath: status.podIP 98 | initContainers: 99 | - name: aerospike-init 100 | image: aerospike/aerospike-kubernetes-init:1.1.0 101 | volumeMounts: 102 | - name: confdir 103 | mountPath: /etc/aerospike 104 | - name: initconfigs 105 | mountPath: /configs 106 | env: # Variables needed by peer-finder for discovery 107 | - name: POD_NAMESPACE 108 | valueFrom: 109 | fieldRef: 110 | fieldPath: metadata.namespace 111 | - name: SERVICE 112 | value: aerospike 113 | volumes: 114 | - name: confdir 115 | emptyDir: {} 116 | - name: initconfigs 117 | configMap: 118 | name: aerospike-conf 119 | volumeClaimTemplates: 120 | - metadata: 121 | name: data-dev 122 | labels: *AerospikeDeploymentLabels 123 | spec: 124 | volumeMode: Block 125 | accessModes: 126 | - ReadWriteOnce 127 | storageClassName: aerospike-ssds 128 | resources: 129 | requests: 130 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 131 | --- 132 | -------------------------------------------------------------------------------- /examples/shadow-device/statefulset-shadow-device.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2019 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | apiVersion: apps/v1 19 | kind: StatefulSet 20 | metadata: 21 | name: aerospike 22 | namespace: dev 23 | labels: &AerospikeDeploymentLabels 24 | app: aerospike-test 25 | spec: 26 | serviceName: aerospike 27 | selector: 28 | matchLabels: 29 | app: aerospike-test 30 | replicas: $AEROSPIKE_NODES 31 | template: 32 | metadata: 33 | labels: *AerospikeDeploymentLabels 34 | spec: 35 | terminationGracePeriodSeconds: 30 36 | containers: 37 | - name: aerospike 38 | image: aerospike/aerospike-server-enterprise 39 | ports: 40 | - containerPort: 3000 41 | name: aero-clients 42 | - containerPort: 3002 43 | name: aero-mesh 44 | - containerPort: 3003 45 | name: aero-info 46 | # Do not stop node before migrations are complete 47 | lifecycle: 48 | preStop: 49 | exec: 50 | command: 51 | - /bin/sh 52 | - -c 53 | - "while true; do finished=0; for part in $( asadm --no-config-file -e 'asinfo -v statistics -l' | grep migrate_partitions_remaining | cut -d= -f2); do if [ $part != 0 ]; then finished=0; break; fi; finished=1; done; if [ $finished != 1 ]; then sleep 15; else exit 0; fi; done" 54 | livenessProbe: 55 | exec: 56 | command: 57 | - /bin/sh 58 | - -c 59 | - "asinfo -v build" 60 | initialDelaySeconds: 30 61 | periodSeconds: 60 62 | readinessProbe: 63 | tcpSocket: 64 | port: 3000 65 | initialDelaySeconds: 10 66 | timeoutSeconds: 1 67 | periodSeconds: 10 68 | volumeMounts: 69 | - name: confdir 70 | mountPath: /etc/aerospike 71 | volumeDevices: 72 | - name: data-dev 73 | devicePath: /dev/xvdb 74 | - name: shadow-dev 75 | devicePath: /dev/xvdf 76 | env: 77 | - name: NAMESPACE 78 | value: "$AEROSPIKE_NAMESPACE" 79 | - name: REPL_FACTOR 80 | value: "$AEROSPIKE_REPL" 81 | - name: MEM_GB 82 | value: "$AEROSPIKE_MEM" 83 | - name: DEFAULT_TTL 84 | value: "$AEROSPIKE_TTL" 85 | - name: FEATURE_KEY_FILE 86 | value: "$AEROSPIKE_FEATURE_KEY_FILE" 87 | # Downward API: 88 | - name: MY_POD_NAME 89 | valueFrom: 90 | fieldRef: 91 | fieldPath: metadata.name 92 | - name: MY_POD_NAMESPACE 93 | valueFrom: 94 | fieldRef: 95 | fieldPath: metadata.namespace 96 | - name: MY_POD_IP 97 | valueFrom: 98 | fieldRef: 99 | fieldPath: status.podIP 100 | initContainers: 101 | - name: aerospike-init 102 | image: aerospike/aerospike-kubernetes-init:1.1.0 103 | volumeMounts: 104 | - name: confdir 105 | mountPath: /etc/aerospike 106 | - name: initconfigs 107 | mountPath: /configs 108 | env: # Variables needed by peer-finder for discovery 109 | - name: POD_NAMESPACE 110 | valueFrom: 111 | fieldRef: 112 | fieldPath: metadata.namespace 113 | - name: SERVICE 114 | value: aerospike 115 | volumes: 116 | - name: confdir 117 | emptyDir: {} 118 | - name: initconfigs 119 | configMap: 120 | name: aerospike-conf 121 | volumeClaimTemplates: 122 | - metadata: 123 | name: data-dev 124 | labels: *AerospikeDeploymentLabels 125 | spec: 126 | volumeMode: Block 127 | accessModes: 128 | - ReadWriteOnce 129 | storageClassName: aerospike-ssds 130 | resources: 131 | requests: 132 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 133 | - metadata: 134 | name: shadow-dev 135 | labels: *AerospikeDeploymentLabels 136 | spec: 137 | volumeMode: Block 138 | accessModes: 139 | - ReadWriteOnce 140 | storageClassName: shadow 141 | resources: 142 | requests: 143 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 144 | --- 145 | -------------------------------------------------------------------------------- /helm/templates/externalipservices.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if and .Values.enableExternalIpServices .Values.externalIPServices.enabled }} 19 | {{ fail "Both legacy(enableExternalIpServices) and new(externalIPServices) are enabled! Use only one!" }} 20 | {{- end }} 21 | 22 | {{- if .Values.enableExternalIpServices }} 23 | {{ $length := 0 }} 24 | {{- if .Values.externalIpEndpoints }} 25 | {{ $length = len .Values.externalIpEndpoints }} 26 | {{- end }} 27 | {{ if lt $length (int .Values.dbReplicas) }} 28 | {{ fail "Number of externalIpEndpoints should be equal to or more than dbReplicas" }} 29 | {{ end }} 30 | {{- $dot := . }} 31 | {{ range $podIndex := until (int .Values.dbReplicas) -}} 32 | --- 33 | apiVersion: v1 34 | kind: Service 35 | metadata: 36 | name: "extip-{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 37 | namespace: {{ $.Release.Namespace }} 38 | labels: 39 | app: {{ template "aerospike.name" $dot }} 40 | chart: {{ $.Chart.Name }} 41 | release: {{ $.Release.Name }} 42 | spec: 43 | externalIPs: 44 | - {{ $ip := index $.Values.externalIpEndpoints $podIndex }} {{ $ip.IP }} 45 | ports: 46 | {{- if $.Values.aerospikeNetworkTLSConfig.service }} 47 | - port: {{ $ip := index $.Values.externalIpEndpoints $podIndex }} {{ $ip.TLSPort }} 48 | targetPort: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 }} 49 | protocol: TCP 50 | name: aerospike-tls 51 | {{- if ne (default false $.Values.aerospikeNetworkTLSConfig.service.tlsOnly) true }} 52 | - port: {{ $ip := index $.Values.externalIpEndpoints $podIndex }} {{ $ip.Port }} 53 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 54 | protocol: TCP 55 | name: aerospike-plain 56 | {{- end }} 57 | {{- else }} 58 | - port: {{ $ip := index $.Values.externalIpEndpoints $podIndex }} {{ $ip.Port }} 59 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 60 | protocol: TCP 61 | name: aerospike-plain 62 | {{- end }} 63 | selector: 64 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 65 | {{ end -}} 66 | {{- end }} 67 | 68 | {{- if .Values.externalIPServices.enabled }} 69 | {{ $length := 0 }} 70 | {{- if .Values.externalIPServices.externalIPEndpoints }} 71 | {{ $length = len .Values.externalIPServices.externalIPEndpoints }} 72 | {{- end }} 73 | {{ if lt $length (int .Values.dbReplicas) }} 74 | {{ fail "Number of externalIPServices.externalIPEndpoints should be equal to or more than dbReplicas" }} 75 | {{ end }} 76 | {{- $dot := . }} 77 | {{ range $podIndex := until (int .Values.dbReplicas) -}} 78 | --- 79 | apiVersion: v1 80 | kind: Service 81 | metadata: 82 | name: "extip-{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 83 | namespace: {{ $.Release.Namespace }} 84 | labels: 85 | app: {{ template "aerospike.name" $dot }} 86 | chart: {{ $.Chart.Name }} 87 | release: {{ $.Release.Name }} 88 | {{- with $.Values.externalIPServices.labels }}{{ toYaml . | nindent 4 }}{{ end }} 89 | {{- with $.Values.externalIPServices.annotations }} 90 | annotations: {{- toYaml . | nindent 4 }} 91 | {{- end }} 92 | spec: 93 | externalIPs: 94 | - {{ $ip := index $.Values.externalIPServices.externalIPEndpoints $podIndex }} {{ $ip.IP }} 95 | ports: 96 | {{- if $.Values.aerospikeNetworkTLSConfig.service }} 97 | - port: {{ $ip := index $.Values.externalIPServices.externalIPEndpoints $podIndex }} {{ $ip.TLSPort }} 98 | targetPort: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 }} 99 | protocol: TCP 100 | name: aerospike-tls 101 | {{- if ne (default false $.Values.aerospikeNetworkTLSConfig.service.tlsOnly) true }} 102 | - port: {{ $ip := index $.Values.externalIPServices.externalIPEndpoints $podIndex }} {{ $ip.Port }} 103 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 104 | protocol: TCP 105 | name: aerospike-plain 106 | {{- end }} 107 | {{- else }} 108 | - port: {{ $ip := index $.Values.externalIPServices.externalIPEndpoints $podIndex }} {{ $ip.Port }} 109 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 110 | protocol: TCP 111 | name: aerospike-plain 112 | {{- end }} 113 | selector: 114 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 115 | {{ end -}} 116 | {{- end }} 117 | --- 118 | -------------------------------------------------------------------------------- /helm/files/aerospike_rules.yaml: -------------------------------------------------------------------------------- 1 | groups: 2 | - name: aerospike.rules 3 | rules: 4 | - alert: NodeDown 5 | expr: up{job="aerospike"} == 0 6 | for: 30s 7 | labels: 8 | severity: "2" 9 | annotations: 10 | description: '{{ "{{" }} $labels.instance {{ "}}" }} has been down for more than 30 seconds.' 11 | summary: Node {{ "{{" }} $labels.instance {{ "}}" }} down 12 | - alert: NodeDown 13 | expr: aerospike_node_up{job="aerospike"} == 0 14 | for: 30s 15 | labels: 16 | severity: "2" 17 | annotations: 18 | description: '{{ "{{" }} $labels.instance {{ "}}" }} node is down.' 19 | summary: Node {{ "{{" }} $labels.instance {{ "}}" }} down 20 | - alert: TransactionQueueTooFull 21 | expr: aerospike_node_stats_tsvc_queue{job="aerospike"} > 10000 22 | for: 30s 23 | labels: 24 | severity: "1" 25 | annotations: 26 | description: 'Transaction queue for node {{ "{{" }} $labels.instance {{ "}}" }} is longer than 10000.' 27 | summary: Transaction queue too full for node {{ "{{" }} $labels.instance {{ "}}" }} 28 | - alert: NamespaceStopWrites 29 | expr: aerospike_namespace_stop_writes{job="aerospike"} == 1 30 | for: 30s 31 | labels: 32 | severity: "1" 33 | annotations: 34 | description: 'Used diskspace for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }} is above stop writes limit.' 35 | summary: Stop Writes for {{ "{{" }} $labels.instance {{ "}}" }}/{{ "{{" }} $labels.ns {{ "}}" }} 36 | - alert: ClockSkewStopWrites 37 | expr: aerospike_namespace_clock_skew_stop_writes{job="aerospike"} == 1 38 | for: 30s 39 | labels: 40 | severity: "1" 41 | annotations: 42 | description: 'Clock has skewed for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 43 | summary: Writes will be stopped by Aerospike 44 | - alert: ClusterSize 45 | expr: aerospike_node_stats_cluster_size{job="aerospike"} < {{ .Values.dbReplicas }} 46 | for: 30s 47 | labels: 48 | severity: "2" 49 | annotations: 50 | description: 'Cluster size mismatch for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 51 | summary: Some of the node(s) has gone out of the cluster 52 | - alert: DeadPartitions 53 | expr: aerospike_namespace_dead_partitions{job="aerospike"} > 0 54 | for: 30s 55 | labels: 56 | severity: "1" 57 | annotations: 58 | description: 'Some of the partition(s) for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }} are dead' 59 | summary: Will require the use of the revive command to make them available again 60 | - alert: HwmBreached 61 | expr: aerospike_namespace_hwm_breached{job="aerospike"} == 1 62 | for: 30s 63 | labels: 64 | severity: "2" 65 | annotations: 66 | description: 'High water mark has breached for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 67 | summary: Eviction will start to make the space available 68 | - alert: UnavailablePartitions 69 | expr: aerospike_namespace_unavailable_partitions{job="aerospike"} > 0 70 | for: 30s 71 | labels: 72 | severity: "1" 73 | annotations: 74 | description: 'Some of the partition(s) is not available for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 75 | summary: Server could not found some partition(s). Check for the network issues and make sure cluster forms properly 76 | - alert: XDRTimelag 77 | expr: aerospike_node_stats_xdr_timelag{job="aerospike"} > 10 # user can configure the seconds. Refer XDR throttling 78 | for: 30s 79 | labels: 80 | severity: "2" 81 | annotations: 82 | description: 'There seems some lag in XDR for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 83 | summary: Lag can be there in XDR due to network connectivity issues or errors writing at a destination cluster 84 | - alert: LowDeviceAvailWarning 85 | expr: aerospike_namespace_device_available_pct{job="aerospike"} < 20 86 | for: 30s 87 | labels: 88 | severity: "2" 89 | annotations: 90 | description: 'Device available percentage has dropped below 20 for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 91 | summary: Defrag is unable to keep up with the current load {{ "{{" }} $labels.instance {{ "}}" }}/{{ "{{" }} $labels.ns {{ "}}" }} 92 | - alert: LowDeviceAvailCritical 93 | expr: aerospike_namespace_device_available_pct{job="aerospike"} < 15 94 | for: 30s 95 | labels: 96 | severity: "1" 97 | annotations: 98 | description: 'Device available percentage has dropped below 15 for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 99 | summary: Usable disk resources are critically low which may result in a stop-writes if available percentage goes below 5 100 | - alert: LowPmemAvailWarning 101 | expr: aerospike_namespace_pmem_available_pct{job="aerospike"} < 20 102 | for: 30s 103 | labels: 104 | severity: "2" 105 | annotations: 106 | description: 'Pmem available percentage has dropped below 20 for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 107 | summary: Defrag is unable to keep up with the current load {{ "{{" }} $labels.instance {{ "}}" }}/{{ "{{" }} $labels.ns {{ "}}" }} 108 | - alert: LowPmemAvailCritical 109 | expr: aerospike_namespace_pmem_available_pct{job="aerospike"} < 15 110 | for: 30s 111 | labels: 112 | severity: "1" 113 | annotations: 114 | description: 'Pmem available percentage has dropped below 15 for namespace {{ "{{" }} $labels.ns {{ "}}" }} in node {{ "{{" }} $labels.instance {{ "}}" }}' 115 | summary: Usable Pmem resource is critically low which may result in a stop-writes if available percentage goes below 5 116 | -------------------------------------------------------------------------------- /helm/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | This file documents all notable changes to Aerospike Helm Chart (Enterprise Edition). 4 | 5 | 6 | ## [1.5.3](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.5.3) 7 | 8 | ### Update 9 | 10 | - Deprecating Aerospike Helm Chart (Enterprise Edition) 11 | 12 | 13 | ## [1.5.2](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.5.2) 14 | 15 | ### Improvements 16 | 17 | - Support specifying args for aerospike container 18 | - Allow configuration of labels and annotations for services 19 | - Support for passing feature key file as a base64 encoded string 20 | - Support for passing aerospike configuration file as a base64 encoded string 21 | - Allow configuration labels, annotations for Prometheus, Alertmanager, Grafana statefulset and pods 22 | - Support for passing Aerospike alert rules and Alertmanager configuration file as a base64 encoded string 23 | 24 | ### Fixes 25 | 26 | - Don't trim the statefulset name if the release name contains chart name 27 | 28 | ### Regular Updates 29 | 30 | - Added Chart `5.5.0` for Aerospike server version `5.5.0.7` 31 | - Chart `5.4.0` updated to use Aerospike server version `5.4.0.9` 32 | - Chart `5.3.0` updated to use Aerospike server version `5.3.0.14` 33 | - Chart `5.2.0` updated to use Aerospike server version `5.2.0.24` 34 | - Chart `5.1.0` updated to use Aerospike server version `5.1.0.31` 35 | - Chart `5.0.0` updated to use Aerospike server version `5.0.0.33` 36 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.30` 37 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.31` 38 | 39 | 40 | ## [1.5.1](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.5.1) 41 | 42 | ### Regular Updates 43 | 44 | - Updated monitoring dashboards 45 | - Added Chart `5.4.0` for Aerospike server version `5.4.0.3` 46 | - Chart `5.3.0` updated to use Aerospike server version `5.3.0.8` 47 | - Chart `5.2.0` updated to use Aerospike server version `5.2.0.17` 48 | - Chart `5.1.0` updated to use Aerospike server version `5.1.0.25` 49 | - Chart `5.0.0` updated to use Aerospike server version `5.0.0.27` 50 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.24` 51 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.26` 52 | 53 | 54 | ## [1.5.0](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.5.0) 55 | 56 | ### Features 57 | 58 | - Added TLS support 59 | - New init container 60 | - Network config to opt external or internal IPs when creating services 61 | - Support all configurations of the aerospike prometheus exporter 62 | 63 | ### Improvements 64 | 65 | - Better container lifecycle events handling 66 | - Improved security implementation 67 | - Auto generate node-ids is now enabled by default 68 | - Increased termination grace period to 600 seconds 69 | - Node-id prefix now configurable 70 | - Update monitoring stack 71 | - Allow labels and annotations for pod and statefulset to be configured 72 | 73 | ### Fixes 74 | 75 | - Remove chart version from labels to allow chart upgrades 76 | 77 | ### Regular Updates 78 | 79 | - Added Chart `5.3.0` uses Aerospike server version `5.3.0.6` 80 | - Added Chart `5.2.0` uses Aerospike server version `5.2.0.15` 81 | - Added Chart `5.1.0` uses Aerospike server version `5.1.0.23` 82 | - Chart `5.0.0` updated to use Aerospike Server version `5.0.0.25` 83 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.23` 84 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.25` 85 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.26` 86 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.21` 87 | 88 | 89 | ## [1.4.0](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.4.0) 90 | - Added configuration to apply pod `tolerations` for node `taints` 91 | - Added configuration to apply `nodeSelectors` 92 | - Prometheus' `scrapeInterval` and `evaluationInterval` now configurable 93 | - Allow to configure basic HTTP authentication for `/metrics` URL of the aerospike prometheus exporter 94 | - Added new grafana dashboard for `XDR` `5.0+` metrics and updated other dashboards. 95 | - Update Aerospike Prometheus Exporter Configurations 96 | - Added Chart `5.0.0` uses Aerospike Server version `5.0.0.4` 97 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.17` 98 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.15` 99 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.11` 100 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.8` 101 | 102 | 103 | ## [1.3.0](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.3.0) 104 | 105 | - [CLOUD-7] - Added support for custom service dns domain 106 | - [PROD-1046] - Added new option `enableAerospikePrometheusExporter` to enable Aerospike Prometheus Exporter sidecar (only) 107 | - Added Chart `4.9.0` uses Aerospike Server version `4.9.0.3` 108 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.14` 109 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.12` 110 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.8` 111 | 112 | 113 | ## [1.2.1](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.2.1) 114 | 115 | - Fixed alertmanager's default dummy configuration to avoid `CrashLoopBackOff`. 116 | - Improved usage documentation 117 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.13` 118 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.11` 119 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.6` 120 | 121 | 122 | ## [1.2.0](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.2.0) 123 | 124 | - Uses new `aerospike/aerospike-kubernetes-init` image 125 | - Aerospike tcp ports now configurable 126 | - Improved security implementation 127 | - Added support for NodePort type services to expose aerospike statefulset. 128 | - Added support for LoadBalancer type services to expose aerospike statefulset. 129 | - Added support for externalIP clusterIP type services to expose aerospike statefulset. 130 | - Added configuration to specify or create serviceAccounts to be used in Aerospike/Prometheus/Grafana/Alertmanager statefulsets. 131 | - Integrated Aerospike Monitoring stack with aerospike-prometheus-exporter, prometheus, grafana, and alertmanager. 132 | - Added dynamic configuration to pass in Aerospike alert rules conf file and alertmanager conf file. 133 | - Added support for Aerospike quiesce feature. 134 | - Honor only `.Release.Namespace`. Removed `namespace` option from `values.yaml` 135 | - Added `aerospike-prometheus-exporter` as `sidecar` container (applicable only when aerospike monitoring is enabled). 136 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.12` 137 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.10` 138 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.5` 139 | 140 | 141 | ## [1.1.0](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.1.0) 142 | - Update Chart `4.7.0` to use Aerospike Server version `4.7.0.5` (appVersion). 143 | - Update Chart `4.6.0` to use Aerospike Server version `4.6.0.8` (appVersion). 144 | 145 | 146 | ## [1.0.0](https://github.com/aerospike/aerospike-kubernetes-enterprise/releases/tag/1.0.0) 147 | 148 | - Supports `NodeAffinity`/`PodAffinity`/`PodAntiAffinity` rules. 149 | - Set `antiAffinity` to ensure one Pod per Node (for a release). 150 | Supported Values: `off`, `soft` ('preferred' during scheduling), and `hard` ('required' during scheduling). Default : `off` 151 | - Set `antiAffinityWeight` option to specify 'weight' for 'soft' 'antiAffinity' option above. Default : `1` 152 | - Users can also define their custom `PodAffinity`/`PodAntiAffinity`/`NodeAffinity` rules using a third option `affinity`. Default: `{}` (not set) 153 | - Auto rollout changes to ConfigMaps on helm upgrade. 154 | - Set `autoRolloutConfig=true`. Default: `false` 155 | - Added option `autoGenerateNodeIds` to generate unique default node-ids. Default: `false` 156 | - Added option `hostNetworking` to enable host networking. Default: `false` 157 | - Added option `platform` to work with hostNetworking. Use both to auto-configure Aerospike to use external IP as alternate access address if it exists. 158 | Supported values : `none`, `gke`, and `eks` 159 | - Peer finder will now work with hostNetworking and use K8s Cluster DNS. 160 | - Renamed `dBReplicas` to `dbReplicas`. 161 | - Increased termination grace period from `30` to `120` default. 162 | - Changed default `aerospikeDefaultTTL` to `0` (Never Expire), dbReplicas to `3`. 163 | - Update Chart `4.7.0` to use Aerospike Server version `4.7.0.2` (appVersion). 164 | - Update Chart `4.6.0` to use Aerospike Server version `4.6.0.5` (appVersion). 165 | -------------------------------------------------------------------------------- /helm/templates/alertmanager-statefulset.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: apps/v1 20 | kind: StatefulSet 21 | metadata: 22 | name: {{ .Release.Name }}-alertmanager 23 | labels: &Labels 24 | app: {{ template "aerospike.name" . }}-alertmanager 25 | chart: {{ .Chart.Name }} 26 | release: {{ .Release.Name }} 27 | app.kubernetes.io/component: alertmanager 28 | unique-app: {{ .Release.Name }}-alertmanager 29 | {{- with .Values.alertmanager.labels }}{{ toYaml . | nindent 4 }}{{ end }} 30 | {{- with .Values.alertmanager.annotations }} 31 | annotations: {{- toYaml . | nindent 4 }} 32 | {{- end }} 33 | spec: 34 | serviceName: {{ .Release.Name }}-alertmanager-operated 35 | replicas: {{ .Values.alertmanager.replicas }} 36 | podManagementPolicy: {{ .Values.alertmanager.podManagementPolicy }} 37 | updateStrategy: 38 | type: {{ .Values.alertmanager.updateStrategy.type }} 39 | revisionHistoryLimit: 10 40 | selector: 41 | matchLabels: 42 | <<: *Labels 43 | {{- with .Values.alertmanager.podLabels }}{{ toYaml . | nindent 6 }}{{ end }} 44 | template: 45 | metadata: 46 | labels: 47 | <<: *Labels 48 | {{- with .Values.alertmanager.podLabels }}{{ toYaml . | nindent 8 }}{{ end }} 49 | annotations: 50 | {{- if .Values.autoRolloutConfig }} 51 | # TODO: Add an entry for secrets when used in future 52 | checksum/config: {{ include (print $.Template.BasePath "/alertmanager-configmap.yaml") . | sha256sum }} 53 | {{- end }} 54 | {{- with .Values.alertmanager.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }} 55 | spec: 56 | serviceAccountName: {{ if .Values.rbac.create }}{{ template "aerospike.fullname" . }}{{ else }}{{ .Values.rbac.serviceAccountName }}{{ end }} 57 | {{- if eq .Values.alertmanager.antiAffinity "hard" }} 58 | affinity: 59 | {{- with .Values.alertmanager.affinity }} 60 | {{ toYaml . | indent 8 }} 61 | {{- end }} 62 | podAntiAffinity: 63 | requiredDuringSchedulingIgnoredDuringExecution: 64 | - topologyKey: "kubernetes.io/hostname" 65 | labelSelector: 66 | matchExpressions: 67 | - key: unique-app 68 | operator: In 69 | values: 70 | - {{ .Release.Name }}-alertmanager 71 | {{- else if eq .Values.alertmanager.antiAffinity "soft" }} 72 | affinity: 73 | {{- with .Values.alertmanager.affinity }} 74 | {{ toYaml . | indent 8 }} 75 | {{- end }} 76 | podAntiAffinity: 77 | preferredDuringSchedulingIgnoredDuringExecution: 78 | - weight: {{ .Values.alertmanager.antiAffinityWeight }} 79 | podAffinityTerm: 80 | topologyKey: kubernetes.io/hostname 81 | labelSelector: 82 | matchExpressions: 83 | - key: unique-app 84 | operator: In 85 | values: 86 | - {{ .Release.Name }}-alertmanager 87 | {{- else}} 88 | {{- with .Values.alertmanager.affinity }} 89 | affinity: {{ toYaml . | nindent 8 }} 90 | {{- end }} 91 | {{- end }} 92 | {{- with .Values.alertmanager.tolerations }} 93 | tolerations: {{- toYaml . | nindent 8 }} 94 | {{- end }} 95 | {{- with .Values.alertmanager.nodeSelector }} 96 | nodeSelector: {{- toYaml . | nindent 8 }} 97 | {{- end }} 98 | terminationGracePeriodSeconds: {{ .Values.alertmanager.terminationGracePeriodSeconds | default 120 }} 99 | containers: 100 | - name: prometheus-alertmanager 101 | image: "{{ .Values.alertmanager.image.repository }}:{{ .Values.alertmanager.image.tag }}" 102 | imagePullPolicy: "IfNotPresent" 103 | args: 104 | - --config.file=/etc/config/alertmanager.yaml 105 | - --storage.path="{{ .Values.alertmanager.volume.mountPath }}" 106 | - --web.listen-address=:{{ .Values.alertmanager.webPort | default 9093 }} 107 | - --web.route-prefix=/ 108 | - --cluster.listen-address=$(POD_IP):{{ .Values.alertmanager.meshPort | default 9094 }} 109 | - --log.level={{ .Values.alertmanager.loglevel }} 110 | env: 111 | - name: POD_IP 112 | valueFrom: 113 | fieldRef: 114 | apiVersion: v1 115 | fieldPath: status.podIP 116 | ports: 117 | - containerPort: {{ .Values.alertmanager.webPort | default 9093 }} 118 | name: http 119 | - containerPort: {{ .Values.alertmanager.meshPort | default 9094 }} 120 | name: mesh 121 | livenessProbe: 122 | httpGet: 123 | path: /#/status 124 | port: {{ .Values.alertmanager.webPort | default 9093 }} 125 | initialDelaySeconds: {{ .Values.alertmanager.livenessProbe.initialDelaySeconds | default 30 }} 126 | periodSeconds: {{ .Values.alertmanager.livenessProbe.periodSeconds | default 10 }} 127 | timeoutSeconds: {{ .Values.alertmanager.livenessProbe.timeoutSeconds | default 10 }} 128 | successThreshold: {{ .Values.alertmanager.livenessProbe.successThreshold | default 1 }} 129 | failureThreshold: {{ .Values.alertmanager.livenessProbe.failureThreshold | default 3 }} 130 | readinessProbe: 131 | httpGet: 132 | path: /#/status 133 | port: {{ .Values.alertmanager.webPort | default 9093 }} 134 | initialDelaySeconds: {{ .Values.alertmanager.readinessProbe.initialDelaySeconds | default 30 }} 135 | periodSeconds: {{ .Values.alertmanager.readinessProbe.periodSeconds | default 10 }} 136 | timeoutSeconds: {{ .Values.alertmanager.readinessProbe.timeoutSeconds | default 10 }} 137 | successThreshold: {{ .Values.alertmanager.readinessProbe.successThreshold | default 1 }} 138 | failureThreshold: {{ .Values.alertmanager.readinessProbe.failureThreshold | default 3 }} 139 | resources: 140 | {{ toYaml .Values.alertmanager.resources | indent 10 }} 141 | volumeMounts: 142 | - name: config-volume 143 | mountPath: /etc/config 144 | {{- if .Values.alertmanager.persistenceStorage }} 145 | {{- if .Values.alertmanager.persistenceStorage.enabled }} 146 | {{- if eq .Values.alertmanager.persistenceStorage.volumeMode "Filesystem"}} 147 | - name: {{ .Values.alertmanager.persistenceStorage.name | quote }} 148 | mountPath: {{ .Values.alertmanager.persistenceStorage.mountPath | quote }} 149 | {{- end }} 150 | {{- end }} 151 | {{- end }} 152 | {{- if .Values.alertmanager.volume }} 153 | - name: {{ .Values.alertmanager.volume.name | quote }} 154 | mountPath: {{ .Values.alertmanager.volume.mountPath | quote }} 155 | {{- end }} 156 | volumes: 157 | - name: config-volume 158 | configMap: 159 | name: {{ .Release.Name }}-alertmanager-config 160 | {{- if .Values.alertmanager.volume }} 161 | - name: {{ .Values.alertmanager.volume.name | quote }} 162 | {{ toYaml .Values.alertmanager.volume.template | indent 10}} 163 | {{- end }} 164 | volumeClaimTemplates: 165 | {{- if .Values.alertmanager.persistenceStorage }} 166 | {{- if .Values.alertmanager.persistenceStorage.enabled }} 167 | - metadata: 168 | name: {{ .Values.alertmanager.persistenceStorage.name }} 169 | labels: *Labels 170 | {{- with $.Values.alertmanager.annotations }} 171 | annotations: {{- toYaml . | nindent 10 }} 172 | {{- end }} 173 | spec: 174 | volumeMode: {{ .Values.alertmanager.persistenceStorage.volumeMode }} 175 | accessModes: 176 | - {{ .Values.alertmanager.persistenceStorage.accessMode | quote }} 177 | {{- if hasKey .Values.alertmanager.persistenceStorage "storageClass" }} 178 | storageClassName: {{ .Values.alertmanager.persistenceStorage.storageClass | quote }} 179 | {{- end }} 180 | resources: 181 | requests: 182 | storage: {{ .Values.alertmanager.persistenceStorage.size | quote }} 183 | {{- end }} 184 | {{- end }} 185 | {{- end }} -------------------------------------------------------------------------------- /helm/templates/prometheus-statefulset.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: apps/v1 20 | kind: StatefulSet 21 | metadata: 22 | name: {{ .Release.Name }}-prometheus 23 | namespace: {{ .Release.Namespace }} 24 | labels: &Labels 25 | app: {{ template "aerospike.name" . }}-prometheus 26 | chart: {{ .Chart.Name }} 27 | release: {{ .Release.Name }} 28 | app.kubernetes.io/component: prometheus 29 | unique-app: {{ .Release.Name }}-prometheus 30 | {{- with .Values.prometheus.labels }}{{ toYaml . | nindent 4 }}{{ end }} 31 | {{- with .Values.prometheus.annotations }} 32 | annotations: {{- toYaml . | nindent 4 }} 33 | {{- end }} 34 | spec: 35 | serviceName: {{ .Release.Name }}-prometheus 36 | replicas: {{ .Values.prometheus.replicas }} 37 | podManagementPolicy: {{ .Values.prometheus.podManagementPolicy }} 38 | updateStrategy: 39 | type: {{ .Values.prometheus.updateStrategy.type }} 40 | selector: 41 | matchLabels: 42 | <<: *Labels 43 | {{- with .Values.prometheus.podLabels }}{{ toYaml . | nindent 6 }}{{ end }} 44 | template: 45 | metadata: 46 | labels: 47 | <<: *Labels 48 | {{- with .Values.prometheus.podLabels }}{{ toYaml . | nindent 8 }}{{ end }} 49 | annotations: 50 | {{- if .Values.autoRolloutConfig }} 51 | # TODO: Add an entry for secrets when used in future 52 | checksum/config: {{ include (print $.Template.BasePath "/prometheus-configmap.yaml") . | sha256sum }} 53 | {{- end }} 54 | {{- with .Values.prometheus.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }} 55 | spec: 56 | serviceAccountName: {{ if .Values.rbac.create }}{{ template "aerospike.fullname" . }}{{ else }}{{ .Values.rbac.serviceAccountName }}{{ end }} 57 | {{- if eq .Values.prometheus.antiAffinity "hard" }} 58 | affinity: 59 | {{- with .Values.prometheus.affinity }} 60 | {{ toYaml . | indent 8 }} 61 | {{- end }} 62 | podAntiAffinity: 63 | requiredDuringSchedulingIgnoredDuringExecution: 64 | - topologyKey: "kubernetes.io/hostname" 65 | labelSelector: 66 | matchExpressions: 67 | - key: unique-app 68 | operator: In 69 | values: 70 | - {{ .Release.Name }}-prometheus 71 | {{- else if eq .Values.prometheus.antiAffinity "soft" }} 72 | affinity: 73 | {{- with .Values.prometheus.affinity }} 74 | {{ toYaml . | indent 8 }} 75 | {{- end }} 76 | podAntiAffinity: 77 | preferredDuringSchedulingIgnoredDuringExecution: 78 | - weight: {{ .Values.prometheus.antiAffinityWeight }} 79 | podAffinityTerm: 80 | topologyKey: kubernetes.io/hostname 81 | labelSelector: 82 | matchExpressions: 83 | - key: unique-app 84 | operator: In 85 | values: 86 | - {{ .Release.Name }}-prometheus 87 | {{- else}} 88 | {{- with .Values.prometheus.affinity }} 89 | affinity: {{ toYaml . | nindent 8 }} 90 | {{- end }} 91 | {{- end }} 92 | {{- with .Values.prometheus.tolerations }} 93 | tolerations: {{- toYaml . | nindent 8 }} 94 | {{- end }} 95 | {{- with .Values.prometheus.nodeSelector }} 96 | nodeSelector: {{- toYaml . | nindent 8 }} 97 | {{- end }} 98 | initContainers: 99 | - name: "init-chown-data" 100 | image: debian:9 101 | imagePullPolicy: "IfNotPresent" 102 | command: ["chown", "-R", "65534:65534", "{{ .Values.prometheus.volume.mountPath }}"] 103 | volumeMounts: 104 | {{- if .Values.prometheus.persistenceStorage }} 105 | {{- if .Values.prometheus.persistenceStorage.enabled }} 106 | {{- if eq .Values.prometheus.persistenceStorage.volumeMode "Filesystem"}} 107 | - name: {{ .Values.prometheus.persistenceStorage.name | quote }} 108 | mountPath: {{ .Values.prometheus.persistenceStorage.mountPath | quote }} 109 | {{- end }} 110 | {{- end }} 111 | {{- end }} 112 | {{- if .Values.prometheus.volume }} 113 | - name: {{ .Values.prometheus.volume.name | quote }} 114 | mountPath: {{ .Values.prometheus.volume.mountPath | quote }} 115 | {{- end }} 116 | containers: 117 | - name: prometheus-server 118 | image: "{{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}" 119 | imagePullPolicy: "IfNotPresent" 120 | args: 121 | - --config.file=/etc/prometheus/prometheus.yaml 122 | - --storage.tsdb.path="{{ .Values.prometheus.volume.mountPath }}" 123 | - --web.listen-address=:{{ .Values.prometheus.serverPort | default 9090 }} 124 | ports: 125 | - containerPort: {{ .Values.prometheus.serverPort | default 9090 }} 126 | readinessProbe: 127 | httpGet: 128 | path: /-/ready 129 | port: {{ .Values.prometheus.serverPort | default 9090 }} 130 | initialDelaySeconds: {{ .Values.prometheus.readinessProbe.initialDelaySeconds | default 30 }} 131 | periodSeconds: {{ .Values.prometheus.readinessProbe.periodSeconds | default 10 }} 132 | timeoutSeconds: {{ .Values.prometheus.readinessProbe.timeoutSeconds | default 10 }} 133 | successThreshold: {{ .Values.prometheus.readinessProbe.successThreshold | default 1 }} 134 | failureThreshold: {{ .Values.prometheus.readinessProbe.failureThreshold | default 3 }} 135 | livenessProbe: 136 | httpGet: 137 | path: /-/healthy 138 | port: {{ .Values.prometheus.serverPort | default 9090 }} 139 | initialDelaySeconds: {{ .Values.prometheus.livenessProbe.initialDelaySeconds | default 30 }} 140 | periodSeconds: {{ .Values.prometheus.livenessProbe.periodSeconds | default 10 }} 141 | timeoutSeconds: {{ .Values.prometheus.livenessProbe.timeoutSeconds | default 10 }} 142 | successThreshold: {{ .Values.prometheus.livenessProbe.successThreshold | default 1 }} 143 | failureThreshold: {{ .Values.prometheus.livenessProbe.failureThreshold | default 3 }} 144 | resources: 145 | {{ toYaml .Values.prometheus.resources | indent 10 }} 146 | volumeMounts: 147 | - name: config-volume 148 | mountPath: /etc/prometheus 149 | {{- if .Values.prometheus.persistenceStorage }} 150 | {{- if .Values.prometheus.persistenceStorage.enabled }} 151 | {{- if eq .Values.prometheus.persistenceStorage.volumeMode "Filesystem"}} 152 | - name: {{ .Values.prometheus.persistenceStorage.name | quote }} 153 | mountPath: {{ .Values.prometheus.persistenceStorage.mountPath | quote }} 154 | {{- end }} 155 | {{- end }} 156 | {{- end }} 157 | {{- if .Values.prometheus.volume }} 158 | - name: {{ .Values.prometheus.volume.name | quote }} 159 | mountPath: {{ .Values.prometheus.volume.mountPath | quote }} 160 | {{- end }} 161 | terminationGracePeriodSeconds: {{ .Values.prometheus.terminationGracePeriodSeconds | default 120 }} 162 | volumes: 163 | - name: config-volume 164 | configMap: 165 | name: {{ .Release.Name }}-prometheus-config 166 | {{- if .Values.prometheus.volume }} 167 | - name: {{ .Values.prometheus.volume.name | quote }} 168 | {{ toYaml .Values.prometheus.volume.template | indent 8}} 169 | {{- end }} 170 | volumeClaimTemplates: 171 | {{- if .Values.prometheus.persistenceStorage }} 172 | {{- if .Values.prometheus.persistenceStorage.enabled }} 173 | - metadata: 174 | name: {{ .Values.prometheus.persistenceStorage.name }} 175 | labels: *Labels 176 | {{- with $.Values.prometheus.annotations }} 177 | annotations: {{- toYaml . | nindent 10 }} 178 | {{- end }} 179 | spec: 180 | volumeMode: {{ .Values.prometheus.persistenceStorage.volumeMode }} 181 | accessModes: 182 | - {{ .Values.prometheus.persistenceStorage.accessMode | quote }} 183 | {{- if hasKey .Values.prometheus.persistenceStorage "storageClass" }} 184 | storageClassName: {{ .Values.prometheus.persistenceStorage.storageClass | quote }} 185 | {{- end }} 186 | resources: 187 | requests: 188 | storage: {{ .Values.prometheus.persistenceStorage.size | quote }} 189 | {{- end }} 190 | {{- end }} 191 | {{- end }} 192 | -------------------------------------------------------------------------------- /helm/templates/grafana-statefulset.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | {{- if .Values.enableAerospikeMonitoring }} 19 | apiVersion: apps/v1 20 | kind: StatefulSet 21 | metadata: 22 | name: {{ .Release.Name }}-grafana 23 | namespace: {{ .Release.Namespace }} 24 | labels: &Labels 25 | app: {{ template "aerospike.name" . }}-grafana 26 | chart: {{ .Chart.Name }} 27 | release: {{ .Release.Name }} 28 | app.kubernetes.io/component: grafana 29 | unique-app: {{ .Release.Name }}-grafana 30 | {{- with .Values.grafana.labels }}{{ toYaml . | nindent 4 }}{{ end }} 31 | {{- with .Values.grafana.annotations }} 32 | annotations: {{- toYaml . | nindent 4 }} 33 | {{- end }} 34 | spec: 35 | serviceName: {{ .Release.Name }}-grafana 36 | replicas: {{ .Values.grafana.replicas }} 37 | selector: 38 | matchLabels: 39 | <<: *Labels 40 | {{- with .Values.grafana.podLabels }}{{ toYaml . | nindent 6 }}{{ end }} 41 | template: 42 | metadata: 43 | labels: 44 | <<: *Labels 45 | {{- with .Values.grafana.podLabels }}{{ toYaml . | nindent 8 }}{{ end }} 46 | annotations: 47 | {{- if .Values.autoRolloutConfig }} 48 | # TODO: Add an entry for secrets when used in future 49 | checksum/config: {{ include (print $.Template.BasePath "/grafana-configmap.yaml") . | sha256sum }} 50 | {{- end }} 51 | {{- with .Values.grafana.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }} 52 | spec: 53 | serviceAccountName: {{ if .Values.rbac.create }}{{ template "aerospike.fullname" . }}{{ else }}{{ .Values.rbac.serviceAccountName }}{{ end }} 54 | {{- if eq .Values.grafana.antiAffinity "hard" }} 55 | affinity: 56 | {{- with .Values.grafana.affinity }} 57 | {{ toYaml . | indent 8 }} 58 | {{- end }} 59 | podAntiAffinity: 60 | requiredDuringSchedulingIgnoredDuringExecution: 61 | - topologyKey: "kubernetes.io/hostname" 62 | labelSelector: 63 | matchExpressions: 64 | - key: unique-app 65 | operator: In 66 | values: 67 | - {{ .Release.Name }}-grafana 68 | {{- else if eq .Values.grafana.antiAffinity "soft" }} 69 | affinity: 70 | {{- with .Values.grafana.affinity }} 71 | {{ toYaml . | indent 8 }} 72 | {{- end }} 73 | podAntiAffinity: 74 | preferredDuringSchedulingIgnoredDuringExecution: 75 | - weight: {{ .Values.grafana.antiAffinityWeight }} 76 | podAffinityTerm: 77 | topologyKey: kubernetes.io/hostname 78 | labelSelector: 79 | matchExpressions: 80 | - key: unique-app 81 | operator: In 82 | values: 83 | - {{ .Release.Name }}-grafana 84 | {{- else}} 85 | {{- with .Values.grafana.affinity }} 86 | affinity: {{ toYaml . | nindent 8 }} 87 | {{- end }} 88 | {{- end }} 89 | {{- with .Values.grafana.tolerations }} 90 | tolerations: {{- toYaml . | nindent 8 }} 91 | {{- end }} 92 | {{- with .Values.grafana.nodeSelector }} 93 | nodeSelector: {{- toYaml . | nindent 8 }} 94 | {{- end }} 95 | terminationGracePeriodSeconds: {{ .Values.grafana.terminationGracePeriodSeconds | default 120 }} 96 | initContainers: 97 | - name: "init-chmod-data" 98 | image: debian:9 99 | imagePullPolicy: "IfNotPresent" 100 | command: ["chmod", "777", "{{ .Values.grafana.volume.mountPath }}"] 101 | volumeMounts: 102 | {{- if .Values.grafana.persistenceStorage }} 103 | {{- if .Values.grafana.persistenceStorage.enabled }} 104 | {{- if eq .Values.grafana.persistenceStorage.volumeMode "Filesystem"}} 105 | - name: {{ .Values.grafana.persistenceStorage.name | quote }} 106 | mountPath: {{ .Values.grafana.persistenceStorage.mountPath | quote }} 107 | {{- end }} 108 | {{- end }} 109 | {{- end }} 110 | {{- if .Values.grafana.volume }} 111 | - name: {{ .Values.grafana.volume.name | quote }} 112 | mountPath: {{ .Values.grafana.volume.mountPath | quote }} 113 | {{- end }} 114 | containers: 115 | - name: grafana 116 | image: "{{ .Values.grafana.image.repository }}:{{ .Values.grafana.image.tag }}" 117 | imagePullPolicy: "IfNotPresent" 118 | volumeMounts: 119 | - name: grafana-config 120 | mountPath: "/etc/grafana/" 121 | - name: grafana-provisioning-dashboards 122 | mountPath: "/etc/grafana/provisioning/dashboards" 123 | - name: grafana-provisioning-datasources 124 | mountPath: "/etc/grafana/provisioning/datasources" 125 | - name: grafana-dashboards 126 | mountPath: "/var/lib/grafana/dashboards" 127 | {{- if .Values.grafana.persistenceStorage }} 128 | {{- if .Values.grafana.persistenceStorage.enabled }} 129 | {{- if eq .Values.grafana.persistenceStorage.volumeMode "Filesystem"}} 130 | - name: {{ .Values.grafana.persistenceStorage.name | quote }} 131 | mountPath: {{ .Values.grafana.persistenceStorage.mountPath | quote }} 132 | {{- end }} 133 | {{- end }} 134 | {{- end }} 135 | {{- if .Values.grafana.volume }} 136 | - name: {{ .Values.grafana.volume.name | quote }} 137 | mountPath: {{ .Values.grafana.volume.mountPath | quote }} 138 | {{- end }} 139 | ports: 140 | - name: service 141 | containerPort: 80 142 | protocol: TCP 143 | - name: grafana 144 | containerPort: {{ .Values.grafana.httpPort | default 3000 }} 145 | protocol: TCP 146 | livenessProbe: 147 | httpGet: 148 | path: /api/health 149 | port: {{ .Values.grafana.httpPort | default 3000 }} 150 | initialDelaySeconds: {{ .Values.grafana.livenessProbe.initialDelaySeconds | default 30 }} 151 | periodSeconds: {{ .Values.grafana.livenessProbe.periodSeconds | default 10 }} 152 | timeoutSeconds: {{ .Values.grafana.livenessProbe.timeoutSeconds | default 10 }} 153 | successThreshold: {{ .Values.grafana.livenessProbe.successThreshold | default 1 }} 154 | failureThreshold: {{ .Values.grafana.livenessProbe.failureThreshold | default 10 }} 155 | readinessProbe: 156 | httpGet: 157 | path: /api/health 158 | port: {{ .Values.grafana.httpPort | default 3000 }} 159 | initialDelaySeconds: {{ .Values.grafana.readinessProbe.initialDelaySeconds | default 30 }} 160 | periodSeconds: {{ .Values.grafana.readinessProbe.periodSeconds | default 10 }} 161 | timeoutSeconds: {{ .Values.grafana.readinessProbe.timeoutSeconds | default 10 }} 162 | successThreshold: {{ .Values.grafana.readinessProbe.successThreshold | default 1 }} 163 | failureThreshold: {{ .Values.grafana.readinessProbe.failureThreshold | default 10 }} 164 | resources: 165 | {{ toYaml .Values.grafana.resources | indent 10 }} 166 | env: 167 | - name: GF_SECURITY_ADMIN_USER 168 | value: "{{ .Values.grafana.user }}" 169 | - name: GF_SECURITY_ADMIN_PASSWORD 170 | value: "{{ .Values.grafana.password }}" 171 | - name: GF_INSTALL_PLUGINS 172 | value: "{{ .Values.grafana.plugins }}" 173 | volumes: 174 | - name: grafana-config 175 | configMap: 176 | name: {{ .Release.Name }}-grafana-config 177 | - name: grafana-dashboards 178 | configMap: 179 | name: {{ .Release.Name }}-grafana-dashboards 180 | - name: grafana-provisioning-dashboards 181 | configMap: 182 | name: {{ .Release.Name }}-grafana-provisioning-dashboards 183 | - name: grafana-provisioning-datasources 184 | configMap: 185 | name: {{ .Release.Name }}-grafana-provisioning-datasources 186 | {{- if .Values.grafana.volume }} 187 | - name: {{ .Values.grafana.volume.name | quote }} 188 | {{ toYaml .Values.grafana.volume.template | indent 10}} 189 | {{- end }} 190 | volumeClaimTemplates: 191 | {{- if .Values.grafana.persistenceStorage }} 192 | {{- if .Values.grafana.persistenceStorage.enabled }} 193 | - metadata: 194 | name: {{ .Values.grafana.persistenceStorage.name }} 195 | labels: *Labels 196 | {{- with $.Values.grafana.annotations }} 197 | annotations: {{- toYaml . | nindent 10 }} 198 | {{- end }} 199 | spec: 200 | volumeMode: {{ .Values.grafana.persistenceStorage.volumeMode }} 201 | accessModes: 202 | - {{ .Values.grafana.persistenceStorage.accessMode | quote }} 203 | {{- if hasKey .Values.grafana.persistenceStorage "storageClass" }} 204 | storageClassName: {{ .Values.grafana.persistenceStorage.storageClass | quote }} 205 | {{- end }} 206 | resources: 207 | requests: 208 | storage: {{ .Values.grafana.persistenceStorage.size | quote }} 209 | {{- end }} 210 | {{- end }} 211 | {{- end }} 212 | -------------------------------------------------------------------------------- /examples/storage-engine-device/README.md: -------------------------------------------------------------------------------- 1 | ## Example - Deploy an Aerospike cluster with namespace data storage on local SSDs using local volume static provisioner 2 | 3 | ### Description 4 | 5 | This example includes: 6 | 7 | - Deploying an Aerospike cluster with namespace `storage-engine` as `device` (raw block device mode). 8 | - Configure and deploy a local volume provisioner to manage local SSDs and automate volume provisioning for Aerospike pods. 9 | 10 | Let's get started. 11 | 12 | In this example, we will set and use the Kubernetes `namespace` as `dev` and `app` name as `aerospike-test`. 13 | 14 | ### Create namespace `dev` 15 | 16 | The namespace definition is present in [namespace.yaml](namespace.yaml) 17 | ```sh 18 | $ kubectl create -f namespace.yaml 19 | ``` 20 | ```sh 21 | $ kubectl get namespaces 22 | 23 | NAME STATUS AGE 24 | default Active 10d 25 | dev Active 6s 26 | kube-public Active 10d 27 | kube-system Active 10d 28 | ``` 29 | 30 | ### Create discovery directory and link the devices 31 | 32 | Before deploying local volume provisioner, create a discovery directory on each worker node and link the block devices to be used into the discovery directory. The provisioner will discover local block volumes from this directory. 33 | 34 | In this example, there are two local SSDs (identified as `/dev/sdb` and `/dev/sdc`) attached to each worker node (we have two worker nodes in this example) which can be used for the Aerospike Cluster deployment. 35 | 36 | ``` 37 | $ lsblk 38 | 39 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 40 | sdb 8:16 0 375G 0 disk 41 | sdc 8:32 0 375G 0 disk 42 | ``` 43 | 44 | ```sh 45 | $ mkdir /mnt/disks 46 | ``` 47 | 48 | Use unique device IDs rather than the names `/dev/sdb` or `/dev/sdc`. 49 | 50 | ```sh 51 | $ ln -s /dev/disk/by-id/local-ssd-0 /mnt/disks 52 | $ ln -s /dev/disk/by-id/local-ssd-1 /mnt/disks 53 | ``` 54 | 55 | > Note :
You can also use your own discovery directory, but make sure that the [provisioner](aerospike-local-volume-provisioner.yaml) is also configured to point to the same directory. 56 | 57 | ### Configure and deploy local volume provisioner 58 | 59 | To automate the local volume provisioning, we will create and run a provisioner based on [kubernetes-sigs/sig-storage-local-static-provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner). 60 | 61 | The provisioner will run as a `DaemonSet` which will manage the local SSDs on each node based on a discovery directory, create/delete the PersistentVolumes and clean up the storage when it is released. 62 | 63 | The local volume static provisioner for this example is defined in [aerospike-local-volume-provisioner.yaml](aerospike-local-volume-provisioner.yaml). Each specification is highlighted with comments in the same file. 64 | 65 | Deploy the provisioner, 66 | 67 | ```sh 68 | $ kubectl create -f aerospike-local-volume-provisioner.yaml 69 | 70 | configmap/local-provisioner-config created 71 | daemonset.apps/local-volume-provisioner created 72 | storageclass.storage.k8s.io/aerospike-ssds created 73 | serviceaccount/local-storage-admin created 74 | clusterrolebinding.rbac.authorization.k8s.io/local-storage-provisioner-pv-binding created 75 | clusterrole.rbac.authorization.k8s.io/local-storage-provisioner-node-clusterrole created 76 | clusterrolebinding.rbac.authorization.k8s.io/local-storage-provisioner-node-binding created 77 | ``` 78 | 79 | Verify the discovered and created PV objects, 80 | ```sh 81 | $ kubectl get pv 82 | 83 | NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE 84 | local-pv-342b45ed 375Gi RWO Delete Available aerospike-ssds 3s 85 | local-pv-3587dbec 375Gi RWO Delete Available aerospike-ssds 3s 86 | local-pv-df716a06 375Gi RWO Delete Available aerospike-ssds 3s 87 | local-pv-eaf4a027 375Gi RWO Delete Available aerospike-ssds 3s 88 | ``` 89 | 90 | Note that the `storageclass` configured here is `aerospike-ssds`. We will use this storageclass in PVC or volumeClaimTemplates to talk to the provisioner and request PV resources (See [Statefulset definition](#deploy-aerospike-cluster-using-a-statefulset-defintion)). 91 | 92 | ### Create and deploy ConfigMap object 93 | 94 | - The [configmap](configmap) directory contains the Aerospike configuration file template for this example - `aerospike.template.conf`. 95 | - Add the `feature-key-file` (Enterprise License) to the [configmap](configmap) directory. Feature-key-file (`features.conf`) is required to run Aerospike Server Enterprise Edition. 96 | 97 | Now the [configmap](configmap) directory will contain two files - `aerospike.template.conf` and `features.conf`. 98 | 99 | Create configMap object, 100 | 101 | ```sh 102 | $ kubectl create configmap aerospike-conf -n dev --from-file=configmap/ 103 | ``` 104 | 105 | > Note :
For this example, we will configure only a single Aerospike Namespace with data storage on a single raw block volume. If you prefer to use multiple namespaces, please use a custom aerospike.conf file or template accordingly. 106 | 107 | Note that `storage-engine` configuration in `aerospike.template.conf` is using a block device `/dev/xvdb`. You can also use multiple raw devices in the storage-engine configuration, but make sure that each of them have a corresponding PVC through volumeClaimTemplates in the statefulset definition (Check [Things to note](#things-to-note) section). 108 | ``` 109 | ... 110 | storage-engine device { 111 | device /dev/xvdb 112 | # (optional) another raw device. 113 | # device /dev/ 114 | write-block-size 128K 115 | # data-in-memory true # Store data in memory in addition to file. 116 | } 117 | ... 118 | ``` 119 | 120 | ### Create and run a 'headless' service (for DNS lookup) 121 | 122 | For this example, we will use the Service defined in [service.yaml](service.yaml) 123 | 124 | ```sh 125 | $ kubectl create -f service.yaml 126 | ``` 127 | 128 | 129 | ### Deploy Aerospike cluster using a statefulset defintion 130 | 131 | For this example, the statefulset definition is present in [statefulset-raw-device.yaml](statefulset-raw-device.yaml). 132 | 133 | Set necessary variables (rest are optional), 134 | 135 | ```sh 136 | export AEROSPIKE_NODES=3 137 | export AEROSPIKE_MEM=4 138 | export AEROSPIKE_STORAGE_SZ=375 139 | ``` 140 | 141 | If adding `features.conf` file to `configMap` (see [creating configMap](#create-and-deploy-configMap-object)), then no need to set `AEROSPIKE_FEATURE_KEY_FILE` env variable in this step. Below are the default values for rest of the variables. 142 | 143 | ``` 144 | AEROSPIKE_NAMESPACE=test 145 | AEROSPIKE_REPL=2 146 | AEROSPIKE_TTL=0 147 | AEROSPIKE_FEATURE_KEY_FILE=/etc/aerospike/features.conf 148 | ``` 149 | 150 | Substitute the above variables into the `statefulset-raw-device.yaml` and deploy. 151 | 152 | ```sh 153 | $ cat statefulset-raw-device.yaml | envsubst '$AEROSPIKE_NODES $AEROSPIKE_NAMESPACE $AEROSPIKE_REPL $AEROSPIKE_MEM $AEROSPIKE_TTL $AEROSPIKE_FEATURE_KEY_FILE $AEROSPIKE_STORAGE_SZ' > statefulset.yaml 154 | ``` 155 | Deploy, 156 | 157 | ```sh 158 | $ kubectl create -f statefulset.yaml 159 | ``` 160 | 161 | #### Things to note: 162 | 163 | - The `volumeClaimTemplates` is used to request PV resource from the deployed provisioner via storageClass `aerospike-ssds`. The `volumeMode` is set to `Block` (Block device mode). 164 | ```sh 165 | ...... 166 | volumeClaimTemplates: 167 | - metadata: 168 | name: data-dev 169 | labels: *AerospikeDeploymentLabels 170 | spec: 171 | volumeMode: Block 172 | accessModes: 173 | - ReadWriteOnce 174 | storageClassName: aerospike-ssds 175 | resources: 176 | requests: 177 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 178 | ``` 179 | - `volumeDevices` (block mode) must use the same name as specified in `volumeClaimTemplates` and a device path (like `/dev/xvdb` below) accessible within the container must be specified. This device path can then be used within the aerospike namespace `storage-engine` configuration. 180 | ```sh 181 | ..... 182 | volumeDevices: 183 | - name: data-dev 184 | devicePath: /dev/xvdb 185 | .... 186 | ``` 187 | 188 | ### Output: 189 | 190 | 191 | ```sh 192 | $ kubectl get pv 193 | 194 | NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE 195 | local-pv-342b45ed 375Gi RWO Delete Bound dev/data-dev-aerospike-2 aerospike-ssds 121m 196 | local-pv-3587dbec 375Gi RWO Delete Bound dev/data-dev-aerospike-0 aerospike-ssds 121m 197 | local-pv-df716a06 375Gi RWO Delete Available aerospike-ssds 121m 198 | local-pv-eaf4a027 375Gi RWO Delete Bound dev/data-dev-aerospike-1 aerospike-ssds 121m 199 | ``` 200 | 201 | ```sh 202 | Sep 18 2019 16:08:29 GMT: INFO (drv_ssd): (drv_ssd.c:3216) opened device /dev/xvdb: usable size 402653184000, io-min-size 4096 203 | Sep 18 2019 16:08:29 GMT: INFO (drv_ssd): (drv_ssd.c:1068) /dev/xvdb has 3072000 wblocks of size 131072 204 | ... 205 | Sep 18 2019 16:20:29 GMT: INFO (drv_ssd): (drv_ssd.c:1919) {test} /dev/xvdb: used-bytes 0 free-wblocks 3071936 write-q 0 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0) 206 | Sep 18 2019 16:20:29 GMT: INFO (info): (ticker.c:162) NODE-ID bb9fe910a5d3186 CLUSTER-SIZE 3 207 | ... 208 | ``` 209 | 210 | ```sh 211 | $ kubectl get all --namespace dev 212 | 213 | NAME READY STATUS RESTARTS AGE 214 | pod/aerospike-0 1/1 Running 0 21m 215 | pod/aerospike-1 1/1 Running 0 12m 216 | pod/aerospike-2 1/1 Running 0 11m 217 | pod/local-volume-provisioner-lp5h7 1/1 Running 0 54m 218 | pod/local-volume-provisioner-vwpd5 1/1 Running 0 122m 219 | 220 | NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 221 | service/aerospike ClusterIP None 3000/TCP 13m 222 | 223 | NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE 224 | daemonset.apps/local-volume-provisioner 2 2 2 2 2 123m 225 | 226 | NAME READY AGE 227 | statefulset.apps/aerospike 3/3 21m 228 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /examples/shadow-device/README.md: -------------------------------------------------------------------------------- 1 | ## Example - Deploy an Aerospike cluster with namespace data storage on local SSDs and with Shadow Device configuration 2 | 3 | ### Description 4 | 5 | This example includes: 6 | 7 | - Deploying an Aerospike cluster with namespace `storage-engine` as `device` (raw block device mode). 8 | - Use Aerospike **Shadow Device configuration** to guarantee persistence. 9 | 10 | In cloud environments, the direct-attached or local SSDs (also called as ephemeral drives/volumes) does not guarantee persistence. These volumes are created along with the instance, and purged when the instance stops. The local ephemeral volumes are much faster compared to persistent disks which are network attached (for example, EBS volumes on AWS). Aerospike allows the [configuration of shadow devices](https://www.aerospike.com/docs/operations/configure/namespace/storage/#recipe-for-shadow-device) where all the writes are also propagated to a secondary persistent storage device. 11 | 12 | ```sh 13 | storage-engine device{ 14 | device /dev/sdb /dev/sdf 15 | device /dev/sdc /dev/sdg 16 | ... 17 | } 18 | ``` 19 | - Configure and deploy a local volume provisioner to manage local SSDs and automate volume provisioning for Aerospike pods. 20 | 21 | Let's get started. 22 | 23 | In this example, we will set and use the Kubernetes `namespace` as `dev` and `app` name as `aerospike-test`. 24 | 25 | ### Create namespace `dev` 26 | 27 | The namespace definition is present in [namespace.yaml](namespace.yaml) 28 | ```sh 29 | $ kubectl create -f namespace.yaml 30 | ``` 31 | ```sh 32 | $ kubectl get namespaces 33 | 34 | NAME STATUS AGE 35 | default Active 10d 36 | dev Active 6s 37 | kube-public Active 10d 38 | kube-system Active 10d 39 | ``` 40 | 41 | ### Create discovery directory and link the devices 42 | 43 | Before deploying local volume provisioner, create a discovery directory on each worker node and link the block devices to be used into the discovery directory. The provisioner will discover local block volumes from this directory. 44 | 45 | In this example, there are two local SSDs (identified as `/dev/sdb` and `/dev/sdc`) attached to each worker node (we have two worker nodes in this example) which can be used for the Aerospike Cluster deployment. 46 | 47 | ``` 48 | $ lsblk 49 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 50 | sdb 8:16 0 375G 0 disk 51 | sdc 8:32 0 375G 0 disk 52 | ``` 53 | 54 | ```sh 55 | $ mkdir /mnt/disks 56 | ``` 57 | 58 | Use unique device IDs rather than the names `/dev/sdb` or `/dev/sdc`. 59 | 60 | ```sh 61 | $ ln -s /dev/disk/by-id/local-ssd-0 /mnt/disks 62 | $ ln -s /dev/disk/by-id/local-ssd-1 /mnt/disks 63 | ``` 64 | 65 | > Note :
You can use also your own discovery directory, but make sure that the [provisioner](aerospike-local-volume-provisioner.yaml) is also configured to point to the same directory. 66 | 67 | ### Configure and deploy local volume provisioner 68 | 69 | To automate the local volume provisioning, we will create and run a provisioner based on [kubernetes-sigs/sig-storage-local-static-provisioner](https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner). 70 | 71 | The provisioner will run as a `DaemonSet` which will manage the local SSDs on each node based on a discovery directory, create/delete the PersistentVolumes and clean up the storage when it is released. 72 | 73 | The local volume static provisioner for this example is defined in [aerospike-local-volume-provisioner.yaml](aerospike-local-volume-provisioner.yaml). Each specification is highlighted with comments in the same file. 74 | 75 | Deploy the provisioner, 76 | 77 | ```sh 78 | $ kubectl create -f aerospike-local-volume-provisioner.yaml 79 | 80 | configmap/local-provisioner-config created 81 | daemonset.apps/local-volume-provisioner created 82 | storageclass.storage.k8s.io/aerospike-ssds created 83 | serviceaccount/local-storage-admin created 84 | clusterrolebinding.rbac.authorization.k8s.io/local-storage-provisioner-pv-binding created 85 | clusterrole.rbac.authorization.k8s.io/local-storage-provisioner-node-clusterrole created 86 | clusterrolebinding.rbac.authorization.k8s.io/local-storage-provisioner-node-binding created 87 | ``` 88 | 89 | Verify the discovered and created PV objects, 90 | ```sh 91 | $ kubectl get pv 92 | 93 | NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE 94 | local-pv-342b45ed 375Gi RWO Delete Available aerospike-ssds 3s 95 | local-pv-3587dbec 375Gi RWO Delete Available aerospike-ssds 3s 96 | local-pv-df716a06 375Gi RWO Delete Available aerospike-ssds 3s 97 | local-pv-eaf4a027 375Gi RWO Delete Available aerospike-ssds 3s 98 | ``` 99 | 100 | Note that the `storageclass` configured here is `aerospike-ssds`. We will use this storageclass in PVC or volumeClaimTemplates to talk to the provisioner and request PV resources (See [Statefulset definition](#deploy-aerospike-cluster-using-a-statefulset-defintion)). 101 | 102 | ### Provisioning Shadow device volumes 103 | 104 | Define a `storageClass` for provisioning of 'shadow device' persistent disks. Kubernetes allows [Dynamic Volume Provisioning](https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/) (create storage volumes on-demand) using pre-created [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/). 105 | 106 | For this example, we will create a StorageClass `shadow` which uses `gce-pd` provisioner (since this setup is running on GKE) and specify the parameters as `type: pd-ssd` (volume type). Please check [storageclass-gcp.yaml](storageclass-gcp.yaml) 107 | 108 | ```sh 109 | $ kubectl create -f storageclass-gcp.yaml 110 | ``` 111 | 112 | ### Create and deploy ConfigMap object 113 | 114 | - The [configmap](configmap) directory contains the Aerospike configuration file template for this example - `aerospike.template.conf`. 115 | - Add the `feature-key-file` (Enterprise License) to the [configmap](configmap) directory. Feature-key-file (`features.conf`) is required to run Aerospike Server Enterprise Edition. 116 | 117 | Now the [configmap](configmap) directory will contain two files - `aerospike.template.conf` and `features.conf`. 118 | 119 | Create configMap object, 120 | 121 | ```sh 122 | $ kubectl create configmap aerospike-conf -n dev --from-file=configmap/ 123 | ``` 124 | 125 | > Note :
For this example, we will configure only a single Aerospike Namespace with data storage on a single raw block volume with a shadow device. If you prefer to use multiple namespaces, please use a custom aerospike.conf file or template accordingly. 126 | 127 | Note that `storage-engine` configuration in `aerospike.template.conf` is using a primary block device `/dev/xvdb` and a secondary 'shadow device' `/dev/xvdf`. You can also use multiple raw devices in the storage-engine configuration, but make sure that each of them have a corresponding PVC through `volumeClaimTemplates` in the statefulset definition (Check [Things to note](#things-to-note) section). 128 | ``` 129 | ... 130 | storage-engine device { 131 | device /dev/xvdb /dev/xvdf # Shadow device configuration. 132 | # device /dev/ /dev/ # (optional) another raw device / shadow device. 133 | write-block-size 128K 134 | # data-in-memory true # Store data in memory in addition to file. 135 | } 136 | ... 137 | ``` 138 | 139 | ### Create and run a 'headless' service (for DNS lookup) 140 | 141 | For this example, we will use the Service defined in [service.yaml](service.yaml) 142 | 143 | ```sh 144 | $ kubectl create -f service.yaml 145 | ``` 146 | 147 | 148 | ### Deploy Aerospike cluster using a statefulset defintion 149 | 150 | For this example, the statefulset definition is present in [statefulset-shadow-device.yaml](statefulset-shadow-device.yaml). 151 | 152 | Set necessary variables (rest are optional), 153 | 154 | ```sh 155 | export AEROSPIKE_NODES=3 156 | export AEROSPIKE_MEM=1 157 | export AEROSPIKE_STORAGE_SZ=375 158 | ``` 159 | 160 | If adding `features.conf` file to `configMap` (see [creating configMap](#create-and-deploy-configMap-object)), then no need to set `AEROSPIKE_FEATURE_KEY_FILE` env variable in this step. Below are the default values for rest of the variables. 161 | 162 | ``` 163 | AEROSPIKE_NAMESPACE=test 164 | AEROSPIKE_REPL=2 165 | AEROSPIKE_TTL=0 166 | AEROSPIKE_FEATURE_KEY_FILE=/etc/aerospike/features.conf 167 | ``` 168 | 169 | Substitute the above variables into the `statefulset-shadow-device.yaml` and deploy. 170 | 171 | ```sh 172 | $ cat statefulset-shadow-device.yaml | envsubst '$AEROSPIKE_NODES $AEROSPIKE_NAMESPACE $AEROSPIKE_REPL $AEROSPIKE_MEM $AEROSPIKE_TTL $AEROSPIKE_FEATURE_KEY_FILE $AEROSPIKE_STORAGE_SZ' > statefulset.yaml 173 | ``` 174 | Deploy, 175 | 176 | ```sh 177 | $ kubectl create -f statefulset.yaml 178 | ``` 179 | 180 | #### Things to note: 181 | 182 | - The `volumeClaimTemplates` is used to request PV resource from the deployed provisioner via storageClass `aerospike-ssds`. The `volumeMode` is set to `Block` (Block device mode). For the shadow device volumes, we will be using the storageClass `shadow` created in [Provisioning shadow device volumes](#provisioning-shadow-device-volumes). 183 | ```sh 184 | ...... 185 | volumeClaimTemplates: 186 | - metadata: 187 | name: data-dev 188 | labels: *AerospikeDeploymentLabels 189 | spec: 190 | volumeMode: Block 191 | accessModes: 192 | - ReadWriteOnce 193 | storageClassName: aerospike-ssds 194 | resources: 195 | requests: 196 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 197 | - metadata: 198 | name: shadow-dev 199 | labels: *AerospikeDeploymentLabels 200 | spec: 201 | volumeMode: Block 202 | accessModes: 203 | - ReadWriteOnce 204 | storageClassName: shadow 205 | resources: 206 | requests: 207 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 208 | ``` 209 | - `volumeDevices` (block mode) must use the same name as specified in `volumeClaimTemplates` and a device path (like `/dev/xvdb` and `/dev/xvdf`below) accessible within the container must be specified. This device path can then be used within the aerospike namespace `storage-engine` configuration. 210 | ```sh 211 | ..... 212 | volumeDevices: 213 | - name: data-dev 214 | devicePath: /dev/xvdb 215 | - name: shadow-dev 216 | devicePath: /dev/xvdf 217 | .... 218 | ``` 219 | 220 | ### Output: 221 | 222 | 223 | ```sh 224 | $ kubectl get pv 225 | 226 | NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE 227 | local-pv-342b45ed 375Gi RWO Delete Available aerospike-ssds 6m56s 228 | local-pv-3587dbec 375Gi RWO Delete Bound dev/data-dev-aerospike-1 aerospike-ssds 7m32s 229 | local-pv-df716a06 375Gi RWO Delete Bound dev/data-dev-aerospike-2 aerospike-ssds 8m05s 230 | local-pv-eaf4a027 375Gi RWO Delete Bound dev/data-dev-aerospike-0 aerospike-ssds 6m56s 231 | pvc-b7285001-da43-11e9-ac74-42010aa0014b 375Gi RWO Delete Bound dev/shadow-dev-aerospike-0 shadow 3m56s 232 | pvc-3421ed54-d944-11e9-ac74-42010aa0014b 375Gi RWO Delete Bound dev/shadow-dev-aerospike-1 shadow 7m05s 233 | pvc-5ca77b01-d944-11e9-ac74-42010aa0014b 375Gi RWO Delete Bound dev/shadow-dev-aerospike-2 shadow 7m55s 234 | ``` 235 | 236 | ```sh 237 | Sep 18 2019 18:41:10 GMT: INFO (drv_ssd): (drv_ssd.c:3216) opened device /dev/xvdb: usable size 402653184000, io-min-size 4096 238 | Sep 18 2019 18:41:10 GMT: INFO (drv_ssd): (drv_ssd.c:3270) shadow device /dev/xvdf is compatible with main device, shadow-io-min-size 512 239 | Sep 18 2019 18:41:10 GMT: INFO (drv_ssd): (drv_ssd.c:1068) /dev/xvdb has 3072000 wblocks of size 131072 240 | ... 241 | Sep 18 2019 16:20:29 GMT: INFO (drv_ssd): (drv_ssd.c:1919) {test} /dev/xvdb: used-bytes 0 free-wblocks 3071936 write-q 0 write (0,0.0) defrag-q 0 defrag-read (0,0.0) defrag-write (0,0.0) 242 | Sep 18 2019 16:20:29 GMT: INFO (info): (ticker.c:162) NODE-ID bb9fe910a5d3186 CLUSTER-SIZE 3 243 | ... 244 | ``` 245 | 246 | ```sh 247 | $ kubectl get all --namespace dev 248 | 249 | NAME READY STATUS RESTARTS AGE 250 | pod/aerospike-0 1/1 Running 0 21m 251 | pod/aerospike-1 1/1 Running 0 12m 252 | pod/aerospike-2 1/1 Running 0 11m 253 | pod/local-volume-provisioner-lp5h7 1/1 Running 0 54m 254 | pod/local-volume-provisioner-vwpd5 1/1 Running 0 122m 255 | 256 | NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 257 | service/aerospike ClusterIP None 3000/TCP 13m 258 | 259 | NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE 260 | daemonset.apps/local-volume-provisioner 2 2 2 2 2 123m 261 | 262 | NAME READY AGE 263 | statefulset.apps/aerospike 3/3 21m 264 | ``` -------------------------------------------------------------------------------- /helm/values.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | ### 19 | ### Configuration file to set default values for Helm Chart deployment 20 | ### 21 | 22 | ### ------------------------------------- 23 | ### Statefulset and K8s config variables 24 | ### ------------------------------------- 25 | 26 | # Number of replicas 27 | dbReplicas: 3 # Also controls number of nodes in the aerospike cluster. 28 | 29 | # Number of seconds to wait after SIGTERM before force killing the pod. 30 | terminationGracePeriodSeconds: 600 31 | 32 | # liveness and readiness probe parameters (for aerospike containers) 33 | livenessProbe: {} 34 | # initialDelaySeconds: 30 35 | # periodSeconds: 30 36 | # timeoutSeconds: 1 37 | # successThreshold: 1 38 | # failureThreshold: 3 39 | readinessProbe: {} 40 | # initialDelaySeconds: 30 41 | # periodSeconds: 10 42 | # timeoutSeconds: 1 43 | # successThreshold: 1 44 | # failureThreshold: 3 45 | 46 | # K8s Cluster Service DNS Domain 47 | clusterServiceDnsDomain: cluster.local 48 | 49 | ### ----------------------------------------- 50 | ### Aerospike server enterprise docker image 51 | ### ----------------------------------------- 52 | 53 | image: 54 | repository: aerospike/aerospike-server-enterprise 55 | tag: 5.5.0.7 56 | 57 | ### ------------------------------- 58 | ### Aerospike init container image 59 | ### ------------------------------- 60 | 61 | initImage: 62 | repository: aerospike/aerospike-kubernetes-init 63 | tag: latest 64 | 65 | 66 | ### --------------------------------- 67 | ### Aerospike related configurations 68 | ### --------------------------------- 69 | 70 | # Auto generate and assign node-id(s) based on Pod's Ordinal Index. 71 | autoGenerateNodeIds: true 72 | # nodeIDPrefix: "a" # (optional) must be in hex only 73 | 74 | # Default Namespace related configuration 75 | 76 | # aerospikeNamespace: "test" 77 | # aerospikeNamespaceMemoryGB: "1" 78 | # aerospikeReplicationFactor: "2" 79 | # aerospikeDefaultTTL: "0" 80 | 81 | # Aerospike enterprise feature key file path (when using mounted volumes to share license key) 82 | 83 | # aerospikeFeatureKeyFilePath: "" 84 | 85 | # Aerospike TCP ports 86 | 87 | # aerospikeClientPort: 3000 88 | # aerospikeHeartbeatPort: 3002 89 | # aerospikeFabricPort: 3001 90 | # aerospikeInfoPort: 3003 91 | 92 | 93 | ### ----------------------------------------- 94 | ### Aerospike Cluster Security Configuration 95 | ### ----------------------------------------- 96 | 97 | # Provide 'username' and 'password' for a user with "user-admin" privilege which already exists on the cluster. 98 | # Default: admin/admin. 99 | # Specify 'helmUsername' and 'helmPassword' for a "sys-admin" that will be created at the runtime. 100 | security: {} 101 | # enabled: false 102 | # username: "admin" 103 | # password: "admin" 104 | # helmUsername: "helm_operator" 105 | # helmPassword: "helm_operator" 106 | # authMode: "internal" 107 | 108 | ### ----------------------------- 109 | ### Aerospike TLS Configuration 110 | ### ----------------------------- 111 | 112 | # Define TLS certificates 113 | # 1. Provide base64 encoded version of certificates using format "b64enc:" 114 | # OR, 115 | # 2. Provide file path to certificates accessible inside the container using format "file:" 116 | tlsConfig: [] 117 | # - tlsName: "aerospike-client" 118 | # tlsCAFile: "b64enc:LS0tLS1CRUdJTiBDCACERT" 119 | # tlsCertFile: "b64enc:Q2VydGlmaWNhdGCERT" 120 | # tlsKeyFile: "b64enc:LS0tLS1CRUdJTiBDKEY" 121 | # - tlsName: "aerospike-cluster" 122 | # tlsCAFile: "file:/secrets/certs/aerocacert.pem" 123 | # tlsCertFile: "file:/secrets/certs/aerocert.pem" 124 | # tlsKeyFile: "file:/secrets/certs/aerokey.pem" 125 | 126 | # Define Aerospike network TLS configuration 127 | aerospikeNetworkTLSConfig: {} 128 | # service: 129 | # tlsOnly: true 130 | # tlsName: aerospike-client 131 | # tlsPort: 4333 132 | # mutualAuthentication: true 133 | # heartbeat: 134 | # tlsOnly: true 135 | # tlsName: aerospike-cluster 136 | # tlsPort: 3012 137 | # fabric: 138 | # tlsOnly: true 139 | # tlsName: aerospike-cluster 140 | # tlsPort: 3011 141 | 142 | ### ----------------------------------- 143 | ### Deployment specific configurations 144 | ### ----------------------------------- 145 | 146 | # Arguments that are passed to the Aerospike container 147 | # args: [] 148 | 149 | # Rollout ConfigMap/Secrets changes on 'helm upgrade' 150 | # Alternatively, use 'kubectl rollout restart' 151 | autoRolloutConfig: false 152 | 153 | # Networking 154 | 155 | # HostNetworking 156 | hostNetwork: 157 | enabled: false 158 | useExternalIP: false 159 | 160 | # Enable NodePort Services (Type: NodePort) to expose aerospike statefulset (Use helm upgrade for scale up/down). 161 | nodePortServices: 162 | enabled: false 163 | useExternalIP: false 164 | # Extra labels for the node port services (optional) 165 | labels: {} 166 | # Extra annotations for the node port services (optional) 167 | annotations: {} 168 | 169 | # Enable LoadBalancer Services (Type: LoadBalancer) to expose aerospike statefulset (Use helm upgrade for scale up/down). 170 | loadBalancerServices: 171 | enabled: false 172 | # Extra labels for the load balancer services (optional) 173 | labels: {} 174 | # Extra annotations for load balancer services (optional) 175 | annotations: {} 176 | # cloud.google.com/load-balancer-type: "Internal" 177 | 178 | # Enable external IP Services (Type: ClusterIP) to expose aerospike statefulset (Use helm upgrade for scale up/down) 179 | externalIPServices: 180 | enabled: false 181 | externalIPEndpoints: [] 182 | # - IP: 10.160.15.199 183 | # Port: 7000 184 | # TLSPort: 7010 185 | # - IP: 10.160.15.199 186 | # Port: 7001 187 | # TLSPort: 7011 188 | # - IP: 10.160.15.199 189 | # Port: 7002 190 | # TLSPort: 7012 191 | # - IP: 10.160.15.200 192 | # Port: 7003 193 | # TLSPort: 7013 194 | # - IP: 10.160.15.200 195 | # Port: 7004 196 | # TLSPort: 7014 197 | # - IP: 10.160.15.200 198 | # Port: 8000 199 | # TLSPort: 8010 200 | # - IP: 10.160.15.217 201 | # Port: 8001 202 | # TLSPort: 8011 203 | # - IP: 10.160.15.217 204 | # Port: 8002 205 | # TLSPort: 8012 206 | # - IP: 10.160.15.217 207 | # Port: 8003 208 | # TLSPort: 8013 209 | # - IP: 10.160.15.217 210 | # Port: 8004 211 | # TLSPort: 8014 212 | # Extra labels for the external IP services (optional) 213 | labels: {} 214 | # Extra annotations for the external IP services (optional) 215 | annotations: {} 216 | 217 | # Legacy network configurations (Don't worry, these are still supported) 218 | 219 | # hostNetworking: false 220 | # enableNodePortServices: false 221 | # enableLoadBalancerServices: false 222 | # enableExternalIpServices: false 223 | # externalIpEndpoints: [] 224 | # - IP: 10.160.15.199 225 | # Port: 7000 226 | # - IP: 10.160.15.199 227 | # Port: 7001 228 | # - IP: 10.160.15.199 229 | # Port: 7002 230 | # - IP: 10.160.15.200 231 | # Port: 7003 232 | # - IP: 10.160.15.200 233 | # Port: 7004 234 | # - IP: 10.160.15.200 235 | # Port: 8000 236 | # - IP: 10.160.15.217 237 | # Port: 8001 238 | # - IP: 10.160.15.217 239 | # Port: 8002 240 | # - IP: 10.160.15.217 241 | # Port: 8003 242 | # - IP: 10.160.15.217 243 | # Port: 8004 244 | 245 | 246 | # Create and use a new ServiceAccount with a new ClusterRole for the Aerospike Statefulset deployment. If already have one, specify serviceAccountName below and set create=false. 247 | # This service account is also used for prometheus, grafana and alertmanager statefulsets when monitoring is enabled. 248 | rbac: 249 | create: true 250 | # serviceAccountName: default 251 | 252 | # Affinity / AntiAffinity configurations (For Aerospike Pods) 253 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 254 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 255 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 256 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 257 | antiAffinity: "off" 258 | antiAffinityWeight: 1 259 | affinity: {} 260 | # nodeAffinity: 261 | # requiredDuringSchedulingIgnoredDuringExecution: 262 | # nodeSelectorTerms: 263 | # - matchExpressions: 264 | # - key: kubernetes.io/hostname 265 | # operator: In 266 | # values: 267 | # - gke-gke-blr-default-pool-06a23412-0dkt 268 | 269 | # Tolerations and Taints (For Aerospike Pods) 270 | tolerations: [] 271 | # - key: "key1" 272 | # operator: "Equal" 273 | # value: "value1" 274 | # effect: "NoSchedule" 275 | # - key: "key1" 276 | # operator: "Equal" 277 | # value: "value1" 278 | # effect: "NoExecute" 279 | 280 | # Node Selector (For Aerospike Pods) 281 | nodeSelector: {} 282 | 283 | # Extra labels for the Aerospike StatefulSet 284 | labels: {} 285 | # Extra annotations for the Aerospike StatefulSet 286 | annotations: {} 287 | 288 | # Extra labels for the Aerospike pods 289 | podLabels: {} 290 | # Extra annotations for the Aerospike pods 291 | podAnnotations: {} 292 | 293 | # Define storage devices for aerospike nodes (pods) 294 | persistenceStorage: {} 295 | # - mountPath: /opt/aerospike/data 296 | # enabled: false 297 | # name: datadir 298 | # storageClass: ssd 299 | # accessMode: ReadWriteOnce 300 | # volumeMode: Filesystem 301 | # size: 1Gi 302 | # - devicePath: /dev/sdb 303 | # enabled: false 304 | # name: data-dev 305 | # storageClass: ssd 306 | # accessMode: ReadWriteOnce 307 | # size: 1Gi 308 | # volumeMode: Block 309 | 310 | # Don't specify same 'mountPath' in both 'volumes' and 'persistenceStorage' configs. 311 | volumes: 312 | - mountPath: /opt/aerospike/data 313 | name: datadir 314 | template: 315 | emptyDir: {} 316 | # - mountPath: /opt/aerospike/data2 317 | # name: datadir2 318 | # template: 319 | # emptyDir: {} 320 | 321 | # Resources - limits / requests 322 | resources: {} 323 | # limits: 324 | # cpu: 1 325 | # memory: 1Gi 326 | # requests: 327 | # cpu: 1 328 | # memory: 1Gi 329 | 330 | # Aerospike pod security context 331 | podSecurityContext: {} 332 | 333 | # Aerospike container security context 334 | securityContext: {} 335 | 336 | # Aerospike configuration file as base64 encoded string 337 | # aerospikeConfFileBase64: 338 | 339 | # Aerospike feature key file as base64 encoded string 340 | # featureKeyFileBase64: 341 | 342 | ### ----------------------------------------------------------- 343 | ### Dynamic configuration - Used during 'helm install...' etc. 344 | ### ----------------------------------------------------------- 345 | 346 | # Aerospike Configuration file path on helm "client" machine (from where the user is running 'helm install') 347 | # (new config) 348 | # aerospikeConfFile: 349 | 350 | # (old config) 351 | # confFilePath: 352 | 353 | # Aerospike feature key file path on helm "client" machine (from where the user is running 'helm install') 354 | # (new config) 355 | # featureKeyFile: 356 | 357 | # (old config) 358 | # featureKeyFilePath: 359 | 360 | # (Only when enableAerospikeMonitoring = true) Aerospike alert rules configuration file path on helm "client" machine (from where the user is running 'helm install') 361 | # (new config) 362 | # prometheus.aerospikeAlertRulesFile: 363 | 364 | # (old config) 365 | # prometheus.aerospikeAlertRulesFilePath: 366 | 367 | # (Only when enableAerospikeMonitoring = true) Alertmanager configuration file path on helm "client" machine (from where the user is running 'helm install') 368 | # (new config) 369 | # alertmanager.alertmanagerConfFile: 370 | 371 | # (old config) 372 | # alertmanager.alertmanagerConfFilePath: 373 | 374 | 375 | ### ----------------------------------------- 376 | ### Aerospike Monitoring Stack Configuration 377 | ### ----------------------------------------- 378 | 379 | # Enable Aerospike Prometheus Exporter only - sidecar - aerospike prometheus exporter. 380 | enableAerospikePrometheusExporter: false 381 | 382 | # Enable Aerospike Monitoring - sidecar prometheus exporter, Prometheus, Grafana, Alertmanager stack 383 | enableAerospikeMonitoring: false 384 | 385 | 386 | ### -------------------------------------------- 387 | ### Aerospike Prometheus Exporter configuration 388 | ### -------------------------------------------- 389 | 390 | exporterImage: 391 | repository: aerospike/aerospike-prometheus-exporter 392 | tag: latest 393 | 394 | exporter: {} 395 | # agentCertFile: "" 396 | # agentKeyFile: "" 397 | # metricLabels: "zone='asia-south1-a', platform='Google Kubernetes Engine'" 398 | # agentBindHost: "" 399 | # agentBindPort: 9145 400 | # agentTimeout: 10 401 | # agentLogFile: "" 402 | # agentLogLevel: "info" 403 | # httpBasicAuthUsername: "" 404 | # httpBasicAuthPassword: "" 405 | # aerospikeHost: "localhost" 406 | # aerospikePort: 3000 407 | # infoTimeout: 5 408 | # namespaceMetricsAllowlist: "" 409 | # setMetricsAllowlist: "" 410 | # nodeMetricsAllowlist: "" 411 | # xdrMetricsAllowlist: "" 412 | # namespaceMetricsBlocklist: "" 413 | # setMetricsBlocklist: "" 414 | # nodeMetricsBlocklist: "" 415 | # xdrMetricsBlocklist: "" 416 | 417 | # # Autoconfigured when service TLS or security enabled on aerospike cluster (user need not configure the below options for the exporter). 418 | # aerospikeCertFile: "" 419 | # aerospikeKeyFile: "" 420 | # aerospikeKeyFilePassphrase: "" 421 | # aerospikeNodeTLSName: "" 422 | # aerospikeCAFile: "" 423 | # aerospikeAuthMode: "" 424 | # aerospikeAuthUser: "" 425 | # aerospikeAuthPassword: "" 426 | 427 | 428 | ### ------------------------- 429 | ### Prometheus Configuration 430 | ### ------------------------- 431 | 432 | prometheus: 433 | # Number of replicas for prometheus statefulset 434 | replicas: 2 435 | 436 | # Prometheus server port 437 | serverPort: 9090 438 | 439 | # Prometheus statefulset configs 440 | terminationGracePeriodSeconds: 120 441 | podManagementPolicy: "Parallel" 442 | updateStrategy: 443 | type: "RollingUpdate" 444 | 445 | # liveness and readiness probe parameters (for prometheus containers) 446 | livenessProbe: {} 447 | # initialDelaySeconds: 30 448 | # periodSeconds: 10 449 | # timeoutSeconds: 10 450 | # successThreshold: 1 451 | # failureThreshold: 3 452 | readinessProbe: {} 453 | # initialDelaySeconds: 30 454 | # periodSeconds: 10 455 | # timeoutSeconds: 10 456 | # successThreshold: 1 457 | # failureThreshold: 3 458 | 459 | # Prometheus scrape_interval and evaluation_interval 460 | scrapeInterval: "15s" 461 | evaluationInterval: "15s" 462 | 463 | # Prometheus docker image 464 | image: 465 | repository: prom/prometheus 466 | tag: latest 467 | 468 | # Define storage for Prometheus data 469 | persistenceStorage: 470 | # mountPath: /data 471 | # enabled: false 472 | # name: prometheus-data 473 | # storageClass: standard 474 | # accessMode: ReadWriteOnce 475 | # volumeMode: Filesystem 476 | # size: 1Gi 477 | volume: 478 | mountPath: /data 479 | name: prometheus-data 480 | template: 481 | emptyDir: {} 482 | 483 | # Resources - limits / requests 484 | resources: {} 485 | # limits: 486 | # cpu: 1 487 | # memory: 1Gi 488 | # requests: 489 | # cpu: 1 490 | # memory: 1Gi 491 | 492 | # Tolerations and Taints (For Prometheus Pods) 493 | tolerations: [] 494 | # - key: "type" 495 | # operator: "Equal" 496 | # value: "monitoring" 497 | # effect: "NoSchedule" 498 | 499 | # Node Selector (For Prometheus Pods) 500 | nodeSelector: {} 501 | 502 | # Extra labels for the Prometheus StatefulSet 503 | labels: {} 504 | # Extra annotations for the Prometheus StatefulSet 505 | annotations: {} 506 | 507 | # Extra labels for the Prometheus pods 508 | podLabels: {} 509 | # Extra annotations for the Prometheus pods 510 | podAnnotations: {} 511 | 512 | # Affinity / AntiAffinity configurations (For Prometheus Pods) 513 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 514 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 515 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 516 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 517 | antiAffinity: "off" 518 | antiAffinityWeight: 1 519 | affinity: {} 520 | # nodeAffinity: 521 | # requiredDuringSchedulingIgnoredDuringExecution: 522 | # nodeSelectorTerms: 523 | # - matchExpressions: 524 | # - key: kubernetes.io/hostname 525 | # operator: In 526 | # values: 527 | # - gke-gke-blr-default-pool-06a23412-0dkt 528 | 529 | # Aerospike alert rules configuration file path on helm "client" machine (from where the user is running 'helm install') 530 | # (new config) 531 | # aerospikeAlertRulesFile: 532 | # (old config) 533 | # aerospikeAlertRulesFilePath: 534 | 535 | # Alert rules file as base64 encoded string 536 | # aerospikeAlertRulesFileBase64: 537 | 538 | 539 | ### ---------------------- 540 | ### Grafana Configuration 541 | ### ---------------------- 542 | 543 | grafana: 544 | # Number of replicas for grafana statefulset 545 | replicas: 1 546 | 547 | # Grafana server http_port 548 | httpPort: 3000 549 | 550 | # Grafana docker image 551 | image: 552 | repository: grafana/grafana 553 | tag: latest 554 | 555 | # Grafana statefulset configs 556 | terminationGracePeriodSeconds: 120 557 | 558 | # liveness and readiness probe parameters (for grafana containers) 559 | livenessProbe: {} 560 | # initialDelaySeconds: 30 561 | # periodSeconds: 10 562 | # timeoutSeconds: 10 563 | # successThreshold: 1 564 | # failureThreshold: 10 565 | readinessProbe: {} 566 | # initialDelaySeconds: 30 567 | # periodSeconds: 10 568 | # timeoutSeconds: 10 569 | # successThreshold: 1 570 | # failureThreshold: 10 571 | 572 | # Define storage for grafana data 573 | persistenceStorage: 574 | # mountPath: /var/lib/grafana 575 | # enabled: false 576 | # name: grafana-data 577 | # storageClass: standard 578 | # accessMode: ReadWriteOnce 579 | # volumeMode: Filesystem 580 | # size: 1Gi 581 | volume: 582 | mountPath: /var/lib/grafana 583 | name: grafana-data 584 | template: 585 | emptyDir: {} 586 | 587 | # Grafana plugins to install at startup 588 | plugins: "camptocamp-prometheus-alertmanager-datasource" 589 | 590 | # Grafana username and password 591 | user: "admin" 592 | password: "admin" 593 | 594 | # Resources - limits / requests 595 | resources: {} 596 | # limits: 597 | # cpu: 1 598 | # memory: 1Gi 599 | # requests: 600 | # cpu: 1 601 | # memory: 1Gi 602 | 603 | # Tolerations and Taints (For Grafana Pods) 604 | tolerations: [] 605 | # - key: "type" 606 | # operator: "Equal" 607 | # value: "monitoring" 608 | # effect: "NoSchedule" 609 | 610 | # Node Selector (For Grafana Pods) 611 | nodeSelector: {} 612 | 613 | # Extra labels for the Grafana StatefulSet 614 | labels: {} 615 | # Extra annotations for the Grafana StatefulSet 616 | annotations: {} 617 | 618 | # Extra labels for the Grafana pods 619 | podLabels: {} 620 | # Extra annotations for the Grafana pods 621 | podAnnotations: {} 622 | 623 | # Affinity / AntiAffinity configurations (For Grafana Pods) 624 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 625 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 626 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 627 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 628 | antiAffinity: "off" 629 | antiAffinityWeight: 1 630 | affinity: {} 631 | # nodeAffinity: 632 | # requiredDuringSchedulingIgnoredDuringExecution: 633 | # nodeSelectorTerms: 634 | # - matchExpressions: 635 | # - key: kubernetes.io/hostname 636 | # operator: In 637 | # values: 638 | # - gke-gke-blr-default-pool-06a23412-0dkt 639 | 640 | 641 | ### --------------------------- 642 | ### Alertmanager Configuration 643 | ### --------------------------- 644 | 645 | alertmanager: 646 | # Number of replicas for alertmanager statefulset 647 | replicas: 1 648 | 649 | # Alertmanager web port and gossip port 650 | webPort: 9093 651 | meshPort: 9094 652 | 653 | # Alertmanager statefulset configs 654 | terminationGracePeriodSeconds: 120 655 | podManagementPolicy: "OrderedReady" 656 | updateStrategy: 657 | type: "RollingUpdate" 658 | 659 | # liveness and readiness probe parameters (for grafana containers) 660 | livenessProbe: {} 661 | # initialDelaySeconds: 30 662 | # periodSeconds: 10 663 | # timeoutSeconds: 10 664 | # successThreshold: 1 665 | # failureThreshold: 10 666 | readinessProbe: {} 667 | # initialDelaySeconds: 30 668 | # periodSeconds: 10 669 | # timeoutSeconds: 10 670 | # successThreshold: 1 671 | # failureThreshold: 10 672 | 673 | # Alertmanager docker image 674 | image: 675 | repository: prom/alertmanager 676 | tag: latest 677 | 678 | # Alertmanager logging level 679 | loglevel: info 680 | 681 | # Define storage for alertmanager data 682 | persistenceStorage: 683 | # mountPath: /data 684 | # enabled: false 685 | # name: alertmanager-data 686 | # storageClass: standard 687 | # accessMode: ReadWriteOnce 688 | # volumeMode: Filesystem 689 | # size: 1Gi 690 | volume: 691 | mountPath: /data 692 | name: alertmanager-data 693 | template: 694 | emptyDir: {} 695 | 696 | # Resources - limits / requests 697 | resources: {} 698 | # limits: 699 | # cpu: 1 700 | # memory: 1Gi 701 | # requests: 702 | # cpu: 1 703 | # memory: 1Gi 704 | 705 | # Tolerations and Taints (For Alertmanager Pods) 706 | tolerations: [] 707 | # - key: "type" 708 | # operator: "Equal" 709 | # value: "monitoring" 710 | # effect: "NoSchedule" 711 | 712 | # Node Selector (For Alertmanager Pods) 713 | nodeSelector: {} 714 | 715 | # Extra labels for the Alertmanager StatefulSet 716 | labels: {} 717 | # Extra annotations for the Alertmanager StatefulSet 718 | annotations: {} 719 | 720 | # Extra labels for the Alertmanager pods 721 | podLabels: {} 722 | # Extra annotations for the Alertmanager pods 723 | podAnnotations: {} 724 | 725 | # Affinity / AntiAffinity configurations (For Alertmanager Pods) 726 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 727 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 728 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 729 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 730 | antiAffinity: "off" 731 | antiAffinityWeight: 1 732 | affinity: {} 733 | # nodeAffinity: 734 | # requiredDuringSchedulingIgnoredDuringExecution: 735 | # nodeSelectorTerms: 736 | # - matchExpressions: 737 | # - key: kubernetes.io/hostname 738 | # operator: In 739 | # values: 740 | # - gke-gke-blr-default-pool-06a23412-0dkt 741 | 742 | # Alertmanager configuration file path on helm "client" machine (from where the user is running 'helm install') 743 | # (new config) 744 | # alertmanagerConfFile: 745 | # (old config) 746 | # alertmanagerConfFilePath: 747 | 748 | # Alertmanager configuration file as base64 encoded string 749 | # alertmanagerConfFileBase64: 750 | -------------------------------------------------------------------------------- /helm/templates/statefulset.yaml: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------ 2 | # Copyright 2012-2021 Aerospike, Inc. 3 | # 4 | # Portions may be licensed to Aerospike, Inc. under one or more contributor 5 | # license agreements. 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | # use this file except in compliance with the License. You may obtain a copy of 9 | # the License at http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | # ------------------------------------------------------------------------------ 17 | 18 | ## Aerospike Statefulset definition. 19 | 20 | apiVersion: apps/v1 21 | kind: StatefulSet 22 | metadata: 23 | name: {{ template "aerospike.fullname" . }} 24 | namespace: {{ .Release.Namespace }} 25 | labels: &AerospikeDeploymentLabels 26 | app: {{ template "aerospike.name" . }} 27 | chart: {{ .Chart.Name }} 28 | release: {{ .Release.Name }} 29 | unique-app: {{ .Release.Name }}-aerospike 30 | {{- with .Values.labels }}{{ toYaml . | nindent 4 }}{{ end }} 31 | {{- with .Values.annotations }} 32 | annotations: {{- toYaml . | nindent 4 }} 33 | {{- end }} 34 | spec: 35 | serviceName: {{ template "aerospike.fullname" . }} 36 | selector: 37 | matchLabels: 38 | <<: *AerospikeDeploymentLabels 39 | {{- with .Values.podLabels }}{{ toYaml . | nindent 6 }}{{ end }} 40 | replicas: {{ .Values.dbReplicas }} 41 | template: 42 | metadata: 43 | labels: 44 | <<: *AerospikeDeploymentLabels 45 | {{- with .Values.podLabels }}{{ toYaml . | nindent 8 }}{{ end }} 46 | annotations: 47 | {{- if .Values.autoRolloutConfig }} 48 | checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} 49 | checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} 50 | {{- end }} 51 | {{- with .Values.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }} 52 | spec: 53 | serviceAccountName: {{ if .Values.rbac.create }}{{ template "aerospike.fullname" . }}{{ else }}{{ .Values.rbac.serviceAccountName }}{{ end }} 54 | {{- if eq .Values.antiAffinity "hard" }} 55 | affinity: 56 | {{- with .Values.affinity }} 57 | {{ toYaml . | indent 8 }} 58 | {{- end }} 59 | podAntiAffinity: 60 | requiredDuringSchedulingIgnoredDuringExecution: 61 | - topologyKey: "kubernetes.io/hostname" 62 | labelSelector: 63 | matchExpressions: 64 | - key: unique-app 65 | operator: In 66 | values: 67 | - {{ .Release.Name }}-aerospike 68 | {{- else if eq .Values.antiAffinity "soft" }} 69 | affinity: 70 | {{- with .Values.affinity }} 71 | {{ toYaml . | indent 8 }} 72 | {{- end }} 73 | podAntiAffinity: 74 | preferredDuringSchedulingIgnoredDuringExecution: 75 | - weight: {{ .Values.antiAffinityWeight }} 76 | podAffinityTerm: 77 | topologyKey: kubernetes.io/hostname 78 | labelSelector: 79 | matchExpressions: 80 | - key: unique-app 81 | operator: In 82 | values: 83 | - {{ .Release.Name }}-aerospike 84 | {{- else}} 85 | {{- with .Values.affinity }} 86 | affinity: {{ toYaml . | nindent 8 }} 87 | {{- end }} 88 | {{- end }} 89 | {{- if or .Values.hostNetworking .Values.hostNetwork.enabled }} 90 | hostNetwork: true 91 | dnsPolicy: ClusterFirstWithHostNet 92 | {{- end }} 93 | terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds | default 600 }} 94 | {{- with .Values.tolerations }} 95 | tolerations: {{- toYaml . | nindent 8 }} 96 | {{- end }} 97 | {{- with .Values.nodeSelector }} 98 | nodeSelector: {{- toYaml . | nindent 8 }} 99 | {{- end }} 100 | securityContext: 101 | {{ toYaml .Values.podSecurityContext | indent 8 }} 102 | containers: 103 | - name: aerospike 104 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 105 | {{- with .Values.args }} 106 | args: {{- toYaml . | nindent 10 }} 107 | {{- end }} 108 | securityContext: 109 | {{ toYaml .Values.securityContext | indent 10 }} 110 | ports: 111 | {{- if .Values.aerospikeNetworkTLSConfig.service }} 112 | - name: aero-client-tls 113 | containerPort: {{ .Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 }} 114 | {{- if ne (default false .Values.aerospikeNetworkTLSConfig.service.tlsOnly) true }} 115 | - name: aero-client 116 | containerPort: {{ .Values.aerospikeClientPort | default 3000 }} 117 | {{- end }} 118 | {{- else }} 119 | - name: aero-client 120 | containerPort: {{ .Values.aerospikeClientPort | default 3000 }} 121 | {{- end }} 122 | {{- if .Values.aerospikeNetworkTLSConfig.heartbeat }} 123 | - name: aero-mesh-tls 124 | containerPort: {{ .Values.aerospikeNetworkTLSConfig.heartbeat.tlsPort | default 3012 }} 125 | {{- if ne (default false .Values.aerospikeNetworkTLSConfig.heartbeat.tlsOnly) true }} 126 | - name: aero-mesh 127 | containerPort: {{ .Values.aerospikeHeartbeatPort | default 3002 }} 128 | {{- end }} 129 | {{- else }} 130 | - name: aero-mesh 131 | containerPort: {{ .Values.aerospikeHeartbeatPort | default 3002 }} 132 | {{- end }} 133 | {{- if .Values.aerospikeNetworkTLSConfig.fabric }} 134 | - name: aero-fabric-tls 135 | containerPort: {{ .Values.aerospikeNetworkTLSConfig.fabric.tlsPort | default 3011 }} 136 | {{- if ne (default false .Values.aerospikeNetworkTLSConfig.fabric.tlsOnly) true }} 137 | - name: aero-fabric 138 | containerPort: {{ .Values.aerospikeFabricPort | default 3001 }} 139 | {{- end }} 140 | {{- else }} 141 | - name: aero-fabric 142 | containerPort: {{ .Values.aerospikeFabricPort | default 3001 }} 143 | {{- end }} 144 | - containerPort: {{ .Values.aerospikeInfoPort | default 3003 }} 145 | name: aero-info 146 | lifecycle: 147 | postStart: 148 | exec: 149 | command: 150 | - /bin/sh 151 | - -c 152 | - "/etc/aerospike/aku-adm --operation post-start --log-level debug" 153 | preStop: 154 | exec: 155 | command: 156 | - /bin/sh 157 | - -c 158 | - "/etc/aerospike/aku-adm --operation pre-stop --log-level debug" 159 | livenessProbe: 160 | exec: 161 | command: 162 | - /bin/sh 163 | - -c 164 | - "/etc/aerospike/aku-adm --operation liveness --log-level debug" 165 | initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 30 }} 166 | periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30 }} 167 | timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 1 }} 168 | successThreshold: {{ .Values.livenessProbe.successThreshold | default 1 }} 169 | failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 3 }} 170 | readinessProbe: 171 | tcpSocket: 172 | {{- if .Values.aerospikeNetworkTLSConfig.service }} 173 | {{- if ne (default false .Values.aerospikeNetworkTLSConfig.service.tlsOnly) true }} 174 | port: {{ .Values.aerospikeClientPort | default 3000 }} 175 | {{- else }} 176 | port: {{ .Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 }} 177 | {{- end }} 178 | {{- else }} 179 | port: {{ .Values.aerospikeClientPort | default 3000 }} 180 | {{- end }} 181 | initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 30 }} 182 | periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 10 }} 183 | timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 1 }} 184 | successThreshold: {{ .Values.readinessProbe.successThreshold | default 1 }} 185 | failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 3 }} 186 | volumeMounts: 187 | - name: confdir 188 | mountPath: /etc/aerospike 189 | {{- range $pv := .Values.persistenceStorage }} 190 | {{- if $pv.enabled }} 191 | {{- if eq $pv.volumeMode "Filesystem"}} 192 | - name: {{ $pv.name | quote }} 193 | mountPath: {{ $pv.mountPath | quote }} 194 | {{- end }} 195 | {{- end }} 196 | {{- end }} 197 | {{- range $lv := .Values.volumes }} 198 | - name: {{ $lv.name | quote }} 199 | mountPath: {{ $lv.mountPath | quote }} 200 | {{- end }} 201 | volumeDevices: 202 | {{- range $pv := .Values.persistenceStorage }} 203 | {{- if $pv.enabled }} 204 | {{- if eq $pv.volumeMode "Block"}} 205 | - name: {{ $pv.name | quote }} 206 | devicePath: {{ $pv.devicePath | quote }} 207 | {{- end }} 208 | {{- end }} 209 | {{- end }} 210 | resources: 211 | {{ toYaml .Values.resources | indent 10 }} 212 | env: 213 | - name: NAMESPACE 214 | value: {{ .Values.aerospikeNamespace | default "test" | quote }} 215 | - name: REPL_FACTOR 216 | value: {{ .Values.aerospikeReplicationFactor | default "2" | quote }} 217 | - name: MEM_GB 218 | value: {{ .Values.aerospikeNamespaceMemoryGB | default "1" | quote }} 219 | - name: DEFAULT_TTL 220 | value: {{ .Values.aerospikeDefaultTTL | default "0" | quote }} 221 | - name: FEATURE_KEY_FILE 222 | value: {{ .Values.aerospikeFeatureKeyFilePath | default "" | quote }} 223 | - name: SERVICE_PORT 224 | value: {{ .Values.aerospikeClientPort | default 3000 | quote }} 225 | - name: HB_PORT 226 | value: {{ .Values.aerospikeHeartbeatPort | default 3002 | quote }} 227 | - name: FABRIC_PORT 228 | value: {{ .Values.aerospikeFabricPort | default 3001 | quote }} 229 | - name: INFO_PORT 230 | value: {{ .Values.aerospikeInfoPort | default 3003 | quote }} 231 | # Aerospike utility variables 232 | {{- if .Values.security.enabled }} 233 | - name: SECURITY_ENABLED 234 | value: {{ .Values.security.enabled | default false | quote }} 235 | - name: HELM_USERNAME 236 | value: {{ .Values.security.helmUsername | default "helm_operator" | quote }} 237 | - name: HELM_PASSWORD 238 | value: {{ .Values.security.helmPassword | default "helm_operator" | quote }} 239 | - name: ADMIN_USERNAME 240 | value: {{ .Values.security.username | default "admin" | quote }} 241 | - name: ADMIN_PASSWORD 242 | value: {{ .Values.security.username | default "admin" | quote }} 243 | - name: AUTH_MODE 244 | value: {{ .Values.security.authMode | default "internal" | quote }} 245 | {{- end }} 246 | {{- range $tc := .Values.tlsConfig }} 247 | {{- if $.Values.aerospikeNetworkTLSConfig.service }} 248 | {{- if eq $.Values.aerospikeNetworkTLSConfig.service.tlsName $tc.tlsName }} 249 | - name: SERVICE_TLS_ENABLED 250 | value: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsOnly | default false | quote }} 251 | - name: SERVICE_TLS_NAME 252 | value: {{ $tc.tlsName | default "" | quote }} 253 | - name: SERVICE_MUTUAL_AUTH 254 | value: {{ $.Values.aerospikeNetworkTLSConfig.service.mutualAuthentication | default false | quote }} 255 | - name: SERVICE_TLS_PORT 256 | value: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 | quote }} 257 | - name: SERVICE_PLAIN_PORT 258 | value: {{ $.Values.aerospikeClientPort | default 3000 | quote }} 259 | - name: SERVICE_CA_FILE 260 | value: {{ $tc.tlsCAFile | default "" | quote }} 261 | - name: SERVICE_CERT_FILE 262 | value: {{ $tc.tlsCertFile | default "" | quote }} 263 | - name: SERVICE_KEY_FILE 264 | value: {{ $tc.tlsKeyFile | default "" | quote }} 265 | {{- end }} 266 | {{- end }} 267 | {{- end }} 268 | # Downward API: 269 | - name: MY_POD_NAME 270 | valueFrom: 271 | fieldRef: 272 | fieldPath: metadata.name 273 | - name: MY_POD_NAMESPACE 274 | valueFrom: 275 | fieldRef: 276 | fieldPath: metadata.namespace 277 | - name: MY_POD_IP 278 | valueFrom: 279 | fieldRef: 280 | fieldPath: status.podIP 281 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 282 | - name: aerospike-prometheus-exporter 283 | image: "{{ .Values.exporterImage.repository }}:{{ .Values.exporterImage.tag }}" 284 | args: ["aerospike-prometheus-exporter", "--config", "/etc/aerospike-prometheus-exporter/ape.toml"] 285 | ports: 286 | - containerPort: {{ .Values.exporter.agentBindPort | default 9145 }} 287 | name: exporter 288 | volumeMounts: 289 | - name: apeconfdir 290 | mountPath: /etc/aerospike-prometheus-exporter 291 | {{- range $lv := .Values.volumes }} 292 | - name: {{ $lv.name | quote }} 293 | mountPath: {{ $lv.mountPath | quote }} 294 | {{- end }} 295 | env: 296 | # Downward API 297 | - name: MY_POD_NAME 298 | valueFrom: 299 | fieldRef: 300 | fieldPath: metadata.name 301 | - name: MY_POD_NAMESPACE 302 | valueFrom: 303 | fieldRef: 304 | fieldPath: metadata.namespace 305 | - name: MY_POD_IP 306 | valueFrom: 307 | fieldRef: 308 | fieldPath: status.podIP 309 | # Exporter configs 310 | - name: AGENT_CERT_FILE 311 | value: {{ .Values.exporter.agentCertFile | default "" | quote }} 312 | - name: AGENT_KEY_FILE 313 | value: {{ .Values.exporter.agentKeyFile | default "" | quote }} 314 | - name: METRIC_LABELS 315 | value: {{ .Values.exporter.metricLabels | default "" | quote }} 316 | - name: AGENT_BIND_HOST 317 | value: {{ .Values.exporter.agentBindHost | default "" | quote }} 318 | - name: AGENT_BIND_PORT 319 | value: {{ .Values.exporter.agentBindPort | default 9145 | quote }} 320 | - name: AGENT_TIMEOUT 321 | value: {{ .Values.exporter.agentTimeout | default 10 | quote }} 322 | - name: AGENT_LOG_FILE 323 | value: {{ .Values.exporter.agentLogFile | default "" | quote }} 324 | - name: AGENT_LOG_LEVEL 325 | value: {{ .Values.exporter.agentLogLevel | default "info" | quote }} 326 | - name: BASIC_AUTH_USERNAME 327 | value: {{ .Values.exporter.httpBasicAuthUsername | default "" | quote }} 328 | - name: BASIC_AUTH_PASSWORD 329 | value: {{ .Values.exporter.httpBasicAuthPassword | default "" | quote }} 330 | - name: AS_HOST 331 | value: {{ .Values.exporter.aerospikeHost | default "localhost" | quote }} 332 | - name: AS_PORT 333 | value: {{ .Values.exporter.aerospikePort | default 3000 | quote }} 334 | - name: AS_CERT_FILE 335 | value: {{ .Values.exporter.aerospikeCertFile | default "" | quote }} 336 | - name: AS_KEY_FILE 337 | value: {{ .Values.exporter.aerospikeKeyFile | default "" | quote }} 338 | - name: AS_KEY_FILE_PASSPHRASE 339 | value: {{ .Values.exporter.aerospikeKeyFilePassphrase | default "" | quote }} 340 | - name: AS_NODE_TLS_NAME 341 | value: {{ .Values.exporter.aerospikeNodeTLSName | default "" | quote }} 342 | - name: AS_ROOT_CA 343 | value: {{ .Values.exporter.aerospikeCAFile | default "" | quote }} 344 | - name: AS_AUTH_MODE 345 | value: {{ .Values.exporter.aerospikeAuthMode | default "" | quote }} 346 | - name: AS_AUTH_USER 347 | value: {{ .Values.exporter.aerospikeAuthUser | default "" | quote }} 348 | - name: AS_AUTH_PASSWORD 349 | value: {{ .Values.exporter.aerospikeAuthPassword | default "" | quote }} 350 | - name: TICKER_TIMEOUT 351 | value: {{ .Values.exporter.infoTimeout | default 5 | quote }} 352 | - name: NAMESPACE_METRICS_ALLOWLIST 353 | value: {{ .Values.exporter.namespaceMetricsAllowlist | default "" | quote }} 354 | - name: SET_METRICS_ALLOWLIST 355 | value: {{ .Values.exporter.setMetricsAllowlist | default "" | quote }} 356 | - name: NODE_METRICS_ALLOWLIST 357 | value: {{ .Values.exporter.nodeMetricsAllowlist | default "" | quote }} 358 | - name: XDR_METRICS_ALLOWLIST 359 | value: {{ .Values.exporter.xdrMetricsAllowlist | default "" | quote }} 360 | - name: NAMESPACE_METRICS_BLOCKLIST 361 | value: {{ .Values.exporter.namespaceMetricsBlocklist | default "" | quote }} 362 | - name: SET_METRICS_BLOCKLIST 363 | value: {{ .Values.exporter.setMetricsBlocklist | default "" | quote }} 364 | - name: NODE_METRICS_BLOCKLIST 365 | value: {{ .Values.exporter.nodeMetricsBlocklist | default "" | quote }} 366 | - name: XDR_METRICS_BLOCKLIST 367 | value: {{ .Values.exporter.xdrMetricsBlocklist | default "" | quote }} 368 | {{- end }} 369 | initContainers: 370 | - name: aerospike-init 371 | image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" 372 | volumeMounts: 373 | - name: confdir 374 | mountPath: /etc/aerospike 375 | - name: initconfigs 376 | mountPath: /configs 377 | - name: secretsdir 378 | mountPath: /secrets 379 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 380 | - name: apeconfdir 381 | mountPath: /etc/aerospike-prometheus-exporter 382 | {{- end }} 383 | env: # Variables needed by peer-finder for discovery 384 | - name: POD_NAMESPACE 385 | valueFrom: 386 | fieldRef: 387 | fieldPath: metadata.namespace 388 | - name: SERVICE 389 | value: {{ template "aerospike.fullname" . }} 390 | - name: SERVICE_DNS_DOMAIN 391 | value: {{ .Values.clusterServiceDnsDomain | default "cluster.local" | quote }} 392 | - name: POD_NAME 393 | valueFrom: 394 | fieldRef: 395 | fieldPath: metadata.name 396 | - name: CLUSTER_NAME 397 | value: "{{ .Release.Name }}-{{ .Chart.Name }}" 398 | - name: HOST_IP 399 | valueFrom: 400 | fieldRef: 401 | fieldPath: status.hostIP 402 | - name: HEARTBEAT_PORT 403 | value: {{ .Values.aerospikeHeartbeatPort | default 3002 | quote }} 404 | - name: FABRIC_PORT 405 | value: {{ .Values.aerospikeFabricPort | default 3001 | quote }} 406 | - name: SERVICE_PORT 407 | value: {{ .Values.aerospikeClientPort | default 3000 | quote }} 408 | - name: AUTO_GENERATE_NODE_IDS 409 | value: {{ .Values.autoGenerateNodeIds | default false | quote }} 410 | - name: NODE_ID_PREFIX 411 | value: {{ .Values.nodeIDPrefix | default "a" | quote }} 412 | {{- if .Values.security.enabled }} 413 | - name: SECURITY_ENABLED 414 | value: {{ .Values.security.enabled | default false | quote }} 415 | - name: HELM_USERNAME 416 | value: {{ .Values.security.helmUsername | default "helm_operator" | quote }} 417 | - name: HELM_PASSWORD 418 | value: {{ .Values.security.helmPassword | default "helm_operator" | quote }} 419 | - name: ADMIN_USERNAME 420 | value: {{ .Values.security.username | default "admin" | quote }} 421 | - name: ADMIN_PASSWORD 422 | value: {{ .Values.security.username | default "admin" | quote }} 423 | - name: AUTH_MODE 424 | value: {{ .Values.security.authMode | default "internal" | quote }} 425 | {{- end }} 426 | {{- if or .Values.hostNetworking .Values.hostNetwork.enabled }} 427 | - name: HOST_NETWORKING 428 | value: "true" 429 | {{- end }} 430 | {{- if and .Values.hostNetwork.enabled .Values.hostNetwork.useExternalIP }} 431 | - name: HOST_NETWORKING_EXTERNAL_IP 432 | value: "true" 433 | {{- end }} 434 | {{- if or .Values.enableNodePortServices .Values.nodePortServices.enabled }} 435 | - name: ENABLE_NODE_PORT_SERVICES 436 | value: "true" 437 | {{- end }} 438 | {{- if and .Values.nodePortServices.enabled .Values.nodePortServices.useExternalIP }} 439 | - name: ENABLE_NODE_PORT_SERVICES_EXTERNAL_IP 440 | value: "true" 441 | {{- end }} 442 | {{- if or .Values.enableLoadBalancerServices .Values.loadBalancerServices.enabled }} 443 | - name: ENABLE_LOADBALANCER_SERVICES 444 | value: "true" 445 | {{- end }} 446 | {{- if or .Values.enableExternalIpServices .Values.externalIPServices.enabled }} 447 | - name: ENABLE_EXTERNAL_IP_SERVICES 448 | value: "true" 449 | {{- end }} 450 | {{- range $tc := .Values.tlsConfig }} 451 | {{- if $.Values.aerospikeNetworkTLSConfig.service }} 452 | {{- if eq $.Values.aerospikeNetworkTLSConfig.service.tlsName $tc.tlsName }} 453 | - name: SERVICE_TLS_ONLY 454 | value: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsOnly | default false | quote }} 455 | - name: SERVICE_CA_FILE 456 | value: {{ $tc.tlsCAFile | default "" | quote }} 457 | - name: SERVICE_CERT_FILE 458 | value: {{ $tc.tlsCertFile | default "" | quote }} 459 | - name: SERVICE_KEY_FILE 460 | value: {{ $tc.tlsKeyFile | default "" | quote }} 461 | - name: SERVICE_TLS_NAME 462 | value: {{ $tc.tlsName | default "" | quote }} 463 | - name: SERVICE_MUTUAL_AUTH 464 | value: {{ $.Values.aerospikeNetworkTLSConfig.service.mutualAuthentication | default false | quote }} 465 | - name: SERVICE_TLS_PORT 466 | value: {{ $.Values.aerospikeNetworkTLSConfig.service.tlsPort | default 4333 | quote }} 467 | {{- end }} 468 | {{- end }} 469 | {{- if $.Values.aerospikeNetworkTLSConfig.heartbeat }} 470 | {{- if eq $.Values.aerospikeNetworkTLSConfig.heartbeat.tlsName $tc.tlsName }} 471 | - name: HEARTBEAT_TLS_ONLY 472 | value: {{ $.Values.aerospikeNetworkTLSConfig.heartbeat.tlsOnly | default false | quote }} 473 | - name: HEARTBEAT_CA_FILE 474 | value: {{ $tc.tlsCAFile | default "" | quote }} 475 | - name: HEARTBEAT_CERT_FILE 476 | value: {{ $tc.tlsCertFile | default "" | quote }} 477 | - name: HEARTBEAT_KEY_FILE 478 | value: {{ $tc.tlsKeyFile | default "" | quote }} 479 | - name: HEARTBEAT_TLS_NAME 480 | value: {{ $tc.tlsName | default "" | quote }} 481 | - name: HEARTBEAT_TLS_PORT 482 | value: {{ $.Values.aerospikeNetworkTLSConfig.heartbeat.tlsPort | default 3012 | quote }} 483 | {{- end }} 484 | {{- end }} 485 | {{- if $.Values.aerospikeNetworkTLSConfig.fabric }} 486 | {{- if eq $.Values.aerospikeNetworkTLSConfig.fabric.tlsName $tc.tlsName }} 487 | - name: FABRIC_TLS_ONLY 488 | value: {{ $.Values.aerospikeNetworkTLSConfig.fabric.tlsOnly | default false | quote }} 489 | - name: FABRIC_CA_FILE 490 | value: {{ $tc.tlsCAFile | default "" | quote }} 491 | - name: FABRIC_CERT_FILE 492 | value: {{ $tc.tlsCertFile | default "" | quote }} 493 | - name: FABRIC_KEY_FILE 494 | value: {{ $tc.tlsKeyFile | default "" | quote }} 495 | - name: FABRIC_TLS_NAME 496 | value: {{ $tc.tlsName | default "" | quote }} 497 | - name: FABRIC_TLS_PORT 498 | value: {{ $.Values.aerospikeNetworkTLSConfig.fabric.tlsPort | default 3011 | quote }} 499 | {{- end }} 500 | {{- end }} 501 | {{- end }} 502 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 503 | - name: AEROSPIKE_PROMETHEUS_EXPORTER_ENABLED 504 | value: "true" 505 | {{- end }} 506 | volumes: 507 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 508 | - name: apeconfdir 509 | emptyDir: {} 510 | {{- end }} 511 | - name: confdir 512 | emptyDir: {} 513 | - name: initconfigs 514 | configMap: 515 | name: {{ .Release.Name }}-conf 516 | - name: secretsdir 517 | secret: 518 | secretName: {{ .Release.Name }}-secrets 519 | {{- range $lv := .Values.volumes }} 520 | - name: {{ $lv.name | quote }} 521 | {{ toYaml $lv.template | indent 8}} 522 | {{- end }} 523 | volumeClaimTemplates: 524 | {{- range $pv := .Values.persistenceStorage }} 525 | {{- if $pv.enabled }} 526 | - metadata: 527 | name: {{ $pv.name }} 528 | labels: *AerospikeDeploymentLabels 529 | {{- with $.Values.annotations }} 530 | annotations: {{- toYaml . | nindent 10 }} 531 | {{- end }} 532 | spec: 533 | volumeMode: {{ $pv.volumeMode }} 534 | accessModes: 535 | - {{ $pv.accessMode | quote }} 536 | {{- if hasKey $pv "storageClass" }} 537 | storageClassName: {{ $pv.storageClass | quote }} 538 | {{- end }} 539 | resources: 540 | requests: 541 | storage: {{ $pv.size | quote }} 542 | {{- end }} 543 | {{- end }} 544 | --- 545 | --------------------------------------------------------------------------------