diff --git a/wproofreader/templates/NOTES.txt b/wproofreader/templates/NOTES.txt index 01cf799..d7bf662 100644 --- a/wproofreader/templates/NOTES.txt +++ b/wproofreader/templates/NOTES.txt @@ -1,6 +1,6 @@ WProofreader Server has been deployed successfully! -{{- $baseUrl := printf "http%s://%s.%s.svc:%s/%s/" (.Values.useHTTPS | ternary "s" "") (include "wproofreader.fullname" .) - .Release.Namespace (include "wproofreader.servicePort" . | toString) .Values.virtualDir +{{- $baseUrl := printf "http%s://%s.%s.svc:%s%s/" (.Values.useHTTPS | ternary "s" "") (include "wproofreader.fullname" .) + .Release.Namespace (include "wproofreader.servicePort" . | toString) (include "wproofreader.virtualDirBasePath" .) }} Quick start: {{ print $baseUrl }} diff --git a/wproofreader/templates/_helpers.tpl b/wproofreader/templates/_helpers.tpl index e68af12..8551493 100644 --- a/wproofreader/templates/_helpers.tpl +++ b/wproofreader/templates/_helpers.tpl @@ -90,6 +90,15 @@ Insert key/cert pair from file. {{- template "wproofreader.printKeyValue" (dict (last $cert_path) $cert (last $key_path) $key) }} {{- end }} +{{/* +Returns virtualDir as a path prefix: "/wscservice" for "wscservice", or "" for "/" or "". +Append your path directly: {{ include "wproofreader.virtualDirBasePath" . }}/api?cmd=status +*/}} +{{- define "wproofreader.virtualDirBasePath" -}} +{{- $vd := .Values.virtualDir | trimAll "/" -}} +{{- if $vd -}}{{- printf "/%s" $vd -}}{{- end -}} +{{- end }} + {{/* Returns default web port as an integer. */}} diff --git a/wproofreader/templates/deployment.yaml b/wproofreader/templates/deployment.yaml index 75e0dd0..57106d1 100644 --- a/wproofreader/templates/deployment.yaml +++ b/wproofreader/templates/deployment.yaml @@ -44,7 +44,7 @@ spec: protocol: TCP livenessProbe: httpGet: - path: /{{ .Values.virtualDir }} + path: {{ include "wproofreader.virtualDirBasePath" . }}/ port: container-port scheme: {{ if .Values.useHTTPS }}HTTPS{{ else }}HTTP{{ end }} {{- with .Values.livenessProbeOptions }} @@ -52,7 +52,7 @@ spec: {{- end }} readinessProbe: httpGet: - path: "/{{ .Values.virtualDir }}/api?cmd=status" + path: "{{ include "wproofreader.virtualDirBasePath" . }}/api?cmd=status" port: container-port scheme: {{ if .Values.useHTTPS }}HTTPS{{ else }}HTTP{{ end }} {{- with .Values.readinessProbeOptions }} diff --git a/wproofreader/values.yaml b/wproofreader/values.yaml index 1b56d36..3030290 100644 --- a/wproofreader/values.yaml +++ b/wproofreader/values.yaml @@ -15,8 +15,8 @@ licenseTicketID: "" # extra environment variables to pass to the container extraEnv: [] # extraEnv: -# - name: WPR_DOMAIN_NAME -# value: "wproofreader.domain-name.com" +# - name: WPR_JVM_MAX_MEMORY_SIZE_MB +# value: "2048" # directory of the service for web and API requests, e.g. http://localhost/wscservice/api?cmd=ver virtualDir: wscservice