├── .gitignore ├── LICENSE ├── README.md ├── configs └── aerospike.template.conf ├── docs ├── _config.yml ├── aerospike-4.6.0.tgz ├── aerospike-4.7.0.tgz ├── aerospike-4.8.0.tgz ├── aerospike-4.9.0.tgz ├── aerospike-5.0.0.tgz ├── aerospike-5.1.0.tgz ├── aerospike-5.2.0.tgz ├── aerospike-5.3.0.tgz ├── aerospike-5.4.0.tgz ├── aerospike-5.5.0.tgz ├── artifacthub-repo.yml └── index.yaml ├── examples ├── shadow-device │ ├── README.md │ ├── aerospike-local-volume-provisioner.yaml │ ├── configmap │ │ └── aerospike.template.conf │ ├── namespace.yaml │ ├── service.yaml │ ├── statefulset-shadow-device.yaml │ ├── storageclass-aws.yaml │ └── storageclass-gcp.yaml └── storage-engine-device │ ├── README.md │ ├── aerospike-local-volume-provisioner.yaml │ ├── configmap │ └── aerospike.template.conf │ ├── namespace.yaml │ ├── service.yaml │ └── statefulset-raw-device.yaml ├── helm ├── .helmignore ├── CHANGELOG.md ├── Chart.yaml ├── README.md ├── charts │ └── .gitkeep ├── files │ ├── aerospike.template.conf │ ├── aerospike_rules.yaml │ ├── alertmanager.yaml │ └── ape.toml.template ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── alertmanager-configmap.yaml │ ├── alertmanager-operated-service.yaml │ ├── alertmanager-service.yaml │ ├── alertmanager-statefulset.yaml │ ├── clusterrole.yaml │ ├── clusterrolebinding.yaml │ ├── configmap.yaml │ ├── externalipservices.yaml │ ├── grafana-configmap.yaml │ ├── grafana-service.yaml │ ├── grafana-statefulset.yaml │ ├── loadbalancerservices.yaml │ ├── nodeportservices.yaml │ ├── prometheus-configmap.yaml │ ├── prometheus-service.yaml │ ├── prometheus-statefulset.yaml │ ├── service.yaml │ ├── serviceaccount.yaml │ └── statefulset.yaml └── values.yaml ├── manifests ├── namespace.yaml ├── service.yaml ├── statefulset.yaml ├── storageclass-aws.yaml └── storageclass-gcp.yaml └── start.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # aerospike-kubernetes 2 | 3 | This project uses Aerospike Server Community Edition. For Aerospike Server Enterprise Edition, please refer [aerospike/aerospike-kubernetes-enterprise](https://github.com/aerospike/aerospike-kubernetes-enterprise). 4 | 5 | This project contains the init container used in Kubernetes (k8s) and the Aerospike StatefulSet definition. 6 | These manifests will allow you to deploy a fully formed Aerospike cluster in minutes. 7 | 8 | It uses: 9 | 10 | - [aerospike-server docker image](https://hub.docker.com/r/aerospike/aerospike-server) 11 | - [aerospike-kubernetes-init docker image](https://hub.docker.com/r/aerospike/aerospike-kubernetes-init) 12 | 13 | ## Usage: 14 | 15 | ### Configure: 16 | 17 | Set environment variables (modify if necessary): 18 | 19 | ```sh 20 | export APP_NAME=aerospike 21 | export NAMESPACE=default 22 | export AEROSPIKE_NODES=3 23 | export AEROSPIKE_NAMESPACE=test 24 | export AEROSPIKE_REPL=2 25 | export AEROSPIKE_MEM=1 26 | export AEROSPIKE_TTL=0 27 | export AEROSPIKE_NSUP_PERIOD=0 # if AEROSPIKE_TTL is not 0, AEROSPIKE_NSUP_PERIOD should not be 0. 28 | ``` 29 | 30 | All `AEROSPIKE_*` parameters except AEROSPIKE\_NODES, AEROSPIKE_MEM are optional. Default values are listed above. 31 | All other parameters are required. 32 | 33 | ### Configuring Storage: 34 | 35 | The [statefulset definition](manifests/statefulset.yaml) refers to a custom StorageClass `ssd`. 36 | 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. 37 | 38 | > 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. 39 | 40 | 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. 41 | 42 | ``` 43 | volumeClaimTemplates: 44 | - metadata: 45 | name: data-dev 46 | labels: *AerospikeDeploymentLabels 47 | spec: 48 | volumeMode: Block 49 | accessModes: 50 | - ReadWriteOnce 51 | storageClassName: ssd 52 | resources: 53 | requests: 54 | storage: ${AEROSPIKE_MEM}Gi 55 | ``` 56 | ``` 57 | ..... 58 | volumeMounts: 59 | - name: confdir 60 | mountPath: /etc/aerospike 61 | volumeDevices: 62 | - name: data-dev 63 | devicePath: /dev/sdb 64 | ..... 65 | ``` 66 | 67 | 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`. 68 | 69 | ### Examples: 70 | 71 | To view and run the examples, go to [`examples/`](examples/) 72 | 73 | ### Deployment: 74 | 75 | Please follow the below steps or run `start.sh` script: 76 | 77 | 1. Expand manifest template: 78 | 79 | ```sh 80 | cat manifests/* | envsubst > expanded.yaml 81 | ``` 82 | 83 | 2. Create the configmap object: 84 | 85 | ```sh 86 | kubectl create configmap aerospike-conf -n $NAMESPACE --from-file=configs/ 87 | ``` 88 | 89 | 3. Deploy: 90 | 91 | ```sh 92 | kubectl create -f expanded.yaml 93 | ``` 94 | 95 | ### Helm Charts 96 | 97 | Helm chart for the same can be found [here](helm/) 98 | 99 | ## Requirements 100 | 101 | * Kubernetes 1.8+ 102 | * Kubernetes DNS add-in 103 | -------------------------------------------------------------------------------- /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 | } 11 | 12 | logging { 13 | 14 | # Log file must be an absolute path. 15 | file ${LOGFILE} { 16 | context any info 17 | } 18 | 19 | # Send log messages to stdout 20 | console { 21 | context any info 22 | } 23 | } 24 | 25 | 26 | network { 27 | service { 28 | address ${SERVICE_ADDRESS} 29 | port ${SERVICE_PORT} 30 | 31 | # Uncomment the following to set the `access-address` parameter to the 32 | # IP address of the Docker host. This will the allow the server to correctly 33 | # publish the address which applications and other nodes in the cluster to 34 | # use when addressing this node. 35 | # access-address 36 | } 37 | 38 | heartbeat { 39 | 40 | address ${HB_ADDRESS} 41 | # mesh is used for environments that do not support multicast 42 | mode mesh 43 | port ${HB_PORT} 44 | 45 | # use asinfo -v 'tip:host=;port=3002' to inform cluster of 46 | # other mesh nodes 47 | # mesh-seed-placeholder 48 | 49 | interval 150 50 | timeout 10 51 | } 52 | 53 | fabric { 54 | address ${FABRIC_ADDRESS} 55 | port ${FABRIC_PORT} 56 | } 57 | 58 | info { 59 | address ${INFO_ADDRESS} 60 | port ${INFO_PORT} 61 | } 62 | } 63 | 64 | namespace ${NAMESPACE} { 65 | replication-factor ${REPL_FACTOR} 66 | memory-size ${MEM_GB}G 67 | default-ttl ${DEFAULT_TTL} 68 | nsup-period ${NSUP_PERIOD} 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 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/aerospike-4.6.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-4.6.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-4.7.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-4.7.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-4.8.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-4.8.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-4.9.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-4.9.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-5.0.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-5.0.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-5.1.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-5.1.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-5.2.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-5.2.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-5.3.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-5.3.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-5.4.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-5.4.0.tgz -------------------------------------------------------------------------------- /docs/aerospike-5.5.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/docs/aerospike-5.5.0.tgz -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/index.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | entries: 3 | aerospike: 4 | - apiVersion: v1 5 | appVersion: 5.5.0.7 6 | created: "2021-04-08T01:49:34.900131+05:30" 7 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 8 | digest: 1f46fe015a79f9b4b966f35c80f9a6426239047968ff870e7587d83ce0b2f68e 9 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 10 | maintainers: 11 | - email: kesan@aerospike.com 12 | name: spkesan 13 | url: https://github.com/spkesan 14 | name: aerospike 15 | sources: 16 | - https://github.com/aerospike/aerospike-server.docker 17 | - https://github.com/aerospike/aerospike-kubernetes 18 | - https://github.com/aerospike/aerospike-kubernetes-init 19 | - https://github.com/aerospike/aerospike-prometheus-exporter 20 | urls: 21 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-5.5.0.tgz 22 | version: 5.5.0 23 | - apiVersion: v1 24 | appVersion: 5.4.0.9 25 | created: "2021-04-08T01:49:34.897581+05:30" 26 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 27 | digest: e87946c23754c0f04290493b3fd92bc5c678e4cd893976ae1b6397bbcf472935 28 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 29 | maintainers: 30 | - email: kesan@aerospike.com 31 | name: spkesan 32 | url: https://github.com/spkesan 33 | name: aerospike 34 | sources: 35 | - https://github.com/aerospike/aerospike-server.docker 36 | - https://github.com/aerospike/aerospike-kubernetes 37 | - https://github.com/aerospike/aerospike-kubernetes-init 38 | - https://github.com/aerospike/aerospike-prometheus-exporter 39 | urls: 40 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-5.4.0.tgz 41 | version: 5.4.0 42 | - apiVersion: v1 43 | appVersion: 5.3.0.14 44 | created: "2021-04-08T01:49:34.895259+05:30" 45 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 46 | digest: 1355aaaacbad52c46c908ddb9703f0d328f034e9d2b9ae79bbe63394de480ad3 47 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 48 | maintainers: 49 | - email: kesan@aerospike.com 50 | name: spkesan 51 | url: https://github.com/spkesan 52 | name: aerospike 53 | sources: 54 | - https://github.com/aerospike/aerospike-server.docker 55 | - https://github.com/aerospike/aerospike-kubernetes 56 | - https://github.com/aerospike/aerospike-kubernetes-init 57 | - https://github.com/aerospike/aerospike-prometheus-exporter 58 | urls: 59 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-5.3.0.tgz 60 | version: 5.3.0 61 | - apiVersion: v1 62 | appVersion: 5.2.0.24 63 | created: "2021-04-08T01:49:34.891695+05:30" 64 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 65 | digest: 34e05ccdd5b13957108bc28be3487160b856d78799e4268727b3eaa931c638aa 66 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 67 | maintainers: 68 | - email: kesan@aerospike.com 69 | name: spkesan 70 | url: https://github.com/spkesan 71 | name: aerospike 72 | sources: 73 | - https://github.com/aerospike/aerospike-server.docker 74 | - https://github.com/aerospike/aerospike-kubernetes 75 | - https://github.com/aerospike/aerospike-kubernetes-init 76 | - https://github.com/aerospike/aerospike-prometheus-exporter 77 | urls: 78 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-5.2.0.tgz 79 | version: 5.2.0 80 | - apiVersion: v1 81 | appVersion: 5.1.0.31 82 | created: "2021-04-08T01:49:34.889378+05:30" 83 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 84 | digest: 8e0ad0e68f6ef3c7c141428b18c8724e3611ddc65cc56462ffaa3c30e97b6a76 85 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 86 | maintainers: 87 | - email: kesan@aerospike.com 88 | name: spkesan 89 | url: https://github.com/spkesan 90 | name: aerospike 91 | sources: 92 | - https://github.com/aerospike/aerospike-server.docker 93 | - https://github.com/aerospike/aerospike-kubernetes 94 | - https://github.com/aerospike/aerospike-kubernetes-init 95 | - https://github.com/aerospike/aerospike-prometheus-exporter 96 | urls: 97 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-5.1.0.tgz 98 | version: 5.1.0 99 | - apiVersion: v1 100 | appVersion: 5.0.0.33 101 | created: "2021-04-08T01:49:34.887111+05:30" 102 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 103 | digest: 5907d04a1cc56053a2ec60aad51a9204026861420299adf0dc8ddd119255fd01 104 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 105 | maintainers: 106 | - email: kesan@aerospike.com 107 | name: spkesan 108 | url: https://github.com/spkesan 109 | name: aerospike 110 | sources: 111 | - https://github.com/aerospike/aerospike-server.docker 112 | - https://github.com/aerospike/aerospike-kubernetes 113 | - https://github.com/aerospike/aerospike-kubernetes-init 114 | - https://github.com/aerospike/aerospike-prometheus-exporter 115 | urls: 116 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-5.0.0.tgz 117 | version: 5.0.0 118 | - apiVersion: v1 119 | appVersion: 4.9.0.30 120 | created: "2021-04-08T01:49:34.883607+05:30" 121 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 122 | digest: 14c5c9fb1539aab7883d4a26c716a9c45217a8693a03243c74121e18d404437f 123 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 124 | maintainers: 125 | - email: kesan@aerospike.com 126 | name: spkesan 127 | url: https://github.com/spkesan 128 | name: aerospike 129 | sources: 130 | - https://github.com/aerospike/aerospike-server.docker 131 | - https://github.com/aerospike/aerospike-kubernetes 132 | - https://github.com/aerospike/aerospike-kubernetes-init 133 | - https://github.com/aerospike/aerospike-prometheus-exporter 134 | urls: 135 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-4.9.0.tgz 136 | version: 4.9.0 137 | - apiVersion: v1 138 | appVersion: 4.8.0.31 139 | created: "2021-04-08T01:49:34.881234+05:30" 140 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 141 | digest: aad445f7465ae14ef81f074d0d8c27659139da1563d96cdf5211da3d60a543f6 142 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 143 | maintainers: 144 | - email: kesan@aerospike.com 145 | name: spkesan 146 | url: https://github.com/spkesan 147 | name: aerospike 148 | sources: 149 | - https://github.com/aerospike/aerospike-server.docker 150 | - https://github.com/aerospike/aerospike-kubernetes 151 | - https://github.com/aerospike/aerospike-kubernetes-init 152 | - https://github.com/aerospike/aerospike-prometheus-exporter 153 | urls: 154 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-4.8.0.tgz 155 | version: 4.8.0 156 | - apiVersion: v1 157 | appVersion: 4.7.0.26 158 | created: "2021-04-08T01:49:34.878952+05:30" 159 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 160 | digest: 6598cf6e9eaf49f37da3e4311ad22d86647be7da6f85a1aef4a2535d001ccaea 161 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 162 | maintainers: 163 | - email: kesan@aerospike.com 164 | name: spkesan 165 | url: https://github.com/spkesan 166 | name: aerospike 167 | sources: 168 | - https://github.com/aerospike/aerospike-server.docker 169 | - https://github.com/aerospike/aerospike-kubernetes 170 | - https://github.com/aerospike/aerospike-kubernetes-init 171 | - https://github.com/aerospike/aerospike-prometheus-exporter 172 | urls: 173 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-4.7.0.tgz 174 | version: 4.7.0 175 | - apiVersion: v1 176 | appVersion: 4.6.0.21 177 | created: "2021-04-08T01:49:34.875187+05:30" 178 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 179 | digest: 6c4a31615f6bb04c40daa11238414dd18eedb0698c27babe3cacdb52a25b1604 180 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 181 | maintainers: 182 | - email: kesan@aerospike.com 183 | name: spkesan 184 | url: https://github.com/spkesan 185 | name: aerospike 186 | sources: 187 | - https://github.com/aerospike/aerospike-server.docker 188 | - https://github.com/aerospike/aerospike-kubernetes 189 | - https://github.com/aerospike/aerospike-kubernetes-init 190 | - https://github.com/aerospike/aerospike-prometheus-exporter 191 | urls: 192 | - https://aerospike.github.io/aerospike-kubernetes/aerospike-4.6.0.tgz 193 | version: 4.6.0 194 | generated: "2021-04-08T01:49:34.87119+05:30" 195 | -------------------------------------------------------------------------------- /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 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. 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 | 116 | Create configMap object, 117 | 118 | ```sh 119 | $ kubectl create configmap aerospike-conf -n dev --from-file=configmap/ 120 | ``` 121 | 122 | > 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. 123 | 124 | 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). 125 | ``` 126 | ... 127 | storage-engine device { 128 | device /dev/xvdb /dev/xvdf # Shadow device configuration. 129 | # device /dev/ /dev/ # (optional) another raw device / shadow device. 130 | write-block-size 128K 131 | # data-in-memory true # Store data in memory in addition to file. 132 | } 133 | ... 134 | ``` 135 | 136 | ### Create and run a 'headless' service (for DNS lookup) 137 | 138 | For this example, we will use the Service defined in [service.yaml](service.yaml) 139 | 140 | ```sh 141 | $ kubectl create -f service.yaml 142 | ``` 143 | 144 | 145 | ### Deploy Aerospike cluster using a statefulset defintion 146 | 147 | For this example, the statefulset definition is present in [statefulset-shadow-device.yaml](statefulset-shadow-device.yaml). 148 | 149 | Set necessary variables (rest are optional), 150 | 151 | ```sh 152 | export AEROSPIKE_NODES=3 153 | export AEROSPIKE_MEM=1 154 | export AEROSPIKE_STORAGE_SZ=375 155 | ``` 156 | Below are the default values for rest of the variables. 157 | 158 | ``` 159 | AEROSPIKE_NAMESPACE=test 160 | AEROSPIKE_REPL=2 161 | AEROSPIKE_TTL=0 162 | ``` 163 | 164 | Substitute the above variables into the `statefulset-shadow-device.yaml` and deploy. 165 | 166 | ```sh 167 | $ cat statefulset-shadow-device.yaml | envsubst '$AEROSPIKE_NODES $AEROSPIKE_NAMESPACE $AEROSPIKE_REPL $AEROSPIKE_MEM $AEROSPIKE_TTL $AEROSPIKE_STORAGE_SZ' > statefulset.yaml 168 | ``` 169 | Deploy, 170 | 171 | ```sh 172 | $ kubectl create -f statefulset.yaml 173 | ``` 174 | 175 | #### Things to note: 176 | 177 | - 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). 178 | ```sh 179 | ...... 180 | volumeClaimTemplates: 181 | - metadata: 182 | name: data-dev 183 | labels: *AerospikeDeploymentLabels 184 | spec: 185 | volumeMode: Block 186 | accessModes: 187 | - ReadWriteOnce 188 | storageClassName: aerospike-ssds 189 | resources: 190 | requests: 191 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 192 | - metadata: 193 | name: shadow-dev 194 | labels: *AerospikeDeploymentLabels 195 | spec: 196 | volumeMode: Block 197 | accessModes: 198 | - ReadWriteOnce 199 | storageClassName: shadow 200 | resources: 201 | requests: 202 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 203 | ``` 204 | - `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. 205 | ```sh 206 | ..... 207 | volumeDevices: 208 | - name: data-dev 209 | devicePath: /dev/xvdb 210 | - name: shadow-dev 211 | devicePath: /dev/xvdf 212 | .... 213 | ``` 214 | 215 | ### Output: 216 | 217 | 218 | ```sh 219 | $ kubectl get pv 220 | 221 | NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE 222 | local-pv-342b45ed 375Gi RWO Delete Available aerospike-ssds 6m56s 223 | local-pv-3587dbec 375Gi RWO Delete Bound dev/data-dev-aerospike-1 aerospike-ssds 7m32s 224 | local-pv-df716a06 375Gi RWO Delete Bound dev/data-dev-aerospike-2 aerospike-ssds 8m05s 225 | local-pv-eaf4a027 375Gi RWO Delete Bound dev/data-dev-aerospike-0 aerospike-ssds 6m56s 226 | pvc-b7285001-da43-11e9-ac74-42010aa0014b 375Gi RWO Delete Bound dev/shadow-dev-aerospike-0 shadow 3m56s 227 | pvc-3421ed54-d944-11e9-ac74-42010aa0014b 375Gi RWO Delete Bound dev/shadow-dev-aerospike-1 shadow 7m05s 228 | pvc-5ca77b01-d944-11e9-ac74-42010aa0014b 375Gi RWO Delete Bound dev/shadow-dev-aerospike-2 shadow 7m55s 229 | ``` 230 | 231 | ```sh 232 | 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 233 | 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 234 | Sep 18 2019 18:41:10 GMT: INFO (drv_ssd): (drv_ssd.c:1068) /dev/xvdb has 3072000 wblocks of size 131072 235 | ... 236 | 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) 237 | Sep 18 2019 16:20:29 GMT: INFO (info): (ticker.c:162) NODE-ID bb9fe910a5d3186 CLUSTER-SIZE 3 238 | ... 239 | ``` 240 | 241 | ```sh 242 | $ kubectl get all --namespace dev 243 | 244 | NAME READY STATUS RESTARTS AGE 245 | pod/aerospike-0 1/1 Running 0 21m 246 | pod/aerospike-1 1/1 Running 0 12m 247 | pod/aerospike-2 1/1 Running 0 11m 248 | pod/local-volume-provisioner-lp5h7 1/1 Running 0 54m 249 | pod/local-volume-provisioner-vwpd5 1/1 Running 0 122m 250 | 251 | NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 252 | service/aerospike ClusterIP None 3000/TCP 13m 253 | 254 | NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE 255 | daemonset.apps/local-volume-provisioner 2 2 2 2 2 123m 256 | 257 | NAME READY AGE 258 | statefulset.apps/aerospike 3/3 21m 259 | ``` -------------------------------------------------------------------------------- /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/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 | } 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 device { 71 | device /dev/xvdb /dev/xvdf # Shadow device configuration. 72 | # device /dev/ /dev/ # (optional) another raw device / shadow device. 73 | write-block-size 128K 74 | # data-in-memory true # Store data in memory in addition to file. 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 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 | # 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 | - metadata: 132 | name: shadow-dev 133 | labels: *AerospikeDeploymentLabels 134 | spec: 135 | volumeMode: Block 136 | accessModes: 137 | - ReadWriteOnce 138 | storageClassName: shadow 139 | resources: 140 | requests: 141 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 142 | --- 143 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT 39 | sdb 8:16 0 375G 0 disk 40 | sdc 8:32 0 375G 0 disk 41 | ``` 42 | 43 | ```sh 44 | $ mkdir /mnt/disks 45 | ``` 46 | 47 | Use unique device IDs rather than the names `/dev/sdb` or `/dev/sdc`. 48 | 49 | ```sh 50 | $ ln -s /dev/disk/by-id/local-ssd-0 /mnt/disks 51 | $ ln -s /dev/disk/by-id/local-ssd-1 /mnt/disks 52 | ``` 53 | 54 | > 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. 55 | 56 | ### Configure and deploy local volume provisioner 57 | 58 | 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). 59 | 60 | 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. 61 | 62 | 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. 63 | 64 | Deploy the provisioner, 65 | 66 | ```sh 67 | $ kubectl create -f aerospike-local-volume-provisioner.yaml 68 | 69 | configmap/local-provisioner-config created 70 | daemonset.apps/local-volume-provisioner created 71 | storageclass.storage.k8s.io/aerospike-ssds created 72 | serviceaccount/local-storage-admin created 73 | clusterrolebinding.rbac.authorization.k8s.io/local-storage-provisioner-pv-binding created 74 | clusterrole.rbac.authorization.k8s.io/local-storage-provisioner-node-clusterrole created 75 | clusterrolebinding.rbac.authorization.k8s.io/local-storage-provisioner-node-binding created 76 | ``` 77 | 78 | Verify the discovered and created PV objects, 79 | ```sh 80 | $ kubectl get pv 81 | 82 | NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE 83 | local-pv-342b45ed 375Gi RWO Delete Available aerospike-ssds 3s 84 | local-pv-3587dbec 375Gi RWO Delete Available aerospike-ssds 3s 85 | local-pv-df716a06 375Gi RWO Delete Available aerospike-ssds 3s 86 | local-pv-eaf4a027 375Gi RWO Delete Available aerospike-ssds 3s 87 | ``` 88 | 89 | 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)). 90 | 91 | ### Create and deploy ConfigMap object 92 | 93 | The [configmap](configmap) directory contains the Aerospike configuration file template for this example - `aerospike.template.conf`. 94 | 95 | Create configMap object, 96 | 97 | ```sh 98 | $ kubectl create configmap aerospike-conf -n dev --from-file=configmap/ 99 | ``` 100 | 101 | > 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. 102 | 103 | 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). 104 | ``` 105 | ... 106 | storage-engine device { 107 | device /dev/xvdb 108 | # (optional) another raw device. 109 | # device /dev/ 110 | write-block-size 128K 111 | # data-in-memory true # Store data in memory in addition to file. 112 | } 113 | ... 114 | ``` 115 | 116 | ### Create and run a 'headless' service (for DNS lookup) 117 | 118 | For this example, we will use the Service defined in [service.yaml](service.yaml) 119 | 120 | ```sh 121 | $ kubectl create -f service.yaml 122 | ``` 123 | 124 | 125 | ### Deploy Aerospike cluster using a statefulset defintion 126 | 127 | For this example, the statefulset definition is present in [statefulset-raw-device.yaml](statefulset-raw-device.yaml). 128 | 129 | Set necessary variables (rest are optional), 130 | 131 | ```sh 132 | export AEROSPIKE_NODES=3 133 | export AEROSPIKE_MEM=1 134 | export AEROSPIKE_STORAGE_SZ=375 135 | ``` 136 | Below are the default values for rest of the variables. 137 | 138 | ``` 139 | AEROSPIKE_NAMESPACE=test 140 | AEROSPIKE_REPL=2 141 | AEROSPIKE_TTL=0 142 | ``` 143 | 144 | Substitute the above variables into the `statefulset-raw-device.yaml` and deploy. 145 | 146 | ```sh 147 | $ cat statefulset-raw-device.yaml | envsubst '$AEROSPIKE_NODES $AEROSPIKE_NAMESPACE $AEROSPIKE_REPL $AEROSPIKE_MEM $AEROSPIKE_TTL $AEROSPIKE_STORAGE_SZ' > statefulset.yaml 148 | ``` 149 | Deploy, 150 | 151 | ```sh 152 | $ kubectl create -f statefulset.yaml 153 | ``` 154 | 155 | #### Things to note: 156 | 157 | - 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). 158 | ```sh 159 | ...... 160 | volumeClaimTemplates: 161 | - metadata: 162 | name: data-dev 163 | labels: *AerospikeDeploymentLabels 164 | spec: 165 | volumeMode: Block 166 | accessModes: 167 | - ReadWriteOnce 168 | storageClassName: aerospike-ssds 169 | resources: 170 | requests: 171 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 172 | ``` 173 | - `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. 174 | ```sh 175 | ..... 176 | volumeDevices: 177 | - name: data-dev 178 | devicePath: /dev/xvdb 179 | .... 180 | ``` 181 | 182 | ### Output: 183 | 184 | 185 | ```sh 186 | $ kubectl get pv 187 | 188 | NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE 189 | local-pv-342b45ed 375Gi RWO Delete Bound dev/data-dev-aerospike-2 aerospike-ssds 121m 190 | local-pv-3587dbec 375Gi RWO Delete Bound dev/data-dev-aerospike-0 aerospike-ssds 121m 191 | local-pv-df716a06 375Gi RWO Delete Available aerospike-ssds 121m 192 | local-pv-eaf4a027 375Gi RWO Delete Bound dev/data-dev-aerospike-1 aerospike-ssds 121m 193 | ``` 194 | 195 | ```sh 196 | 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 197 | Sep 18 2019 16:08:29 GMT: INFO (drv_ssd): (drv_ssd.c:1068) /dev/xvdb has 3072000 wblocks of size 131072 198 | ... 199 | 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) 200 | Sep 18 2019 16:20:29 GMT: INFO (info): (ticker.c:162) NODE-ID bb9fe910a5d3186 CLUSTER-SIZE 3 201 | ... 202 | ``` 203 | 204 | ```sh 205 | $ kubectl get all --namespace dev 206 | 207 | NAME READY STATUS RESTARTS AGE 208 | pod/aerospike-0 1/1 Running 0 21m 209 | pod/aerospike-1 1/1 Running 0 12m 210 | pod/aerospike-2 1/1 Running 0 11m 211 | pod/local-volume-provisioner-lp5h7 1/1 Running 0 54m 212 | pod/local-volume-provisioner-vwpd5 1/1 Running 0 122m 213 | 214 | NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 215 | service/aerospike ClusterIP None 3000/TCP 13m 216 | 217 | NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE 218 | daemonset.apps/local-volume-provisioner 2 2 2 2 2 123m 219 | 220 | NAME READY AGE 221 | statefulset.apps/aerospike 3/3 21m 222 | ``` -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } 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 device { 71 | device /dev/xvdb 72 | # (optional) another raw device. 73 | # device /dev/ 74 | write-block-size 128K 75 | # data-in-memory true # Store data in memory in addition to file. 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 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 | # Downward API: 84 | - name: MY_POD_NAME 85 | valueFrom: 86 | fieldRef: 87 | fieldPath: metadata.name 88 | - name: MY_POD_NAMESPACE 89 | valueFrom: 90 | fieldRef: 91 | fieldPath: metadata.namespace 92 | - name: MY_POD_IP 93 | valueFrom: 94 | fieldRef: 95 | fieldPath: status.podIP 96 | initContainers: 97 | - name: aerospike-init 98 | image: aerospike/aerospike-kubernetes-init:1.1.0 99 | volumeMounts: 100 | - name: confdir 101 | mountPath: /etc/aerospike 102 | - name: initconfigs 103 | mountPath: /configs 104 | env: # Variables needed by peer-finder for discovery 105 | - name: POD_NAMESPACE 106 | valueFrom: 107 | fieldRef: 108 | fieldPath: metadata.namespace 109 | - name: SERVICE 110 | value: aerospike 111 | volumes: 112 | - name: confdir 113 | emptyDir: {} 114 | - name: initconfigs 115 | configMap: 116 | name: aerospike-conf 117 | volumeClaimTemplates: 118 | - metadata: 119 | name: data-dev 120 | labels: *AerospikeDeploymentLabels 121 | spec: 122 | volumeMode: Block 123 | accessModes: 124 | - ReadWriteOnce 125 | storageClassName: aerospike-ssds 126 | resources: 127 | requests: 128 | storage: ${AEROSPIKE_STORAGE_SZ}Gi 129 | --- 130 | -------------------------------------------------------------------------------- /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/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | This file documents all notable changes to Aerospike Helm Chart (Community Edition). 4 | 5 | ## [1.5.2](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.5.2) 6 | 7 | ### Improvements 8 | 9 | - Support specifying args for aerospike container 10 | - Allow configuration of labels and annotations for services 11 | - Support for passing feature key file as a base64 encoded string 12 | - Support for passing aerospike configuration file as a base64 encoded string 13 | - Allow configuration labels, annotations for Prometheus, Alertmanager, Grafana statefulset and pods 14 | - Support for passing Aerospike alert rules and Alertmanager configuration file as a base64 encoded string 15 | 16 | ### Fixes 17 | 18 | - Don't trim the statefulset name if the release name contains chart name 19 | 20 | ### Regular Updates 21 | 22 | - Added Chart `5.5.0` for Aerospike server version `5.5.0.7` 23 | - Chart `5.4.0` updated to use Aerospike server version `5.4.0.9` 24 | - Chart `5.3.0` updated to use Aerospike server version `5.3.0.14` 25 | - Chart `5.2.0` updated to use Aerospike server version `5.2.0.24` 26 | - Chart `5.1.0` updated to use Aerospike server version `5.1.0.31` 27 | - Chart `5.0.0` updated to use Aerospike server version `5.0.0.33` 28 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.30` 29 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.31` 30 | 31 | 32 | ## [1.5.1](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.5.1) 33 | 34 | ### Regular Updates 35 | 36 | - Updated monitoring dashboards 37 | - Added Chart `5.4.0` for Aerospike server version `5.4.0.3` 38 | - Chart `5.3.0` updated to use Aerospike server version `5.3.0.8` 39 | - Chart `5.2.0` updated to use Aerospike server version `5.2.0.17` 40 | - Chart `5.1.0` updated to use Aerospike server version `5.1.0.25` 41 | - Chart `5.0.0` updated to use Aerospike server version `5.0.0.27` 42 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.24` 43 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.26` 44 | 45 | 46 | ## [1.5.0](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.5.0) 47 | 48 | ### Features 49 | 50 | - New init container 51 | - Network config to opt external or internal IPs when creating services 52 | - Support all configurations of the aerospike prometheus exporter 53 | 54 | ### Improvements 55 | 56 | - Better container lifecycle events handling 57 | - Auto generate node-ids is now enabled by default 58 | - Increased termination grace period to `600` seconds 59 | - Node-id prefix now configurable 60 | - Update monitoring stack 61 | - Allow labels and annotations for pod and statefulset to be configured 62 | 63 | ### Fixes 64 | 65 | - Remove chart version from labels to allow chart upgrades 66 | 67 | ### Regular Updates 68 | 69 | - Added Chart `5.3.0` uses Aerospike server version `5.3.0.6` 70 | - Added Chart `5.2.0` uses Aerospike server version `5.2.0.15` 71 | - Added Chart `5.1.0` uses Aerospike server version `5.1.0.23` 72 | - Chart `5.0.0` updated to use Aerospike Server version `5.0.0.25` 73 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.23` 74 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.25` 75 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.26` 76 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.21` 77 | 78 | 79 | ## [1.4.0](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.4.0) 80 | - Added configuration to apply pod `tolerations` for node `taints` 81 | - Added configuration to apply `nodeSelectors` 82 | - Prometheus' `scrapeInterval` and `evaluationInterval` now configurable 83 | - Allow to configure basic HTTP authentication for `/metrics` URL of the aerospike prometheus exporter 84 | - Added new grafana dashboard for `XDR` `5.0+` metrics and updated other dashboards. 85 | - Update Aerospike Prometheus Exporter Configurations 86 | - Added Chart `5.0.0` uses Aerospike Server version `5.0.0.4` 87 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.17` 88 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.15` 89 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.11` 90 | - Chart `4.9.0` updated to use Aerospike Server version `4.9.0.8` 91 | 92 | 93 | ## [1.3.0](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.3.0) 94 | 95 | - [CLOUD-7] - Added support for custom service dns domain 96 | - [PROD-1046] - Added new option `enableAerospikePrometheusExporter` to enable Aerospike Prometheus Exporter sidecar (only) 97 | - Added Chart `4.9.0` uses Aerospike Server version `4.9.0.3` 98 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.14` 99 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.12` 100 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.8` 101 | 102 | 103 | ## [1.2.1](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.2.1) 104 | 105 | - Fixed alertmanager's default dummy configuration to avoid `CrashLoopBackOff`. 106 | - Improved usage documentation 107 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.13` 108 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.11` 109 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.6` 110 | 111 | 112 | ## [1.2.0](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.2.0) 113 | 114 | - Uses new `aerospike/aerospike-kubernetes-init` image 115 | - Aerospike tcp ports now configurable 116 | - Added support for NodePort type services to expose aerospike statefulset. 117 | - Added support for LoadBalancer type services to expose aerospike statefulset. 118 | - Added support for externalIP clusterIP type services to expose aerospike statefulset. 119 | - Added configuration to specify or create serviceAccounts to be used in Aerospike/Prometheus/Grafana/Alertmanager statefulsets. 120 | - Integrated Aerospike Monitoring stack with aerospike-prometheus-exporter, prometheus, grafana, and alertmanager. 121 | - Added dynamic configuration to pass in Aerospike alert rules conf file and alertmanager conf file. 122 | - Honor only `.Release.Namespace`. Removed `namespace` option from `values.yaml` 123 | - Added `aerospike-prometheus-exporter` as `sidecar` container (applicable only when aerospike monitoring is enabled). 124 | - Chart `4.6.0` updated to use Aerospike Server version `4.6.0.12` 125 | - Chart `4.7.0` updated to use Aerospike Server version `4.7.0.10` 126 | - Chart `4.8.0` updated to use Aerospike Server version `4.8.0.5` 127 | 128 | 129 | ## [1.1.0](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.1.0) 130 | - Update Chart `4.7.0` to use Aerospike Server version `4.7.0.5` (appVersion). 131 | - Update Chart `4.6.0` to use Aerospike Server version `4.6.0.8` (appVersion). 132 | 133 | 134 | ## [1.0.0](https://github.com/aerospike/aerospike-kubernetes/releases/tag/1.0.0) 135 | 136 | - Supports `NodeAffinity`/`PodAffinity`/`PodAntiAffinity` rules. 137 | - Set `antiAffinity` to ensure one Pod per Node (for a release). 138 | Supported Values: `off`, `soft` ('preferred' during scheduling), and `hard` ('required' during scheduling). Default : `off` 139 | - Set `antiAffinityWeight` option to specify 'weight' for 'soft' 'antiAffinity' option above. Default : `1` 140 | - Users can also define their custom `PodAffinity`/`PodAntiAffinity`/`NodeAffinity` rules using a third option `affinity`. Default: `{}` (not set) 141 | - Auto rollout changes to ConfigMaps on helm upgrade. 142 | - Set `autoRolloutConfig=true`. Default: `false` 143 | - Added option `autoGenerateNodeIds` to generate unique default node-ids. Default: `false` 144 | - Added option `hostNetworking` to enable host networking. Default: `false` 145 | - Added option `platform` to work with hostNetworking. Use both to auto-configure Aerospike to use external IP as alternate access address if it exists. 146 | Supported values : `none`, `gke`, and `eks` 147 | - Peer finder will now work with hostNetworking and use K8s Cluster DNS. 148 | - Renamed `dBReplicas` to `dbReplicas`. 149 | - Increased termination grace period from `30` to `120` default. 150 | - Changed default `aerospikeDefaultTTL` to `0` (Never Expire), dbReplicas to `3`. 151 | - Update Chart `4.7.0` to use Aerospike Server versions `4.7.0.2` (appVersion). 152 | - Update Chart `4.6.0` to use Aerospike Server version `4.6.0.5` (appVersion). 153 | -------------------------------------------------------------------------------- /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 | description: A Helm chart for Aerospike Server Community Edition on Kubernetes 21 | name: aerospike 22 | version: 5.5.0 23 | icon: https://avatars0.githubusercontent.com/u/2214313?s=200&v=4 24 | sources: 25 | - https://github.com/aerospike/aerospike-server.docker 26 | - https://github.com/aerospike/aerospike-kubernetes 27 | - https://github.com/aerospike/aerospike-kubernetes-init 28 | - https://github.com/aerospike/aerospike-prometheus-exporter 29 | maintainers: 30 | - name: spkesan 31 | email: kesan@aerospike.com 32 | url: https://github.com/spkesan 33 | -------------------------------------------------------------------------------- /helm/charts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aerospike/aerospike-kubernetes/3c9aa5a6f51e75a95929da1f1788da3e2eb1c1a1/helm/charts/.gitkeep -------------------------------------------------------------------------------- /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 | } 11 | 12 | logging { 13 | 14 | # Log file must be an absolute path. 15 | file ${LOGFILE} { 16 | context any info 17 | } 18 | 19 | # Send log messages to stdout 20 | console { 21 | context any info 22 | } 23 | } 24 | 25 | 26 | network { 27 | service { 28 | address ${SERVICE_ADDRESS} 29 | port ${SERVICE_PORT} 30 | 31 | # Uncomment the following to set the `access-address` parameter to the 32 | # IP address of the Docker host. This will the allow the server to correctly 33 | # publish the address which applications and other nodes in the cluster to 34 | # use when addressing this node. 35 | # access-address 36 | } 37 | 38 | heartbeat { 39 | 40 | address ${HB_ADDRESS} 41 | # mesh is used for environments that do not support multicast 42 | mode mesh 43 | port ${HB_PORT} 44 | 45 | # use asinfo -v 'tip:host=;port=3002' to inform cluster of 46 | # other mesh nodes 47 | # mesh-seed-placeholder 48 | 49 | interval 150 50 | timeout 10 51 | } 52 | 53 | fabric { 54 | address ${FABRIC_ADDRESS} 55 | port ${FABRIC_PORT} 56 | } 57 | 58 | info { 59 | address ${INFO_ADDRESS} 60 | port ${INFO_PORT} 61 | } 62 | } 63 | 64 | namespace ${NAMESPACE} { 65 | replication-factor ${REPL_FACTOR} 66 | memory-size ${MEM_GB}G 67 | default-ttl ${DEFAULT_TTL} 68 | 69 | # storage-engine memory 70 | 71 | # To use file storage backing, comment out the line above and use the 72 | # following lines instead. 73 | 74 | storage-engine device { 75 | file /opt/aerospike/data/${MY_POD_NAME}-${NAMESPACE}.dat 76 | filesize ${MEM_GB}G 77 | data-in-memory true # Store data in memory in addition to file. 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /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/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 {{ "}}" }}" -------------------------------------------------------------------------------- /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}] -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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/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/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/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/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 supplying aerospike config template and other necessary scripts. 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/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 | - port: {{ $ip := index $.Values.externalIpEndpoints $podIndex }} {{ $ip.Port }} 47 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 48 | protocol: TCP 49 | name: aerospike-plain 50 | selector: 51 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 52 | {{ end -}} 53 | {{- end }} 54 | 55 | {{- if .Values.externalIPServices.enabled }} 56 | {{ $length := len .Values.externalIPServices.externalIPEndpoints }} {{ if lt $length (int .Values.dbReplicas) }} 57 | {{ fail "Number of externalIPServices.externalIPEndpoints should be equal to or more than dbReplicas" }} 58 | {{ end }} 59 | {{- $dot := . }} 60 | {{ range $podIndex := until (int .Values.dbReplicas) -}} 61 | --- 62 | apiVersion: v1 63 | kind: Service 64 | metadata: 65 | name: "extip-{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 66 | namespace: {{ $.Release.Namespace }} 67 | labels: 68 | app: {{ template "aerospike.name" $dot }} 69 | chart: {{ $.Chart.Name }} 70 | release: {{ $.Release.Name }} 71 | {{- with $.Values.externalIPServices.labels }}{{ toYaml . | nindent 4 }}{{ end }} 72 | {{- with $.Values.externalIPServices.annotations }} 73 | annotations: {{- toYaml . | nindent 4 }} 74 | {{- end }} 75 | spec: 76 | externalIPs: 77 | - {{ $ip := index $.Values.externalIPServices.externalIPEndpoints $podIndex }} {{ $ip.IP }} 78 | ports: 79 | - port: {{ $ip := index $.Values.externalIPServices.externalIPEndpoints $podIndex }} {{ $ip.Port }} 80 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 81 | protocol: TCP 82 | name: aerospike-plain 83 | selector: 84 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 85 | {{ end -}} 86 | {{- end }} 87 | --- 88 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | - name: aerospike-plain 44 | port: {{ $.Values.aerospikeClientPort | default 3000 }} 45 | targetPort: {{ $.Values.aerospikeClientPort | default 3000 }} 46 | selector: 47 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 48 | {{ end -}} 49 | {{- end }} 50 | --- 51 | -------------------------------------------------------------------------------- /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 | - port: {{ $.Values.aerospikeClientPort | default 3000 }} 44 | name: aerospike-plain 45 | selector: 46 | statefulset.kubernetes.io/pod-name: "{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $podIndex }}" 47 | {{ end -}} 48 | {{- end }} 49 | --- 50 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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 -}} -------------------------------------------------------------------------------- /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/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} 49 | {{- end }} 50 | {{- with .Values.podAnnotations }}{{ toYaml . | nindent 8 }}{{ end }} 51 | spec: 52 | serviceAccountName: {{ if .Values.rbac.create }}{{ template "aerospike.fullname" . }}{{ else }}{{ .Values.rbac.serviceAccountName }}{{ end }} 53 | {{- if eq .Values.antiAffinity "hard" }} 54 | affinity: 55 | {{- with .Values.affinity }} 56 | {{ toYaml . | indent 8 }} 57 | {{- end }} 58 | podAntiAffinity: 59 | requiredDuringSchedulingIgnoredDuringExecution: 60 | - topologyKey: "kubernetes.io/hostname" 61 | labelSelector: 62 | matchExpressions: 63 | - key: unique-app 64 | operator: In 65 | values: 66 | - {{ .Release.Name }}-aerospike 67 | {{- else if eq .Values.antiAffinity "soft" }} 68 | affinity: 69 | {{- with .Values.affinity }} 70 | {{ toYaml . | indent 8 }} 71 | {{- end }} 72 | podAntiAffinity: 73 | preferredDuringSchedulingIgnoredDuringExecution: 74 | - weight: {{ .Values.antiAffinityWeight }} 75 | podAffinityTerm: 76 | topologyKey: kubernetes.io/hostname 77 | labelSelector: 78 | matchExpressions: 79 | - key: unique-app 80 | operator: In 81 | values: 82 | - {{ .Release.Name }}-aerospike 83 | {{- else}} 84 | {{- with .Values.affinity }} 85 | affinity: {{ toYaml . | nindent 8 }} 86 | {{- end }} 87 | {{- end }} 88 | {{- if or .Values.hostNetworking .Values.hostNetwork.enabled }} 89 | hostNetwork: true 90 | dnsPolicy: ClusterFirstWithHostNet 91 | {{- end }} 92 | terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds | default 600 }} 93 | {{- with .Values.tolerations }} 94 | tolerations: {{- toYaml . | nindent 8 }} 95 | {{- end }} 96 | {{- with .Values.nodeSelector }} 97 | nodeSelector: {{- toYaml . | nindent 8 }} 98 | {{- end }} 99 | securityContext: 100 | {{ toYaml .Values.podSecurityContext | indent 8 }} 101 | containers: 102 | - name: aerospike 103 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 104 | {{- with .Values.args }} 105 | args: {{- toYaml . | nindent 10 }} 106 | {{- end }} 107 | securityContext: 108 | {{ toYaml .Values.securityContext | indent 10 }} 109 | ports: 110 | - containerPort: {{ .Values.aerospikeClientPort | default 3000 }} 111 | name: aero-client 112 | - containerPort: {{ .Values.aerospikeHeartbeatPort | default 3002 }} 113 | name: aero-mesh 114 | - containerPort: {{ .Values.aerospikeFabricPort | default 3001 }} 115 | name: aero-fabric 116 | - containerPort: {{ .Values.aerospikeInfoPort | default 3003 }} 117 | name: aero-info 118 | # Do not stop node before migrations are complete 119 | lifecycle: 120 | preStop: 121 | exec: 122 | command: 123 | - /bin/sh 124 | - -c 125 | - "/etc/aerospike/aku-adm --operation pre-stop-community --log-level debug" 126 | livenessProbe: 127 | exec: 128 | command: 129 | - /bin/sh 130 | - -c 131 | - "/etc/aerospike/aku-adm --operation liveness --log-level debug" 132 | initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 30 }} 133 | periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30 }} 134 | timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 1 }} 135 | successThreshold: {{ .Values.livenessProbe.successThreshold | default 1 }} 136 | failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 3 }} 137 | readinessProbe: 138 | tcpSocket: 139 | port: {{ .Values.aerospikeClientPort | default 3000 }} 140 | initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 30 }} 141 | periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 10 }} 142 | timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 1 }} 143 | successThreshold: {{ .Values.readinessProbe.successThreshold | default 1 }} 144 | failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 3 }} 145 | volumeMounts: 146 | - name: confdir 147 | mountPath: /etc/aerospike 148 | {{- range $pv := .Values.persistenceStorage }} 149 | {{- if $pv.enabled }} 150 | {{- if eq $pv.volumeMode "Filesystem"}} 151 | - name: {{ $pv.name | quote }} 152 | mountPath: {{ $pv.mountPath | quote }} 153 | {{- end }} 154 | {{- end }} 155 | {{- end }} 156 | {{- range $lv := .Values.volumes }} 157 | - name: {{ $lv.name | quote }} 158 | mountPath: {{ $lv.mountPath | quote }} 159 | {{- end }} 160 | volumeDevices: 161 | {{- range $pv := .Values.persistenceStorage }} 162 | {{- if $pv.enabled }} 163 | {{- if eq $pv.volumeMode "Block"}} 164 | - name: {{ $pv.name | quote }} 165 | devicePath: {{ $pv.devicePath | quote }} 166 | {{- end }} 167 | {{- end }} 168 | {{- end }} 169 | resources: 170 | {{ toYaml .Values.resources | indent 10 }} 171 | env: 172 | - name: NAMESPACE 173 | value: {{ .Values.aerospikeNamespace | default "test" | quote }} 174 | - name: REPL_FACTOR 175 | value: {{ .Values.aerospikeReplicationFactor | default "2" | quote }} 176 | - name: MEM_GB 177 | value: {{ .Values.aerospikeNamespaceMemoryGB | default "1" | quote }} 178 | - name: DEFAULT_TTL 179 | value: {{ .Values.aerospikeDefaultTTL | default "0" | quote }} 180 | - name: SERVICE_PORT 181 | value: {{ .Values.aerospikeClientPort | default 3000 | quote }} 182 | - name: HB_PORT 183 | value: {{ .Values.aerospikeHeartbeatPort | default 3002 | quote }} 184 | - name: FABRIC_PORT 185 | value: {{ .Values.aerospikeFabricPort | default 3001 | quote }} 186 | - name: INFO_PORT 187 | value: {{ .Values.aerospikeInfoPort | default 3003 | quote }} 188 | # Downward API: 189 | - name: MY_POD_NAME 190 | valueFrom: 191 | fieldRef: 192 | fieldPath: metadata.name 193 | - name: MY_POD_NAMESPACE 194 | valueFrom: 195 | fieldRef: 196 | fieldPath: metadata.namespace 197 | - name: MY_POD_IP 198 | valueFrom: 199 | fieldRef: 200 | fieldPath: status.podIP 201 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 202 | - name: aerospike-prometheus-exporter 203 | image: "{{ .Values.exporterImage.repository }}:{{ .Values.exporterImage.tag }}" 204 | args: ["aerospike-prometheus-exporter", "--config", "/etc/aerospike-prometheus-exporter/ape.toml"] 205 | ports: 206 | - containerPort: {{ .Values.exporter.agentBindPort | default 9145 }} 207 | name: exporter 208 | volumeMounts: 209 | - name: apeconfdir 210 | mountPath: /etc/aerospike-prometheus-exporter 211 | {{- range $lv := .Values.volumes }} 212 | - name: {{ $lv.name | quote }} 213 | mountPath: {{ $lv.mountPath | quote }} 214 | {{- end }} 215 | env: 216 | # Downward API 217 | - name: MY_POD_NAME 218 | valueFrom: 219 | fieldRef: 220 | fieldPath: metadata.name 221 | - name: MY_POD_NAMESPACE 222 | valueFrom: 223 | fieldRef: 224 | fieldPath: metadata.namespace 225 | - name: MY_POD_IP 226 | valueFrom: 227 | fieldRef: 228 | fieldPath: status.podIP 229 | # Exporter configs 230 | - name: AGENT_CERT_FILE 231 | value: {{ .Values.exporter.agentCertFile | default "" | quote }} 232 | - name: AGENT_KEY_FILE 233 | value: {{ .Values.exporter.agentKeyFile | default "" | quote }} 234 | - name: METRIC_LABELS 235 | value: {{ .Values.exporter.metricLabels | default "" | quote }} 236 | - name: AGENT_BIND_HOST 237 | value: {{ .Values.exporter.agentBindHost | default "" | quote }} 238 | - name: AGENT_BIND_PORT 239 | value: {{ .Values.exporter.agentBindPort | default 9145 | quote }} 240 | - name: AGENT_TIMEOUT 241 | value: {{ .Values.exporter.agentTimeout | default 10 | quote }} 242 | - name: AGENT_LOG_FILE 243 | value: {{ .Values.exporter.agentLogFile | default "" | quote }} 244 | - name: AGENT_LOG_LEVEL 245 | value: {{ .Values.exporter.agentLogLevel | default "info" | quote }} 246 | - name: BASIC_AUTH_USERNAME 247 | value: {{ .Values.exporter.httpBasicAuthUsername | default "" | quote }} 248 | - name: BASIC_AUTH_PASSWORD 249 | value: {{ .Values.exporter.httpBasicAuthPassword | default "" | quote }} 250 | - name: AS_HOST 251 | value: {{ .Values.exporter.aerospikeHost | default "localhost" | quote }} 252 | - name: AS_PORT 253 | value: {{ .Values.exporter.aerospikePort | default 3000 | quote }} 254 | - name: TICKER_TIMEOUT 255 | value: {{ .Values.exporter.infoTimeout | default 5 | quote }} 256 | - name: NAMESPACE_METRICS_ALLOWLIST 257 | value: {{ .Values.exporter.namespaceMetricsAllowlist | default "" | quote }} 258 | - name: SET_METRICS_ALLOWLIST 259 | value: {{ .Values.exporter.setMetricsAllowlist | default "" | quote }} 260 | - name: NODE_METRICS_ALLOWLIST 261 | value: {{ .Values.exporter.nodeMetricsAllowlist | default "" | quote }} 262 | - name: XDR_METRICS_ALLOWLIST 263 | value: {{ .Values.exporter.xdrMetricsAllowlist | default "" | quote }} 264 | - name: NAMESPACE_METRICS_BLOCKLIST 265 | value: {{ .Values.exporter.namespaceMetricsBlocklist | default "" | quote }} 266 | - name: SET_METRICS_BLOCKLIST 267 | value: {{ .Values.exporter.setMetricsBlocklist | default "" | quote }} 268 | - name: NODE_METRICS_BLOCKLIST 269 | value: {{ .Values.exporter.nodeMetricsBlocklist | default "" | quote }} 270 | - name: XDR_METRICS_BLOCKLIST 271 | value: {{ .Values.exporter.xdrMetricsBlocklist | default "" | quote }} 272 | {{- end }} 273 | initContainers: 274 | - name: aerospike-init 275 | image: "{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}" 276 | volumeMounts: 277 | - name: confdir 278 | mountPath: /etc/aerospike 279 | - name: initconfigs 280 | mountPath: /configs 281 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 282 | - name: apeconfdir 283 | mountPath: /etc/aerospike-prometheus-exporter 284 | {{- end }} 285 | env: # Variables needed by peer-finder for discovery 286 | - name: POD_NAMESPACE 287 | valueFrom: 288 | fieldRef: 289 | fieldPath: metadata.namespace 290 | - name: SERVICE 291 | value: {{ template "aerospike.fullname" . }} 292 | - name: SERVICE_DNS_DOMAIN 293 | value: {{ .Values.clusterServiceDnsDomain | default "cluster.local" | quote }} 294 | - name: POD_NAME 295 | valueFrom: 296 | fieldRef: 297 | fieldPath: metadata.name 298 | - name: CLUSTER_NAME 299 | value: "{{ .Release.Name }}-{{ .Chart.Name }}" 300 | - name: HOST_IP 301 | valueFrom: 302 | fieldRef: 303 | fieldPath: status.hostIP 304 | - name: HEARTBEAT_PORT 305 | value: {{ .Values.aerospikeHeartbeatPort | default 3002 | quote }} 306 | - name: FABRIC_PORT 307 | value: {{ .Values.aerospikeFabricPort | default 3001 | quote }} 308 | - name: SERVICE_PORT 309 | value: {{ .Values.aerospikeClientPort | default 3000 | quote }} 310 | - name: AUTO_GENERATE_NODE_IDS 311 | value: {{ .Values.autoGenerateNodeIds | default false | quote }} 312 | - name: NODE_ID_PREFIX 313 | value: {{ .Values.nodeIDPrefix | default "a" | quote }} 314 | {{- if or .Values.hostNetworking .Values.hostNetwork.enabled }} 315 | - name: HOST_NETWORKING 316 | value: "true" 317 | {{- end }} 318 | {{- if and .Values.hostNetwork.enabled .Values.hostNetwork.useExternalIP }} 319 | - name: HOST_NETWORKING_EXTERNAL_IP 320 | value: "true" 321 | {{- end }} 322 | {{- if or .Values.enableNodePortServices .Values.nodePortServices.enabled }} 323 | - name: ENABLE_NODE_PORT_SERVICES 324 | value: "true" 325 | {{- end }} 326 | {{- if and .Values.nodePortServices.enabled .Values.nodePortServices.useExternalIP }} 327 | - name: ENABLE_NODE_PORT_SERVICES_EXTERNAL_IP 328 | value: "true" 329 | {{- end }} 330 | {{- if or .Values.enableLoadBalancerServices .Values.loadBalancerServices.enabled }} 331 | - name: ENABLE_LOADBALANCER_SERVICES 332 | value: "true" 333 | {{- end }} 334 | {{- if or .Values.enableExternalIpServices .Values.externalIPServices.enabled }} 335 | - name: ENABLE_EXTERNAL_IP_SERVICES 336 | value: "true" 337 | {{- end }} 338 | volumes: 339 | {{- if or (eq .Values.enableAerospikeMonitoring true) (eq .Values.enableAerospikePrometheusExporter true) }} 340 | - name: apeconfdir 341 | emptyDir: {} 342 | {{- end }} 343 | - name: confdir 344 | emptyDir: {} 345 | - name: initconfigs 346 | configMap: 347 | name: {{ .Release.Name }}-conf 348 | {{- range $lv := .Values.volumes }} 349 | - name: {{ $lv.name | quote }} 350 | {{ toYaml $lv.template | indent 8}} 351 | {{- end }} 352 | volumeClaimTemplates: 353 | {{- range $pv := .Values.persistenceStorage }} 354 | {{- if $pv.enabled }} 355 | - metadata: 356 | name: {{ $pv.name }} 357 | labels: *AerospikeDeploymentLabels 358 | {{- with $.Values.annotations }} 359 | annotations: {{- toYaml . | nindent 10 }} 360 | {{- end }} 361 | spec: 362 | volumeMode: {{ $pv.volumeMode }} 363 | accessModes: 364 | - {{ $pv.accessMode | quote }} 365 | {{- if hasKey $pv "storageClass" }} 366 | storageClassName: {{ $pv.storageClass | quote }} 367 | {{- end }} 368 | resources: 369 | requests: 370 | storage: {{ $pv.size | quote }} 371 | {{- end }} 372 | {{- end }} 373 | --- 374 | -------------------------------------------------------------------------------- /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 docker image 51 | ### ----------------------------------------- 52 | 53 | image: 54 | repository: aerospike/aerospike-server 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 TCP ports 82 | 83 | # aerospikeClientPort: 3000 84 | # aerospikeHeartbeatPort: 3002 85 | # aerospikeFabricPort: 3001 86 | # aerospikeInfoPort: 3003 87 | 88 | 89 | ### ----------------------------------- 90 | ### Deployment specific configurations 91 | ### ----------------------------------- 92 | 93 | # Arguments that are passed to the Aerospike container 94 | # args: [] 95 | 96 | # Rollout ConfigMap/Secrets changes on 'helm upgrade' 97 | # Alternatively, use 'kubectl rollout restart' 98 | autoRolloutConfig: false 99 | 100 | # Networking 101 | 102 | # HostNetworking 103 | hostNetwork: 104 | enabled: false 105 | useExternalIP: false 106 | 107 | # Enable NodePort Services (Type: NodePort) to expose aerospike statefulset (Use helm upgrade for scale up/down). 108 | nodePortServices: 109 | enabled: false 110 | useExternalIP: false 111 | # Extra labels for the node port services (optional) 112 | labels: {} 113 | # Extra annotations for the node port services (optional) 114 | annotations: {} 115 | 116 | # Enable LoadBalancer Services (Type: LoadBalancer) to expose aerospike statefulset (Use helm upgrade for scale up/down). 117 | loadBalancerServices: 118 | enabled: false 119 | # Extra labels for the load balancer services (optional) 120 | labels: {} 121 | # Extra annotations for load balancer services (optional) 122 | annotations: {} 123 | # cloud.google.com/load-balancer-type: "Internal" 124 | 125 | # Enable external IP Services (Type: ClusterIP) to expose aerospike statefulset (Use helm upgrade for scale up/down) 126 | externalIPServices: 127 | enabled: false 128 | externalIPEndpoints: [] 129 | # - IP: 10.160.15.199 130 | # Port: 7000 131 | # - IP: 10.160.15.199 132 | # Port: 7001 133 | # - IP: 10.160.15.199 134 | # Port: 7002 135 | # - IP: 10.160.15.200 136 | # Port: 7003 137 | # - IP: 10.160.15.200 138 | # Port: 7004 139 | # - IP: 10.160.15.200 140 | # Port: 8000 141 | # - IP: 10.160.15.217 142 | # Port: 8001 143 | # - IP: 10.160.15.217 144 | # Port: 8002 145 | # - IP: 10.160.15.217 146 | # Port: 8003 147 | # - IP: 10.160.15.217 148 | # Port: 8004 149 | # Extra labels for the external IP services (optional) 150 | labels: {} 151 | # Extra annotations for the external IP services (optional) 152 | annotations: {} 153 | 154 | # Legacy network configurations (Don't worry, these are still supported) 155 | 156 | # hostNetworking: false 157 | # enableNodePortServices: false 158 | # enableLoadBalancerServices: false 159 | # enableExternalIpServices: false 160 | # externalIpEndpoints: [] 161 | # - IP: 10.160.15.199 162 | # Port: 7000 163 | # - IP: 10.160.15.199 164 | # Port: 7001 165 | # - IP: 10.160.15.199 166 | # Port: 7002 167 | # - IP: 10.160.15.200 168 | # Port: 7003 169 | # - IP: 10.160.15.200 170 | # Port: 7004 171 | # - IP: 10.160.15.200 172 | # Port: 8000 173 | # - IP: 10.160.15.217 174 | # Port: 8001 175 | # - IP: 10.160.15.217 176 | # Port: 8002 177 | # - IP: 10.160.15.217 178 | # Port: 8003 179 | # - IP: 10.160.15.217 180 | # Port: 8004 181 | 182 | 183 | # 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. 184 | # This service account is also used for prometheus, grafana and alertmanager statefulsets when monitoring is enabled. 185 | rbac: 186 | create: true 187 | # serviceAccountName: default 188 | 189 | # Affinity / AntiAffinity configurations (For Aerospike Pods) 190 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 191 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 192 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 193 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 194 | antiAffinity: "off" 195 | antiAffinityWeight: 1 196 | affinity: {} 197 | # nodeAffinity: 198 | # requiredDuringSchedulingIgnoredDuringExecution: 199 | # nodeSelectorTerms: 200 | # - matchExpressions: 201 | # - key: kubernetes.io/hostname 202 | # operator: In 203 | # values: 204 | # - gke-gke-blr-default-pool-06a23412-0dkt 205 | 206 | # Tolerations and Taints (For Aerospike Pods) 207 | tolerations: [] 208 | # - key: "key1" 209 | # operator: "Equal" 210 | # value: "value1" 211 | # effect: "NoSchedule" 212 | # - key: "key1" 213 | # operator: "Equal" 214 | # value: "value1" 215 | # effect: "NoExecute" 216 | 217 | # Node Selector (For Aerospike Pods) 218 | nodeSelector: {} 219 | 220 | # Extra labels for the Aerospike StatefulSet 221 | labels: {} 222 | # Extra annotations for the Aerospike StatefulSet 223 | annotations: {} 224 | 225 | # Extra labels for the Aerospike pods 226 | podLabels: {} 227 | # Extra annotations for the Aerospike pods 228 | podAnnotations: {} 229 | 230 | # Define storage devices for aerospike nodes (pods) 231 | persistenceStorage: {} 232 | # - mountPath: /opt/aerospike/data 233 | # enabled: false 234 | # name: datadir 235 | # storageClass: ssd 236 | # accessMode: ReadWriteOnce 237 | # volumeMode: Filesystem 238 | # size: 1Gi 239 | # - devicePath: /dev/sdb 240 | # enabled: false 241 | # name: data-dev 242 | # storageClass: ssd 243 | # accessMode: ReadWriteOnce 244 | # size: 1Gi 245 | # volumeMode: Block 246 | 247 | # Don't specify same 'mountPath' in both 'volumes' and 'persistenceStorage' configs. 248 | volumes: 249 | - mountPath: /opt/aerospike/data 250 | name: datadir 251 | template: 252 | emptyDir: {} 253 | # - mountPath: /opt/aerospike/data2 254 | # name: datadir2 255 | # template: 256 | # emptyDir: {} 257 | 258 | # Resources - limits / requests 259 | resources: {} 260 | # limits: 261 | # cpu: 1 262 | # memory: 1Gi 263 | # requests: 264 | # cpu: 1 265 | # memory: 1Gi 266 | 267 | # Aerospike pod security context 268 | podSecurityContext: {} 269 | 270 | # Aerospike container security context 271 | securityContext: {} 272 | 273 | # Aerospike configuration file as base64 encoded string 274 | # aerospikeConfFileBase64: 275 | 276 | ### ----------------------------------------------------------- 277 | ### Dynamic configuration - Used during 'helm install...' etc. 278 | ### ----------------------------------------------------------- 279 | 280 | # Aerospike Configuration file path on helm "client" machine (from where the user is running 'helm install') 281 | # (new config) 282 | # aerospikeConfFile: 283 | 284 | # (old config) 285 | # confFilePath: 286 | 287 | # (Only when enableAerospikeMonitoring = true) Aerospike alert rules configuration file path on helm "client" machine (from where the user is running 'helm install') 288 | # (new config) 289 | # prometheus.aerospikeAlertRulesFile: 290 | 291 | # (old config) 292 | # prometheus.aerospikeAlertRulesFilePath: 293 | 294 | # (Only when enableAerospikeMonitoring = true) Alertmanager configuration file path on helm "client" machine (from where the user is running 'helm install') 295 | # (new config) 296 | # alertmanager.alertmanagerConfFile: 297 | 298 | # (old config) 299 | # alertmanager.alertmanagerConfFilePath: 300 | 301 | 302 | ### ----------------------------------------- 303 | ### Aerospike Monitoring Stack Configuration 304 | ### ----------------------------------------- 305 | 306 | # Enable Aerospike Prometheus Exporter ONLY - sidecar - aerospike prometheus exporter. 307 | # If enableAerospikeMonitoring is set to true, no need to set enableAerospikePrometheusExporter to true. 308 | enableAerospikePrometheusExporter: false 309 | 310 | # Enable Aerospike Monitoring - sidecar prometheus exporter, Prometheus, Grafana, Alertmanager stack 311 | enableAerospikeMonitoring: false 312 | 313 | 314 | ### -------------------------------------------- 315 | ### Aerospike Prometheus Exporter configuration 316 | ### -------------------------------------------- 317 | 318 | exporterImage: 319 | repository: aerospike/aerospike-prometheus-exporter 320 | tag: latest 321 | 322 | exporter: {} 323 | # agentCertFile: "" 324 | # agentKeyFile: "" 325 | # metricLabels: "zone='asia-south1-a', platform='Google Kubernetes Engine'" 326 | # agentBindHost: "" 327 | # agentBindPort: 9145 328 | # agentTimeout: 10 329 | # agentLogFile: "" 330 | # agentLogLevel: "info" 331 | # httpBasicAuthUsername: "" 332 | # httpBasicAuthPassword: "" 333 | # aerospikeHost: "localhost" 334 | # aerospikePort: 3000 335 | # infoTimeout: 5 336 | # namespaceMetricsAllowlist: "" 337 | # setMetricsAllowlist: "" 338 | # nodeMetricsAllowlist: "" 339 | # xdrMetricsAllowlist: "" 340 | # namespaceMetricsBlocklist: "" 341 | # setMetricsBlocklist: "" 342 | # nodeMetricsBlocklist: "" 343 | # xdrMetricsBlocklist: "" 344 | 345 | 346 | ### ------------------------- 347 | ### Prometheus Configuration 348 | ### ------------------------- 349 | 350 | prometheus: 351 | # Number of replicas for prometheus statefulset 352 | replicas: 2 353 | 354 | # Prometheus server port 355 | serverPort: 9090 356 | 357 | # Prometheus statefulset configs 358 | terminationGracePeriodSeconds: 120 359 | podManagementPolicy: "Parallel" 360 | updateStrategy: 361 | type: "RollingUpdate" 362 | 363 | # liveness and readiness probe parameters (for prometheus containers) 364 | livenessProbe: {} 365 | # initialDelaySeconds: 30 366 | # periodSeconds: 10 367 | # timeoutSeconds: 10 368 | # successThreshold: 1 369 | # failureThreshold: 3 370 | readinessProbe: {} 371 | # initialDelaySeconds: 30 372 | # periodSeconds: 10 373 | # timeoutSeconds: 10 374 | # successThreshold: 1 375 | # failureThreshold: 3 376 | 377 | # Prometheus scrape_interval and evaluation_interval 378 | scrapeInterval: "15s" 379 | evaluationInterval: "15s" 380 | 381 | # Prometheus docker image 382 | image: 383 | repository: prom/prometheus 384 | tag: latest 385 | 386 | # Define storage for Prometheus data 387 | persistenceStorage: 388 | # mountPath: /data 389 | # enabled: false 390 | # name: prometheus-data 391 | # storageClass: standard 392 | # accessMode: ReadWriteOnce 393 | # volumeMode: Filesystem 394 | # size: 1Gi 395 | volume: 396 | mountPath: /data 397 | name: prometheus-data 398 | template: 399 | emptyDir: {} 400 | 401 | # Resources - limits / requests 402 | resources: {} 403 | # limits: 404 | # cpu: 1 405 | # memory: 1Gi 406 | # requests: 407 | # cpu: 1 408 | # memory: 1Gi 409 | 410 | # Tolerations and Taints (For Prometheus Pods) 411 | tolerations: [] 412 | # - key: "type" 413 | # operator: "Equal" 414 | # value: "monitoring" 415 | # effect: "NoSchedule" 416 | 417 | # Node Selector (For Prometheus Pods) 418 | nodeSelector: {} 419 | 420 | # Extra labels for the Prometheus StatefulSet 421 | labels: {} 422 | # Extra annotations for the Prometheus StatefulSet 423 | annotations: {} 424 | 425 | # Extra labels for the Prometheus pods 426 | podLabels: {} 427 | # Extra annotations for the Prometheus pods 428 | podAnnotations: {} 429 | 430 | # Affinity / AntiAffinity configurations (For Prometheus Pods) 431 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 432 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 433 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 434 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 435 | antiAffinity: "off" 436 | antiAffinityWeight: 1 437 | affinity: {} 438 | # nodeAffinity: 439 | # requiredDuringSchedulingIgnoredDuringExecution: 440 | # nodeSelectorTerms: 441 | # - matchExpressions: 442 | # - key: kubernetes.io/hostname 443 | # operator: In 444 | # values: 445 | # - gke-gke-blr-default-pool-06a23412-0dkt 446 | 447 | # Aerospike alert rules configuration file path on helm "client" machine (from where the user is running 'helm install') 448 | # (new config) 449 | # aerospikeAlertRulesFile: 450 | # (old config) 451 | # aerospikeAlertRulesFilePath: 452 | 453 | # Alert rules file as base64 encoded string 454 | # aerospikeAlertRulesFileBase64: 455 | 456 | 457 | ### ---------------------- 458 | ### Grafana Configuration 459 | ### ---------------------- 460 | 461 | grafana: 462 | # Number of replicas for grafana statefulset 463 | replicas: 1 464 | 465 | # Grafana server http_port 466 | httpPort: 3000 467 | 468 | # Grafana docker image 469 | image: 470 | repository: grafana/grafana 471 | tag: latest 472 | 473 | # Grafana statefulset configs 474 | terminationGracePeriodSeconds: 120 475 | 476 | # liveness and readiness probe parameters (for grafana containers) 477 | livenessProbe: {} 478 | # initialDelaySeconds: 30 479 | # periodSeconds: 10 480 | # timeoutSeconds: 10 481 | # successThreshold: 1 482 | # failureThreshold: 10 483 | readinessProbe: {} 484 | # initialDelaySeconds: 30 485 | # periodSeconds: 10 486 | # timeoutSeconds: 10 487 | # successThreshold: 1 488 | # failureThreshold: 10 489 | 490 | # Define storage for grafana data 491 | persistenceStorage: 492 | # mountPath: /var/lib/grafana 493 | # enabled: false 494 | # name: grafana-data 495 | # storageClass: standard 496 | # accessMode: ReadWriteOnce 497 | # volumeMode: Filesystem 498 | # size: 1Gi 499 | volume: 500 | mountPath: /var/lib/grafana 501 | name: grafana-data 502 | template: 503 | emptyDir: {} 504 | 505 | # Grafana plugins to install at startup 506 | plugins: "camptocamp-prometheus-alertmanager-datasource" 507 | 508 | # Grafana username and password 509 | user: "admin" 510 | password: "admin" 511 | 512 | # Resources - limits / requests 513 | resources: {} 514 | # limits: 515 | # cpu: 1 516 | # memory: 1Gi 517 | # requests: 518 | # cpu: 1 519 | # memory: 1Gi 520 | 521 | # Tolerations and Taints (For Grafana Pods) 522 | tolerations: [] 523 | # - key: "type" 524 | # operator: "Equal" 525 | # value: "monitoring" 526 | # effect: "NoSchedule" 527 | 528 | # Node Selector (For Grafana Pods) 529 | nodeSelector: {} 530 | 531 | # Extra labels for the Grafana StatefulSet 532 | labels: {} 533 | # Extra annotations for the Grafana StatefulSet 534 | annotations: {} 535 | 536 | # Extra labels for the Grafana pods 537 | podLabels: {} 538 | # Extra annotations for the Grafana pods 539 | podAnnotations: {} 540 | 541 | # Affinity / AntiAffinity configurations (For Grafana Pods) 542 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 543 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 544 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 545 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 546 | antiAffinity: "off" 547 | antiAffinityWeight: 1 548 | affinity: {} 549 | # nodeAffinity: 550 | # requiredDuringSchedulingIgnoredDuringExecution: 551 | # nodeSelectorTerms: 552 | # - matchExpressions: 553 | # - key: kubernetes.io/hostname 554 | # operator: In 555 | # values: 556 | # - gke-gke-blr-default-pool-06a23412-0dkt 557 | 558 | 559 | ### --------------------------- 560 | ### Alertmanager Configuration 561 | ### --------------------------- 562 | 563 | alertmanager: 564 | # Number of replicas for alertmanager statefulset 565 | replicas: 1 566 | 567 | # Alertmanager web port and gossip port 568 | webPort: 9093 569 | meshPort: 9094 570 | 571 | # Alertmanager statefulset configs 572 | terminationGracePeriodSeconds: 120 573 | podManagementPolicy: "OrderedReady" 574 | updateStrategy: 575 | type: "RollingUpdate" 576 | 577 | # liveness and readiness probe parameters (for grafana containers) 578 | livenessProbe: {} 579 | # initialDelaySeconds: 30 580 | # periodSeconds: 10 581 | # timeoutSeconds: 10 582 | # successThreshold: 1 583 | # failureThreshold: 10 584 | readinessProbe: {} 585 | # initialDelaySeconds: 30 586 | # periodSeconds: 10 587 | # timeoutSeconds: 10 588 | # successThreshold: 1 589 | # failureThreshold: 10 590 | 591 | # Alertmanager docker image 592 | image: 593 | repository: prom/alertmanager 594 | tag: latest 595 | 596 | # Alertmanager logging level 597 | loglevel: info 598 | 599 | # Define storage for alertmanager data 600 | persistenceStorage: 601 | # mountPath: /data 602 | # enabled: false 603 | # name: alertmanager-data 604 | # storageClass: standard 605 | # accessMode: ReadWriteOnce 606 | # volumeMode: Filesystem 607 | # size: 1Gi 608 | volume: 609 | mountPath: /data 610 | name: alertmanager-data 611 | template: 612 | emptyDir: {} 613 | 614 | # Resources - limits / requests 615 | resources: {} 616 | # limits: 617 | # cpu: 1 618 | # memory: 1Gi 619 | # requests: 620 | # cpu: 1 621 | # memory: 1Gi 622 | 623 | # Tolerations and Taints (For Alertmanager Pods) 624 | tolerations: [] 625 | # - key: "type" 626 | # operator: "Equal" 627 | # value: "monitoring" 628 | # effect: "NoSchedule" 629 | 630 | # Node Selector (For Alertmanager Pods) 631 | nodeSelector: {} 632 | 633 | # Extra labels for the Alertmanager StatefulSet 634 | labels: {} 635 | # Extra annotations for the Alertmanager StatefulSet 636 | annotations: {} 637 | 638 | # Extra labels for the Alertmanager pods 639 | podLabels: {} 640 | # Extra annotations for the Alertmanager pods 641 | podAnnotations: {} 642 | 643 | # Affinity / AntiAffinity configurations (For Alertmanager Pods) 644 | # Setting 'antiAffinity' option will prevent two pods of the same release be scheduled on the same node. 645 | # 'antiAffinity' levels can be "off" (not set), "soft" (preferredDuringSchedulingIgnoredDuringExecution) and "hard" (requiredDuringSchedulingIgnoredDuringExecution) 646 | # Set a desired 'antiAffinityWeight' in range 1-100 for "soft" antiAffinity option. 647 | # 'affinity' option can be used to defined any custom nodeAffinity/podAffinity/podAntiAffinity rules. 648 | antiAffinity: "off" 649 | antiAffinityWeight: 1 650 | affinity: {} 651 | # nodeAffinity: 652 | # requiredDuringSchedulingIgnoredDuringExecution: 653 | # nodeSelectorTerms: 654 | # - matchExpressions: 655 | # - key: kubernetes.io/hostname 656 | # operator: In 657 | # values: 658 | # - gke-gke-blr-default-pool-06a23412-0dkt 659 | 660 | # Alertmanager configuration file path on helm "client" machine (from where the user is running 'helm install') 661 | # (new config) 662 | # alertmanagerConfFile: 663 | # (old config) 664 | # alertmanagerConfFilePath: 665 | 666 | # Alertmanager configuration file as base64 encoded string 667 | # alertmanagerConfFileBase64: 668 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 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: NSUP_PERIOD 83 | value: "$AEROSPIKE_NSUP_PERIOD" 84 | # Downward API: 85 | - name: MY_POD_NAME 86 | valueFrom: 87 | fieldRef: 88 | fieldPath: metadata.name 89 | - name: MY_POD_NAMESPACE 90 | valueFrom: 91 | fieldRef: 92 | fieldPath: metadata.namespace 93 | - name: MY_POD_IP 94 | valueFrom: 95 | fieldRef: 96 | fieldPath: status.podIP 97 | initContainers: 98 | - name: aerospike-init 99 | image: aerospike/aerospike-kubernetes-init:1.1.0 100 | volumeMounts: 101 | - name: confdir 102 | mountPath: /etc/aerospike 103 | - name: initconfigs 104 | mountPath: /configs 105 | env: # Variables needed by peer-finder for discovery 106 | - name: POD_NAMESPACE 107 | valueFrom: 108 | fieldRef: 109 | fieldPath: metadata.namespace 110 | - name: SERVICE 111 | value: aerospike 112 | volumes: 113 | - name: confdir 114 | emptyDir: {} 115 | - name: initconfigs 116 | configMap: 117 | name: aerospike-conf 118 | volumeClaimTemplates: 119 | - metadata: 120 | name: datadir 121 | labels: *AerospikeDeploymentLabels 122 | spec: 123 | accessModes: 124 | - ReadWriteOnce 125 | storageClassName: ssd 126 | resources: 127 | requests: 128 | storage: ${AEROSPIKE_MEM}Gi 129 | --- 130 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_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 | --------------------------------------------------------------------------------