Skip to content

Commit e55467a

Browse files
authored
Initial Commit for Marklogic Helm Chart (#3)
CLD-392: Develop Helm Chart * use template directives for names * make ServiceAccount following Helm convention * split the headless service and ClusterIP service in to 2 yaml files * add helm test for testing connections * add emptyDir if disable the persistence PVC * add README with Chart usage * remove resource request and limit by default * add imagePullSecret * CLD-424: Using Terratest for E2E test * package helm chart for repo hosting * change chart version * CLD-456: Configure DNS search entries dynamically * set the storageClass to empty to use the default storage class * update e2e test script with Minikube * make ML_BOOTSTRAP_HOST adapt to the change of name in configmap * change the container name to marklogic-server * CLD-472: Use Resolvable FQDN for Marklogic hostname * remove ingress and roles that won't ship in EA1 release * add extraContainerPorts * disable turning on XDQP * update default image version to 10.0-9.1-centos-1.0.0-ea4
1 parent 99e1db1 commit e55467a

21 files changed

+2119
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,4 @@ This table describes the list of available parameters for Helm Chart.
273273
| `persistence.size` | Size of storage request for MarkLogic data volume | `10Gi` |
274274
| `persistence.annotations` | Annotations for Persistence Volume Claim (PVC) | `{}` |
275275
| `persistence.accessModes` | Access mode for persistence volume | `["ReadWriteOnce"]` |
276-
| `persistence.mountPath` | The path for the mounted persistence data volume | `/var/opt/MarkLogic` |
276+
| `persistence.mountPath` | The path for the mounted persistence data volume | `/var/opt/MarkLogic` |

charts/.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/Chart.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
annotations:
2+
category: Database
3+
apiVersion: v2
4+
name: marklogic
5+
description: MarkLogic Server is a multi-model database that has both NoSQL and trusted enterprise data management capabilities.
6+
appVersion: "10.0-9.1"
7+
type: application
8+
keywords:
9+
- marklogic
10+
- database
11+
- nosql
12+
sources:
13+
- https://github.com/marklogic/marklogic-kubernetes
14+
- https://www.marklogic.com/
15+
version: 1.0.0-ea1

charts/templates/_helpers.tpl

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "marklogic.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "marklogic.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "marklogic.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Create headless service name for statefulset
35+
*/}}
36+
{{- define "marklogic.headlessServiceName" -}}
37+
{{- printf "%s-headless" (include "marklogic.fullname" .) }}
38+
{{- end}}
39+
40+
41+
{{/*
42+
Create URL for headless service
43+
*/}}
44+
{{- define "marklogic.headlessURL" -}}
45+
{{- printf "%s.%s.svc.cluster.local" (include "marklogic.headlessServiceName" .) .Release.Namespace }}
46+
{{- end}}
47+
48+
{{/*
49+
Common labels
50+
*/}}
51+
{{- define "marklogic.labels" -}}
52+
helm.sh/chart: {{ include "marklogic.chart" . }}
53+
{{ include "marklogic.selectorLabels" . }}
54+
{{- if .Chart.AppVersion }}
55+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
56+
{{- end }}
57+
app.kubernetes.io/managed-by: {{ .Release.Service }}
58+
{{- end }}
59+
60+
{{/*
61+
Selector labels
62+
*/}}
63+
{{- define "marklogic.selectorLabels" -}}
64+
app.kubernetes.io/name: {{ include "marklogic.name" . }}
65+
app.kubernetes.io/instance: {{ .Release.Name }}
66+
{{- end }}
67+
68+
{{/*
69+
Create the name of the service account to use
70+
*/}}
71+
{{- define "marklogic.serviceAccountName" -}}
72+
{{- if .Values.serviceAccount.create }}
73+
{{- default (include "marklogic.fullname" .) .Values.serviceAccount.name }}
74+
{{- else }}
75+
{{- default "default" .Values.serviceAccount.name }}
76+
{{- end }}
77+
{{- end }}

charts/templates/configmap.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "marklogic.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "marklogic.labels" . | nindent 4 }}
8+
data:
9+
ML_BOOTSTRAP_HOST: {{ include "marklogic.fullname" . }}-0
10+
ML_FQDN_SUFFIX: {{ include "marklogic.headlessURL" . }}
11+

charts/templates/secret-registry.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- $imagePullSecret := .Values.imagePullSecret }}
2+
{{- if not (empty $imagePullSecret) }}
3+
apiVersion: v1
4+
kind: Secret
5+
metadata:
6+
name: {{ include "marklogic.fullname" . }}-registry
7+
namespace: {{ .Release.Namespace }}
8+
labels:
9+
{{- include "marklogic.labels" . | nindent 4 }}
10+
type: kubernetes.io/dockerconfigjson
11+
data:
12+
.dockerconfigjson: {{ printf `{"auths":{%s:{"auth":"%s"}}}` ($imagePullSecret.registry | quote) (printf "%s:%s" $imagePullSecret.username $imagePullSecret.password | b64enc) | b64enc | quote }}
13+
{{- end }}

charts/templates/secret.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "marklogic.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "marklogic.labels" . | nindent 4 }}
8+
type: kubernetes.io/basic-auth
9+
stringData:
10+
username: {{ .Values.auth.adminUsername}}
11+
password: {{ .Values.auth.adminPassword}}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "marklogic.headlessServiceName" .}}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "marklogic.labels" . | nindent 4 }}
8+
spec:
9+
clusterIP: None
10+
publishNotReadyAddresses: true
11+
selector:
12+
{{- include "marklogic.selectorLabels" . | nindent 4 }}
13+
ports:
14+
- protocol: TCP
15+
name: health-check
16+
port: 7997
17+
- protocol: TCP
18+
name: foreign-bind
19+
port: 7998
20+
- protocol: TCP
21+
name: bind
22+
port: 7999
23+
- protocol: TCP
24+
name: query-console
25+
port: 8000
26+
- protocol: TCP
27+
name: admin
28+
port: 8001
29+
- protocol: TCP
30+
name: manage
31+
port: 8002

charts/templates/service.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "marklogic.fullname" . }}
5+
namespace: {{ .Values.namespace}}
6+
labels:
7+
{{- include "marklogic.labels" . | nindent 4 }}
8+
spec:
9+
selector:
10+
{{- include "marklogic.selectorLabels" . | nindent 4 }}
11+
type: {{ .Values.service.type }}
12+
ports: {{- toYaml .Values.service.ports | nindent 4 }}

charts/templates/serviceaccount.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if .Values.serviceAccount.create }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "marklogic.serviceAccountName" . }}
6+
labels:
7+
{{- include "marklogic.labels" . | nindent 4 }}
8+
imagePullSecrets:
9+
- name: regcred
10+
{{- end }}

0 commit comments

Comments
 (0)