Skip to content

Commit f3ffb7c

Browse files
Voltdb helm chart (#6)
* feat: voltdb helm chart * chore: add values.yaml for ci * fix: license key in configmap * chore: address pr review comments * feat: allow custom voltdb configuration * chore: update ci values * fix: children and indentation in deployment.xml --------- Signed-off-by: Akshay Patidar <akshaypatidar1999@gmail.com>
1 parent 58539bb commit f3ffb7c

16 files changed

+1141
-0
lines changed

charts/voltdb/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/voltdb/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: common
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 1.17.1
5+
digest: sha256:dacc73770a5640c011e067ff8840ddf89631fc19016c8d0a9e5ea160e7da8690
6+
generated: "2023-08-09T19:27:57.595439+05:30"

charts/voltdb/Chart.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v2
2+
name: voltdb
3+
description: Voltdb helm chart
4+
version: 0.1.0
5+
appVersion: "9.2.1"
6+
keywords:
7+
- voltdb
8+
dependencies:
9+
- name: common
10+
repository: https://charts.bitnami.com/bitnami
11+
tags:
12+
- bitnami-common
13+
version: 1.x.x
14+
maintainers:
15+
- name: Dream11
16+
url: https://www.dream11.com/

charts/voltdb/README.md

Lines changed: 170 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
voltdb:
2+
deployment:
3+
cluster:
4+
kfactor: 2
5+
hostcount: 3
6+
replicaCount: 3
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
voltdb:
2+
deployment:
3+
import:
4+
configuration:
5+
- type: kafka
6+
enabled: false
7+
format: csv
8+
version: 10
9+
properties:
10+
- name: topics
11+
value: employees
12+
- name: procedure
13+
value: EMPLOYEE.insert
14+
- name: brokers
15+
value: kafkasvr:9092
16+
17+
export:
18+
configuration:
19+
- type: kafka
20+
enabled: false
21+
target: target
22+
properties:
23+
- name: bootstrap.servers
24+
value: kafkasvr:9092
25+
- name: topic.prefix
26+
value: employees
27+
- name: skipinternals
28+
value: true
29+
- name: acks
30+
value: 1
31+
32+
snapshot:
33+
enabled: true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
image:
2+
tag: 8.4.1

charts/voltdb/templates/NOTES.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CHART NAME: {{ .Chart.Name }}
2+
CHART VERSION: {{ .Chart.Version }}
3+
APP VERSION: {{ .Chart.AppVersion }}
4+
5+
** Please be patient while the chart is being deployed **
6+
7+
Check the cluster status by running:
8+
9+
kubectl exec -it --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/name={{ include "common.names.name" . }},app.kubernetes.io/instance={{ .Release.Name }} -o jsonpath='{.items[0].metadata.name}') -- sqlcmd
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
3+
{{/*
4+
Return the proper voltdb image name
5+
*/}}
6+
{{- define "voltdb.image" -}}
7+
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
8+
{{- end -}}
9+
10+
{{/*
11+
Create the name of the service account to use
12+
*/}}
13+
{{- define "voltdb.serviceAccountName" -}}
14+
{{- if .Values.serviceAccount.create -}}
15+
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
16+
{{- else -}}
17+
{{ default "default" .Values.serviceAccount.name }}
18+
{{- end -}}
19+
{{- end -}}
20+
21+
{{/*
22+
Return the voltdb configuration configmap
23+
*/}}
24+
{{- define "voltdb.configmapName" -}}
25+
{{- printf "%s-configuration" (include "common.names.fullname" .) -}}
26+
{{- end -}}
27+
28+
{{/*
29+
Return the proper Docker Image Registry Secret Names
30+
*/}}
31+
{{- define "voltdb.imagePullSecrets" -}}
32+
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) }}
33+
{{- end -}}
34+
35+
{{/*
36+
Return the list of voltdb hosts
37+
*/}}
38+
{{- define "voltdb.hosts" -}}
39+
{{- $hosts := list }}
40+
{{- $fullname := include "common.names.fullname" . }}
41+
{{- $releaseNamespace := .Release.Namespace }}
42+
{{- $clusterDomain := .Values.clusterDomain }}
43+
{{- $hostCount := .Values.replicaCount | int }}
44+
{{- range $e, $i := until $hostCount }}
45+
{{- $hosts = append $hosts (printf "%s-%d.%s-headless.%s.svc.%s" $fullname $i $fullname $releaseNamespace $clusterDomain) }}
46+
{{- end }}
47+
{{- join "," $hosts }}
48+
{{- end -}}
49+
50+
{{/*
51+
Return path to deployment.xml
52+
*/}}
53+
{{- define "voltdb.configPath" -}}
54+
{{- printf "%s/deployment.xml" .Values.voltdb.directorySpec -}}
55+
{{- end -}}
56+
57+
{{/*
58+
Return path to license.xml
59+
*/}}
60+
{{- define "voltdb.licensePath" -}}
61+
{{- printf "%s/license.xml" .Values.voltdb.directorySpec -}}
62+
{{- end -}}
63+
64+
{{/*
65+
Return path to voltdbroot
66+
*/}}
67+
{{- define "voltdb.rootPath" -}}
68+
{{- printf "%s/voltdbroot" .Values.voltdb.directorySpec -}}
69+
{{- end -}}
70+
71+
{{/*
72+
Return terminal paths in a dictionary
73+
Usage: {{ include "util.terminalPaths" dict }}
74+
*/}}
75+
{{- define "util.terminalPaths" -}}
76+
{{- $terminalPaths := list }}
77+
{{- range $k, $v := . }}
78+
{{- if not (or (kindIs "map" $v) (kindIs "slice" $v)) -}}
79+
{{- $terminalPaths = append $terminalPaths (printf "%s=\"%v\"" $k $v) }}
80+
{{- end }}
81+
{{- end }}
82+
{{- join " " $terminalPaths }}
83+
{{- end -}}
84+
85+
{{/*
86+
Return if a dictionary is nested
87+
Usage: {{ include "util.isNested" dict }}
88+
*/}}
89+
{{- define "util.isNested" -}}
90+
{{- $isNested := false -}}
91+
{{- range $k, $v := . }}
92+
{{- if or (kindIs "map" $v) (kindIs "slice" $v) -}}
93+
{{- $isNested = true -}}
94+
{{- end }}
95+
{{- end }}
96+
{{- $isNested }}
97+
{{- end -}}
98+
99+
{{/*
100+
Return voltdb configuration
101+
*/}}
102+
{{- define "voltdb.configuration" -}}
103+
{{- $currentIndentation:= ($.indentation | default "") -}}
104+
{{- range $k, $v := .object }}
105+
{{- if or (eq "import" $k) (eq "export" $k) -}}
106+
{{- else if kindIs "map" $v -}}
107+
108+
{{- if eq "false" (include "util.isNested" $v) -}}
109+
{{- printf "%s<%s %s/>\n" $currentIndentation $k (include "util.terminalPaths" $v ) }}
110+
{{- else -}}
111+
{{- printf "%s<%s %s>\n" $currentIndentation $k (include "util.terminalPaths" $v ) }}
112+
{{- printf "%s" (include "voltdb.configuration" (dict "object" $v "indentation" (printf "%s " $currentIndentation))) }}
113+
{{- printf "%s</%s>\n" $currentIndentation $k -}}
114+
{{- end -}}
115+
{{- else if kindIs "slice" $v -}}
116+
{{- range $dict := $v }}
117+
{{- printf "%s" (include "voltdb.configuration" (dict "object" (dict $k $dict) "indentation" (printf "%s" $currentIndentation))) }}
118+
{{- end }}
119+
{{- else -}}
120+
{{- end -}}
121+
{{- end }}
122+
{{- end -}}
123+
124+
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "voltdb.configmapName" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels: {{- include "common.labels.standard" . | nindent 4 }}
7+
{{- if .Values.commonLabels }}
8+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
9+
{{- end }}
10+
data:
11+
deployment.xml: |
12+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
13+
<deployment>
14+
<paths>
15+
<voltdbroot path="{{ include "voltdb.rootPath" . }}"/>
16+
<snapshots path="{{ include "voltdb.rootPath" . }}/snapshots"/>
17+
<exportoverflow path="{{ include "voltdb.rootPath" . }}/export_overflow"/>
18+
<droverflow path="{{ include "voltdb.rootPath" . }}/dr_overflow"/>
19+
<commandlog path="{{ include "voltdb.rootPath" . }}/command_log"/>
20+
<commandlogsnapshot path="{{ include "voltdb.rootPath" . }}/command_log_snapshot"/>
21+
<largequeryswap path="{{ include "voltdb.rootPath" . }}/large_query_swap"/>
22+
</paths>
23+
{{- include "voltdb.configuration" (dict "object" .Values.voltdb.deployment) | nindent 6 }}
24+
<import>
25+
{{- range .Values.voltdb.deployment.import.configuration }}
26+
<configuration type="{{ .type }}" enabled="{{ .enabled }}" format="{{ .format }}" version="{{ .version }}">
27+
{{- range .properties }}
28+
<property name="{{ .name }}">{{ .value }}</property>
29+
{{- end }}
30+
</configuration>
31+
{{- end }}
32+
</import>
33+
34+
<export>
35+
{{- range .Values.voltdb.deployment.export.configuration }}
36+
<configuration type="{{ .type }}" enabled="{{ .enabled }}" target="{{ .target }}">
37+
{{- range .properties }}
38+
<property name="{{ .name }}">{{ .value }}</property>
39+
{{- end }}
40+
</configuration>
41+
{{- end }}
42+
</export>
43+
</deployment>
44+
45+
{{- if .Values.voltdb.license }}
46+
license.xml: |
47+
{{ .Values.voltdb.license | indent 4 }}
48+
{{- end }}

0 commit comments

Comments
 (0)