Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aerospike #2

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
eefdc32
add chart for aerospike
kavehmz Sep 13, 2017
ec8ec1a
Merge remote-tracking branch 'up/master' into aerospike
kavehmz Sep 14, 2017
ae75a82
movig the config content to value file so it can be overwritten by pa…
kavehmz Sep 20, 2017
38de982
after moving the content to yaml file there is no need to keep this f…
kavehmz Sep 20, 2017
69bcf1d
Merge remote-tracking branch 'up/master' into aerospike
kavehmz Oct 12, 2017
55d7902
adding service type and related params to values.
kavehmz Oct 12, 2017
20d0020
bumping aerospike version
kavehmz Oct 12, 2017
be7d2e3
Merge remote-tracking branch 'up/master' into aerospike
kavehmz Oct 20, 2017
4990668
adding affinity for aerospike
kavehmz Oct 20, 2017
807a728
bumping aerospike version
kavehmz Oct 20, 2017
cc01e89
Merge remote-tracking branch 'origin/master' into aerospike
kavehmz Oct 24, 2017
2ea7e0b
Merge remote-tracking branch 'up/master' into aerospike
kavehmz Oct 25, 2017
5a5e862
aerospike: changing the volumeClaimTemplates to be more general so we…
kavehmz Oct 25, 2017
496c322
aerospike: Using a more general name in comment
kavehmz Oct 25, 2017
ee95d8e
aerospike: Bumping chart version based on new tweaks
kavehmz Oct 25, 2017
b483f7a
aerospike: removing trailing space to pass lint
kavehmz Oct 25, 2017
ba72ef3
aerospike: removing trailing space to pass yamllint
kavehmz Oct 25, 2017
5657349
Merge remote-tracking branch 'up/master' into aerospike
kavehmz Oct 26, 2017
04f0f0c
aerospike: we need to separate mesh service from client service. Mesh…
kavehmz Oct 26, 2017
a006aeb
aerospike: adding mess port to general service. This way a setup can …
kavehmz Oct 27, 2017
708ca97
Merge remote-tracking branch 'up/master' into aerospike
kavehmz Nov 20, 2017
fce9ed4
[stable/aerospike] adding maintainers section to Charts.yaml
kavehmz Nov 20, 2017
4be76bd
[stable/aerospike] Align table nicely.
kavehmz Nov 20, 2017
b108373
[stable/aerospike] namespacing templates (see #1785)
kavehmz Nov 20, 2017
2a0b5be
[stable/aerospike] adding standard labels
kavehmz Nov 20, 2017
d14eecc
[stable/aerospike] removing unnecessary labels from statefulset tem…
kavehmz Nov 20, 2017
cda486d
[stable/aerospike] using IfNotPresent for pullPolicy
kavehmz Nov 20, 2017
fe0b1b5
[stable/aerospike] adding newline (Chart.yaml)
kavehmz Nov 20, 2017
1a3c3d1
Merge remote-tracking branch 'up/master' into aerospike
kavehmz Nov 23, 2017
383f023
[stable/aerospike] fixing a typo apiVersion -> appVersion
kavehmz Nov 23, 2017
b1d7ea6
[stable/aerospike] using github username
kavehmz Nov 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions stable/aerospike/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
11 changes: 11 additions & 0 deletions stable/aerospike/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v3.14.1.2
description: A Helm chart for Aerospike in Kubernetes
name: aerospike
keywords:
- aerospike
- big-data
home: http://aerospike.com
version: 0.1.5
icon: https://s3-us-west-1.amazonaws.com/aerospike-fd/wp-content/uploads/2016/06/Aerospike_square_logo.png
sources:
- https://github.com/aerospike/aerospike-server
69 changes: 69 additions & 0 deletions stable/aerospike/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Aerospike Helm Chart

This is an implementation of Aerospike StatefulSet found here:

* https://github.com/aerospike/aerospike-kubernetes

## Pre Requisites:

* Kubernetes 1.5 with beta APIs enabled and support for statefulsets

* PV support on underlying infrastructure (only if you are provisioning persistent volume).

* Requires at least `v2.5.0` version of helm to support

## StatefulSet Details

* https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/

## StatefulSet Caveats

* https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations

## Chart Details

This chart will do the following:

* Implement a dynamically scalable Aerospike cluster using Kubernetes StatefulSets

### Installing the Chart

To install the chart with the release name `my-aerospike` using a dedicated namespace(recommended):

```
$ helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
$ helm install --name my-aerospike --namespace aerospike incubator/aerospike
```

The chart can be customized using the following configurable parameters:

| Parameter | Description | Default |
| ----------------------- | ---------------------------------- | ---------------------------------------------------------- |
| `image.repository` | Aerospike Container image name | `aerospike/aerospike-server` |
| `image.tag` | Aerospike Container image tag | `3.14.1.2` |
| `image.pullPolicy` | Aerospike Container pull policy | `Always` |
| `replicaCount` | Aerospike Brokers | `1` |
| `persistentVolume` | Configuration of persistent volumes for storage-engine | `{}` |
| `confFile` | Aerospike config filename. This file should be included in the chart path. | `aerospike.conf` |
| `resources` | Aerospike resource requests and limits | `{}` |
| `nodeSelector` | Labels for pod assignment | `{}` |
| `terminationGracePeriodSeconds` | This is the time kubernetes will wait before forcefully terminating the container | `30` |

Specify parameters using `--set key=value[,key=value]` argument to `helm install`

Alternatively a YAML file that specifies the values for the parameters can be provided like this:

```bash
$ helm install --name my-aerospike -f values.yaml incubator/aerospike
```

### Conf files for Aerospike

There is one conf file added to each Aerospike release. This conf file can be replaced with a custom file and updating the `confFile` value.

If you modify the `aerospike.conf` (and you use more than 1 replica), you want to add the `#REPLACE_THIS_LINE_WITH_MESH_CONFIG` comment to the config file (see the default conf file). This will update your mesh to connect each replica.

## Known Limitations

* Persistent volume claims tested only on GCP
* Aerospike cluster is not accessible via an external endpoint
8 changes: 8 additions & 0 deletions stable/aerospike/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The Aerospike can be accessed via port 3000 on the following DNS name from within your cluster:

{{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local

You can connect to aeropike in your local machine using port-forwarding:

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 3000:3000
26 changes: 26 additions & 0 deletions stable/aerospike/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create aerospike mesh setup
*/}}
{{- define "aerospike.mesh" -}}
{{- $fullname := include "fullname" . -}}
{{- range $i, $e := until (.Values.replicaCount|int) }}
{{ printf "mesh-seed-address-port %s-%d.%s 3002" $fullname $i $fullname }}
{{- end -}}
{{- end -}}
9 changes: 9 additions & 0 deletions stable/aerospike/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
data:
aerospike.conf: |
# aerospike configuration
{{- $mesh := include "aerospike.mesh" . }}
{{ .Values.confFile |replace "#REPLACE_THIS_LINE_WITH_MESH_CONFIG" $mesh | indent 4}}
30 changes: 30 additions & 0 deletions stable/aerospike/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
{{- range $key, $value := .Values.service.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{ if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP | quote }}
{{ end }}
type: {{ .Values.service.type }}
{{ if eq .Values.service.type "LoadBalancer" -}} {{ if .Values.service.loadBalancerIP -}}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{ end -}}
{{- end -}}
ports:
- port: 3000
protocol: TCP
name: aerospike-client
selector:
app: {{ template "name" . }}
release: {{ .Release.Name }}
66 changes: 66 additions & 0 deletions stable/aerospike/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
serviceName: {{ template "fullname" . }}
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 3000
name: aero-clients
- containerPort: 3002
name: aero-mesh
- containerPort: 3003
name: aero-info
readinessProbe:
tcpSocket:
port: 3000
initialDelaySeconds: 15
timeoutSeconds: 1
volumeMounts:
- name: config-volume
mountPath: /etc/aerospike
{{- range $pv := .Values.persistentVolume }}
- name: {{ $pv.name | quote }}
mountPath: {{ $pv.mountPath | quote }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- if .Values.affinity }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
volumes:
- name: config-volume
configMap:
name: {{ template "fullname" . }}
items:
- key: aerospike.conf
path: aerospike.conf
volumeClaimTemplates:
{{- range $pv := .Values.persistentVolume }}
- metadata:
name: {{ $pv.name | quote }}
spec:
{{ toYaml $pv.template | indent 6 }}
{{- end }}
96 changes: 96 additions & 0 deletions stable/aerospike/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Default values for aerospike.
terminationGracePeriodSeconds: 30
replicaCount: 1
nodeSelector: {}
image:
repository: aerospike/aerospike-server
tag: 3.14.1.2
pullPolicy: Always

# Set as empty object {} if no volumes need to be created
# See confFile below
persistentVolume: {}
# - mountPath: /opt/aerospike/data
# name: aerospike-data
# template:
# accessModes: [ "ReadWriteOnce" ]
# # storageClassName: "standard"
# resources:
# requests:
# storage: "36G"
# selector:
# matchLabels:
# diskname: "aerospike-data"

service:
type: ClusterIP
annotations: {}
loadBalancerIP:
clusterIP: None

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

confFile: |-
#default config file
service {
user root
group root
paxos-single-replica-limit 1
pidfile /var/run/aerospike/asd.pid
service-threads 4
transaction-queues 4
transaction-threads-per-queue 4
proto-fd-max 15000
}
logging {
file /var/log/aerospike/aerospike.log {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle with Kubernetes we don't need to log to files anymore. I think it should be enough to log to the console.

context any info
}

console {
context any info
}
}
network {
service {
address any
port 3000
}
heartbeat {
address any
interval 150
#REPLACE_THIS_LINE_WITH_MESH_CONFIG
mode mesh
port 3002
timeout 20
protocol v3

}
fabric {
port 3001
}

info {
port 3003
}
}

namespace test {
replication-factor 2
memory-size 1G
default-ttl 5d
storage-engine device {
file /opt/aerospike/data/test.dat
filesize 4G
}
}