Skip to content

Commit 96324b6

Browse files
author
Romain Winieski
authored
Merge branch 'develop' into features/CLD-701-secret-as-file
2 parents 47ec860 + c2a0515 commit 96324b6

15 files changed

+1084
-109
lines changed

Jenkinsfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ void pullImage() {
135135
sh """
136136
echo "\$docker_password" | docker login --username \$docker_user --password-stdin ${dockerRegistry}
137137
docker pull ${dockerRepository}:${dockerVersion}
138+
docker pull ${dockerRepository}:${dockerVersion}
139+
docker pull ${dockerRepository}:${prevDockerVersion}
138140
"""
139141
}
140142
}
@@ -169,14 +171,18 @@ pipeline {
169171
dockerRegistry = 'ml-docker-dev.marklogic.com'
170172
dockerRepository = "${dockerRegistry}/marklogic/marklogic-server-centos"
171173
dockerVerDivider = getVersionDiv(params.ML_VERSION)
174+
prevDockerVerDivider = getVersionDiv(params.PREV_ML_VERSION)
172175
dockerVersion = "${ML_VERSION}${dockerVerDivider}${timeStamp}-centos-${dockerReleaseVer}"
176+
prevDockerVersion = "${PREV_ML_VERSION}${prevDockerVerDivider}${timeStamp}-centos-${prevDockerReleaseVer}"
173177
}
174178

175179
parameters {
176180
string(name: 'emailList', defaultValue: emailList, description: 'List of email for build notification', trim: true)
177181
choice(name: 'ML_VERSION', choices: '11.0\n12.0\n10.0\n9.0', description: 'MarkLogic version. used to pick appropriate docker image')
178182
booleanParam(name: 'KUBERNETES_TESTS', defaultValue: true, description: 'Run kubernetes tests')
179-
string(name: 'dockerReleaseVer', defaultValue: '1.0.1', description: 'Current Docker version. (e.g. 1.0.1)', trim: true)
183+
string(name: 'dockerReleaseVer', defaultValue: '1.0.2', description: 'Current Docker version. (e.g. 1.0.1)', trim: true)
184+
choice(name: 'PREV_ML_VERSION', choices: '10.0\n9.0', description: 'Previous MarkLogic version for MarkLogic upgrade tests')
185+
string(name: 'prevDockerReleaseVer', defaultValue: '1.0.2', description: 'Previous Docker version for MarkLogic upgrade tests. (e.g. 1.0.1)', trim: true)
180186
}
181187

