[stable/hazelcast] Add option for configuring MC_CONTEXT_PATH (#20730)

Signed-off-by: Thomas Babtist <thomas.babtist@sinch.com>
This commit is contained in:
thomasbabtist
2020-02-14 02:42:16 -08:00
committed by GitHub
parent 0ac3e542be
commit 290f408f1d
6 changed files with 18 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: hazelcast
version: 3.0.0
version: 3.0.1
appVersion: "4.0"
tillerVersion: ">=2.7.2"
kubeVersion: ">=1.9.0-0"
+3
View File
@@ -228,6 +228,9 @@ the same or one minor release greater than Hazelcast image version)
|`+mancenter.image.pullSecrets+` |Specify docker-registry secret names as an
array |`+nil+`
|`+mancenter.contextPath+` |the value for the MC_CONTEXT_PATH environment variable,
thus overriding the default context path for Hazelcast Management Center |`+nil+`
|`+mancenter.javaOpts+` |Additional JAVA_OPTS properties for Hazelcast
Management Center |`+nil+`
+3 -3
View File
@@ -42,16 +42,16 @@ To access Hazelcast Management Center:
{{- if contains "LoadBalancer" .Values.mancenter.service.type }}
*) Check Management Center external IP:
$ export MANCENTER_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "mancenter.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
*) Open Browser at: http://$MANCENTER_IP:{{ .Values.mancenter.service.port }}/hazelcast-mancenter
*) Open Browser at: http://$MANCENTER_IP:{{ .Values.mancenter.service.port }}{{- if .Values.mancenter.contextPath }}{{ .Values.mancenter.contextPath }}{{- else }}/hazelcast-mancenter{{- end }}
{{- else if contains "ClusterIP" .Values.mancenter.service.type }}
*) Forward port from POD:
$ export POD=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "hazelcast.name" . }},role=mancenter" -o jsonpath="{.items[0].metadata.name}")
$ kubectl port-forward --namespace {{ .Release.Namespace }} $POD 8080:8080
*) Open Browser at: http://127.0.0.1:8080/hazelcast-mancenter
*) Open Browser at: http://127.0.0.1:8080{{- if .Values.mancenter.contextPath }}{{ .Values.mancenter.contextPath }}{{- else }}/hazelcast-mancenter{{- end }}
{{- else if contains "NodePort" .Values.mancenter.service.type }}
*) Check Node IP and Port:
$ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
$ export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "mancenter.fullname" . }})
*) Open Browser at: http://$NODE_IP:$NODE_PORT/hazelcast-mancenter
*) Open Browser at: http://$NODE_IP:$NODE_PORT{{- if .Values.mancenter.contextPath }}{{ .Values.mancenter.contextPath }}{{- else }}/hazelcast-mancenter{{- end }}
{{- end }}
{{- end }}
@@ -62,7 +62,7 @@ spec:
{{- if .Values.mancenter.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /health
path: {{ if .Values.mancenter.contextPath }}{{ .Values.mancenter.contextPath }}{{ end }}/health
port: 8081
initialDelaySeconds: {{ .Values.mancenter.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.mancenter.livenessProbe.periodSeconds }}
@@ -73,7 +73,7 @@ spec:
{{- if .Values.mancenter.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /health
path: {{ if .Values.mancenter.contextPath }}{{ .Values.mancenter.contextPath }}{{ end }}/health
port: 8081
initialDelaySeconds: {{ .Values.mancenter.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.mancenter.readinessProbe.periodSeconds }}
@@ -85,6 +85,10 @@ spec:
- name: mancenter-storage
mountPath: /data
env:
{{- if .Values.mancenter.contextPath }}
- name: MC_CONTEXT_PATH
value: {{ .Values.mancenter.contextPath }}
{{- end }}
- name: MC_LICENSE_KEY
{{- if .Values.mancenter.licenseKeySecretName }}
valueFrom:
@@ -32,7 +32,7 @@ spec:
- |
set -ex
# Get the HTTP Response Code of the Health Check
HEALTH_CHECK_HTTP_RESPONSE_CODE=$(curl --write-out %{http_code} --silent --output /dev/null {{ template "mancenter.fullname" . }}:{{ .Values.mancenter.service.port }}/hazelcast-mancenter/health)
HEALTH_CHECK_HTTP_RESPONSE_CODE=$(curl --write-out %{http_code} --silent --output /dev/null {{ template "mancenter.fullname" . }}:{{ .Values.mancenter.service.port }}{{- if .Values.mancenter.contextPath }}{{ .Values.mancenter.contextPath }}{{- else }}/hazelcast-mancenter{{- end }}/health)
# Test the currect number of Hazelcast members
test ${HEALTH_CHECK_HTTP_RESPONSE_CODE} -eq 200
securityContext:
+4
View File
@@ -223,6 +223,10 @@ mancenter:
# javaOpts are additional JAVA_OPTS properties for Hazelcast Management Center
javaOpts:
# contextPath is the value for the MC_CONTEXT_PATH environment variable, thus overriding the default context path for Hazelcast Management Center
# ref: https://hub.docker.com/r/hazelcast/management-center/
contextPath:
# licenseKey is the license key for Hazelcast Management Center
# if not provided, it can be filled in the Management Center web interface
licenseKey: