Skip to content

Commit 9208b2e

Browse files
sumanthravipatisumanthravipati
andauthored
MLE-12272: Rootless Image Changes to Helm Charts
Co-authored-by: sumanthravipati <[email protected]>
1 parent 1cbdfae commit 9208b2e

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

charts/templates/NOTES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ Thank you for installing {{ .Chart.Name }}.
22

33
Your release is named {{ .Release.Name }}.
44

5+
{{- if eq (include "marklogic.imageType" .) "rootless" }}
6+
{{- if .Values.containerSecurityContext.allowPrivilegeEscalation }}
7+
WARNING
8+
***********************************************************************************************************
9+
Setting "containerSecurityContext.allowPrivilegeEscalation" is set to true.
10+
This is not recommended and is not a secure configuration while using rootless MarkLogic images.
11+
***********************************************************************************************************
12+
{{- end }}
13+
{{- end }}
14+
515
FQDN is {{ include "marklogic.fqdn" . }}
616
{{- if gt (len (include "marklogic.fqdn" .)) 64 }}
717
WARNING: The hostname is greater than 64 characters

charts/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,14 @@ Validate values file
108108
{{- end }}
109109
{{- end }}
110110

111+
{{/*
112+
Name to distinguish marklogic image whether root or rootless
113+
*/}}
114+
{{- define "marklogic.imageType" -}}
115+
{{- if .Values.image.tag | contains "rootless" }}
116+
{{- printf "rootless" }}
117+
{{- else }}
118+
{{- printf "root" }}
119+
{{- end }}
120+
{{- end }}
121+

charts/templates/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ data:
2424
MARKLOGIC_JOIN_CLUSTER: "true"
2525
MARKLOGIC_GROUP: {{ .Values.group.name }}
2626
XDQP_SSL_ENABLED: {{ quote .Values.group.enableXdqpSsl }}
27+
MARKLOGIC_IMAGE_TYPE: {{ include "marklogic.imageType" . }}
2728
---
2829
{{- if .Values.logCollection.enabled }}
2930
apiVersion: v1

charts/templates/statefulset.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ spec:
338338
if [[ -n ${TIMESTAMP} ]]; then
339339
restart_check ${TIMESTAMP}
340340
fi
341-
sudo sh -c 'echo -n '"${MARKLOGIC_GROUP}:${XDQP_SSL_ENABLED}"' > /var/opt/MarkLogic/group_cfg'
341+
if [[ $MARKLOGIC_IMAGE_TYPE == "rootless" ]]; then
342+
sh -c 'echo -n '"${MARKLOGIC_GROUP}:${XDQP_SSL_ENABLED}"' > /var/opt/MarkLogic/group_cfg'
343+
else
344+
sudo sh -c 'echo -n '"${MARKLOGIC_GROUP}:${XDQP_SSL_ENABLED}"' > /var/opt/MarkLogic/group_cfg'
345+
fi
342346
log "Info: [poststart] ${GROUP_CFG} saved"
343347
else
344348
log "Error: [poststart] Failed to configure properties for $MARKLOGIC_GROUP group.

0 commit comments

Comments
 (0)