182188
stages {
@@ -205,7 +211,7 @@ pipeline {
205211
steps {
206212
sh """
207213
export MINIKUBE_HOME=/space;
208-
make test dockerImage=${dockerRepository}:${dockerVersion} saveOutput=true
214+
make test dockerImage=${dockerRepository}:${dockerVersion} prevDockerImage=${dockerRepository}:${prevDockerVersion} saveOutput=true
209215
"""
210216
}
211217
}

README.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@
2929
- [Service](#service)
3030
- [Get the ClusterIP Service Name](#get-the-clusterip-service-name)
3131
- [Using the Service DNS Record to Access MarkLogic](#using-the-service-dns-record-to-access-marklogic)
32+
- [Additional Ports](#additional-ports)
3233
- [Port Forward](#port-forward)
3334
- [Forward to Pod](#forward-to-pod)
3435
- [Forward to Service](#forward-to-service)
36+
- [Security Context](#security-context)
37+
- [Network Policy](#network-policy)
38+
- [Pod Priorty](#pod-priorty)
3539
- [Notice](#notice)
3640
- [Uninstalling the Chart](#uninstalling-thechart)
3741
- [Parameters](#parameters)
38-
- [Known Issues and Limitations](#Known-Issues-and-Limitations)
42+
- [Known Issues and Limitations](#known-issues-and-limitations)
3943

4044

4145
# Introduction
@@ -355,6 +359,24 @@ For each Kubernetes service, a DNS with the following format is created:
355359

356360
For example, if the service-name is "marklogic" and namespace-name is "default", the DNS URL to access the MarkLogic cluster is "marklogic.default.svc.cluster.local".
357361

362+
### Additional Ports
363+
364+
When creating a new app server on Marklogic, the new app server port must also be added to the additionalPorts in the service configuration:
365+
366+
```yaml
367+
## @param service.additionalPorts. Additional ports exposed at the service level.
368+
## Example:
369+
## - name: app1
370+
## port: 8010
371+
## targetPort: 8010
372+
## protocol: TCP
373+
additionalPorts:
374+
- name: app-server1
375+
port: 8010
376+
targetPort: 8010
377+
protocol: TCP
378+
```
379+
358380
## Port Forward
359381
360382
The `kubectl port-forward` command can help you access MarkLogic outside of the Kubernetes cluster. Use the service to access a specific pod, or the whole cluster.
@@ -464,7 +486,8 @@ This table describes the list of available parameters for Helm Chart.
464486
| `nameOverride` | String to override the app name | `""` |
465487
| `fullnameOverride` | String to completely replace the generated name | `""` |
466488
| `auth.adminUsername` | Username for default MarkLogic Administrator | `admin` |
467-
| `auth.adminPassword` | Password for default MarkLogic Administrator | `admin`
489+
| `auth.adminPassword` | Password for default MarkLogic Administrator | ``
490+
| `auth.walletPassword` | Password for wallet | ``
468491
| `bootstrapHostName` | Host name of MarkLogic bootstrap host | `""`
469492
| `group.name` | group name for joining MarkLogic cluster | `Default` |
470493
| `group.enableXdqpSsl` | SSL encryption for XDQP | `true` |
@@ -475,12 +498,11 @@ This table describes the list of available parameters for Helm Chart.
475498
| `persistence.size` | Size of storage request for MarkLogic data volume | `10Gi` |
476499
| `persistence.annotations` | Annotations for Persistence Volume Claim (PVC) | `{}` |
477500
| `persistence.accessModes` | Access mode for persistence volume | `["ReadWriteOnce"]` |
478-
| `persistence.mountPath` | The path for the mounted persistence data volume | `/var/opt/MarkLogic` |
479-
| `extraVolumes` | Extra list of additional volumes for MarkLogic statefulset | `[]` |
480-
| `extraVolumeMounts` | Extra list of additional volumeMounts for MarkLogic container | `[]` |
481-
| `extraContainerPorts` | Extra list of additional containerPorts for MarkLogic container | `[]` |
501+
| `additionalContainerPorts` | List of ports in addition to the defaults exposed at the container level (Note: This does not typically need to be updated. Use `service.additionalPorts` to expose app server ports.) | `[]` |
502+
| `additionalVolumes` | List of additional volumes to add to the MarkLogic containers | `[]` |
503+
| `additionalVolumeMounts` | List of mount points for the additional volumes to add to the MarkLogic containers | `[]` |
482504
| `service.type` | type of the default service | `ClusterIP` |
483-
| `service.ports` | ports of the default service | `[8000, 8002]` |
505+
| `service.additionalPorts` | List of ports in addition to the defaults exposed at the service level. | `[]` |
484506
| `serviceAccount.create` | Enable this parameter to create a service account for a MarkLogic Pod | `true` |
485507
| `serviceAccount.annotations` | Annotations for MarkLogic service account | `{}` |
486508
| `serviceAccount.name` | Name of the serviceAccount | `""` |
@@ -516,6 +538,7 @@ This table describes the list of available parameters for Helm Chart.
516538
| `networkPolicy.customRules` | Placeholder to specify selectors | `{}` |
517539
| `networkPolicy.ports` | Ports to which traffic is allowed | `[8000, 8001, 8002]` |
518540
| `priorityClassName` | Name of a PriortyClass defined to set pod priority | `""` |
541+
| `updateStrategy` | Update strategy for helm chart and app version updates | `OnDelete` |
519542

520543
# Known Issues and Limitations
521544

charts/templates/configmap.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ data:
3939
{{- if .Values.logCollection.files.errorLogs }}
4040
[INPUT]
4141
Name tail
42-
Path {{ .Values.persistence.mountPath }}/Logs/*ErrorLog.txt
42+
Path /var/opt/MarkLogic/Logs/*ErrorLog.txt
4343
Read_from_head true
4444
Tag kube.marklogic.logs.error
4545
Path_Key path
@@ -50,7 +50,7 @@ data:
5050
{{- if .Values.logCollection.files.accessLogs }}
5151
[INPUT]
5252
Name tail
53-
Path {{ .Values.persistence.mountPath }}/Logs/*AccessLog.txt
53+
Path /var/opt/MarkLogic/Logs/*AccessLog.txt
5454
Read_from_head true
5555
tag kube.marklogic.logs.access
5656
Path_Key path
@@ -61,7 +61,7 @@ data:
6161
{{- if .Values.logCollection.files.requestLogs }}
6262
[INPUT]
6363
Name tail
64-
Path {{ .Values.persistence.mountPath }}/Logs/*RequestLog.txt
64+
Path /var/opt/MarkLogic/Logs/*RequestLog.txt
6565
Read_from_head true
6666
tag kube.marklogic.logs.request
6767
Path_Key path
@@ -72,7 +72,7 @@ data:
7272
{{- if .Values.logCollection.files.crashLogs }}
7373
[INPUT]
7474
Name tail
75-
Path {{ .Values.persistence.mountPath }}/Logs/CrashLog.txt
75+
Path /var/opt/MarkLogic/Logs/CrashLog.txt
7676
Read_from_head true
7777
tag kube.marklogic.logs.crash
7878
Path_Key path
@@ -82,7 +82,7 @@ data:
8282
{{- if .Values.logCollection.files.auditLogs }}
8383
[INPUT]
8484
Name tail
85-
Path {{ .Values.persistence.mountPath }}/Logs/AuditLog.txt
85+
Path /var/opt/MarkLogic/Logs/AuditLog.txt
8686
Read_from_head true
8787
tag kube.marklogic.logs.audit
8888
Path_Key path

charts/templates/secret.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ type: kubernetes.io/basic-auth
1515
data:
1616
password: {{ $adminPassword }}
1717
username: {{ .Values.auth.adminUsername | b64enc | quote }}
18+
wallet-password: {{ .Values.auth.walletPassword | b64enc | quote }}
1819

charts/templates/service-headless.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,30 @@ spec:
1111
selector:
1212
{{- include "marklogic.selectorLabels" . | nindent 4 }}
1313
ports:
14-
- protocol: TCP
15-
name: health-check
14+
- name: health-check
1615
port: 7997
17-
- protocol: TCP
18-
name: foreign-bind
16+
targetPort: 7997
17+
protocol: TCP
18+
- name: xdqp-port1
1919
port: 7998
20-
- protocol: TCP
21-
name: bind
20+
targetPort: 7998
21+
protocol: TCP
22+
- name: xdqp-port2
2223
port: 7999
23-
- protocol: TCP
24-
name: query-console
24+
targetPort: 7999
25+
protocol: TCP
26+
- name: app-services
2527
port: 8000
26-
- protocol: TCP
27-
name: admin
28+
targetPort: 8000
29+
protocol: TCP
30+
- name: admin
2831
port: 8001
29-
- protocol: TCP
30-
name: manage
32+
targetPort: 8001
33+
protocol: TCP
34+
- name: manage
3135
port: 8002
36+
targetPort: 8002
37+
protocol: TCP
38+
{{- if .Values.service.additionalPorts }}
39+
{{- toYaml .Values.service.additionalPorts | nindent 4 }}
40+
{{- end }}

charts/templates/service.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,36 @@ metadata:
55
namespace: {{ .Values.namespace}}
66
labels:
77
{{- include "marklogic.labels" . | nindent 4 }}
8+
annotations: {{- toYaml .Values.service.annotations | nindent 4 }}
89
spec:
910
selector:
1011
{{- include "marklogic.selectorLabels" . | nindent 4 }}
1112
type: {{ .Values.service.type }}
12-
ports: {{- toYaml .Values.service.ports | nindent 4 }}
13+
ports:
14+
- name: health-check
15+
port: 7997
16+
targetPort: 7997
17+
protocol: TCP
18+
- name: xdqp-port1
19+
port: 7998
20+
targetPort: 7998
21+
protocol: TCP
22+
- name: xdqp-port2
23+
port: 7999
24+
targetPort: 7999
25+
protocol: TCP
26+
- name: app-services
27+
port: 8000
28+
targetPort: 8000
29+
protocol: TCP
30+
- name: admin
31+
port: 8001
32+
targetPort: 8001
33+
protocol: TCP
34+
- name: manage
35+
port: 8002
36+
targetPort: 8002
37+
protocol: TCP
38+
{{- if .Values.service.additionalPorts }}
39+
{{- toYaml .Values.service.additionalPorts | nindent 4 }}
40+
{{- end }}

charts/templates/statefulset.yaml

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,22 @@ spec:
9696
mountPath: "/run/secrets/ml-secrets"
9797
readOnly: false
9898
- name: datadir
99-
mountPath: {{ .Values.persistence.mountPath }}
99+
mountPath: /var/opt/MarkLogic
100100
{{- if .Values.extraVolumeMounts }}
101101
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
102102
{{- end }}
103+
- name: mladmin-secrets
104+
mountPath: /run/secrets/ml-secrets
105+
readOnly: true
103106
env:
104107
- name: MARKLOGIC_ADMIN_USERNAME_FILE
105108
value: "ml-secrets/username"
106109
- name: MARKLOGIC_ADMIN_PASSWORD_FILE
107110
value: "ml-secrets/password"
111+
{{- if .Values.auth.walletPassword }}
112+
- name: MARKLOGIC_WALLET_PASSWORD_FILE
113+
value: ml-secrets/wallet-password
114+
{{- end }}
108115
- name: POD_NAME
109116
valueFrom:
110117
fieldRef:
@@ -113,20 +120,26 @@ spec:
113120
- configMapRef:
114121
name: {{ include "marklogic.fullname" . }}
115122
ports:
116-
- containerPort: 7997
117-
name: health-check
118-
- containerPort: 7998
119-
name: cluster-port
120-
- containerPort: 7999
121-
name: cluster-port2
122-
- containerPort: 8000
123-
name: app-services
124-
- containerPort: 8001
125-
name: admin
126-
- containerPort: 8002
127-
name: manage
128-
{{- if .Values.extraContainerPorts }}
129-
{{- toYaml .Values.extraContainerPorts | nindent 12 }}
123+
- name: health-check
124+
containerPort: 7997
125+
protocol: TCP
126+
- name: xdqp-port1
127+
containerPort: 7998
128+
protocol: TCP
129+
- name: xdqp-port2
130+
containerPort: 7999
131+
protocol: TCP
132+
- name: app-services
133+
containerPort: 8000
134+
protocol: TCP
135+
- name: admin
136+
containerPort: 8001
137+
protocol: TCP
138+
- name: manage
139+
containerPort: 8002
140+
protocol: TCP
141+
{{- if .Values.additionalContainerPorts }}
142+
{{- toYaml .Values.additionalContainerPorts | nindent 12 }}
130143
{{- end }}
131144
lifecycle:
132145
{{- if eq .Values.bootstrapHostName "" }}
@@ -138,7 +151,7 @@ spec:
138151
- |
139152
MARKLOGIC_ADMIN_USERNAME="$(< /run/secrets/ml-secrets/username)"
140153
MARKLOGIC_ADMIN_PASSWORD="$(< /run/secrets/ml-secrets/password)"
141-
154+
142155
pid=$(pgrep start.marklogic)
143156
144157
log () {
@@ -264,7 +277,7 @@ spec:
264277
imagePullPolicy: IfNotPresent
265278
volumeMounts:
266279
- name: datadir
267-
mountPath: {{ .Values.persistence.mountPath }}
280+
mountPath: /var/opt/MarkLogic
268281
{{- if .Values.extraVolumeMounts }}
269282
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
270283
{{- end }}
@@ -294,6 +307,11 @@ spec:
294307
- name: mladmin-secrets
295308
secret:
296309
secretName: {{ include "marklogic.fullname" . }}-admin
310+
items:
311+
{{- if .Values.auth.walletPassword }}
312+
- key: wallet-password
313+
path: wallet-password
314+
{{- end }}
297315
{{- if .Values.logCollection.enabled }}
298316
- name: {{ include "marklogic.fullname" . }}-fb-config-map
299317
configMap:
@@ -304,11 +322,11 @@ spec:
304322
- name: datadir
305323
emptyDir: {}
306324
{{- end }}
307-
{{- if .Values.extraVolumes }}
308-
{{- toYaml .Values.extraVolumes | nindent 8 }}
325+
{{- if .Values.additionalVolumes }}
326+
{{- toYaml .Values.additionalVolumes | nindent 8 }}
309327
{{- end }}
310328
{{- end }}
311-
{{- if .Values.persistence.enabled }}
329+
{{- if or .Values.persistence.enabled .Values.additionalVolumeClaimTemplates }}
312330
volumeClaimTemplates:
313331
- metadata:
314332
name: datadir
@@ -329,4 +347,8 @@ spec:
329347
resources:
330348
requests:
331349
storage: {{ .Values.persistence.size }}
332-
{{- end }}
350+
{{- end }}
351+
{{- if .Values.additionalVolumeClaimTemplates }}
352+
{{- toYaml .Values.additionalVolumeClaimTemplates | nindent 4 }}
353+
{{- end }}
354+
{{- end }}

0 commit comments

Comments
 (0)