From 1e16b682235514a0716af18a7b2841af4ed7c697 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 26 Oct 2022 11:39:46 +0300 Subject: [PATCH] fix(meshcentral): http port and probe (#4196) * remove debug * fix(meshcentral): http port and probe * auto configure probe protocol * add note --- .../meshcentral/docs/installation-instructions.md | 6 ++++++ charts/incubator/meshcentral/questions.yaml | 2 +- .../incubator/meshcentral/templates/_secret.tpl | 6 ------ .../incubator/meshcentral/templates/common.yaml | 15 +++++++++++++++ charts/incubator/meshcentral/values.yaml | 14 ++------------ 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/charts/incubator/meshcentral/docs/installation-instructions.md b/charts/incubator/meshcentral/docs/installation-instructions.md index 25e421b5d6a..44f5a993d3a 100644 --- a/charts/incubator/meshcentral/docs/installation-instructions.md +++ b/charts/incubator/meshcentral/docs/installation-instructions.md @@ -1,5 +1,11 @@ # Installation instructions +:::warn + +Ingress for this chart is **required** + +::: + In order to be able to expose some options in the GUI, but also give users the option to users to **unset** those values, instead of using our defaults. We decided to do the following. diff --git a/charts/incubator/meshcentral/questions.yaml b/charts/incubator/meshcentral/questions.yaml index 27b5534f1e5..d63f55cb327 100644 --- a/charts/incubator/meshcentral/questions.yaml +++ b/charts/incubator/meshcentral/questions.yaml @@ -372,7 +372,7 @@ questions: type: int default: 10205 required: true -# Include{advancedPortHTTPS} +# Include{advancedPortHTTP} - variable: targetPort label: Target Port description: The internal(!) port on the container the Application runs on diff --git a/charts/incubator/meshcentral/templates/_secret.tpl b/charts/incubator/meshcentral/templates/_secret.tpl index 80cb358a483..3b52477ef5d 100644 --- a/charts/incubator/meshcentral/templates/_secret.tpl +++ b/charts/incubator/meshcentral/templates/_secret.tpl @@ -20,7 +20,6 @@ {{/* Inject some values */}} {{- $_ := set $config "$schema" "http://info.meshcentral.com/downloads/meshcentral-config-schema.json" }} -{{- $_ := set $config "__comment__" "This file is generated dynamically at install time, do not attempt to modify it. On next start it will be re-generated" }} {{- if not (hasKey $config "settings") }} {{- $_ := set $config "settings" dict }} @@ -66,7 +65,6 @@ data: {{- end }} {{/* Prunes keys that start with _ */}} - {{- define "prune.keys" }} {{- $values := . }} {{- range $k, $v := $values }} @@ -88,7 +86,6 @@ data: {{/* Prunes keys that start with _ */}} {{/* Renames tcdefaultdomain variable to "" as this is the key used by MeshCentral */}} {{/* but SCALE GUI does not handle it well */}} - {{- define "prune.keys.scale" }} {{- $values := . }} {{- if (hasKey $values "domains") }} @@ -104,9 +101,6 @@ data: {{- $_ := unset $values $k }} {{- end }} {{- end }} - {{- if eq $k "browserPing" }} - {{- $_ := set $values "__browserPing" (printf "%v-%v" (kindOf $v) (typeOf $v)) }} - {{- end }} {{- if or (eq (kindOf $v) "float64") (eq (kindOf $v) "int64") }} {{- if eq (int $v) -99 }} {{- $_ := unset $values $k }} diff --git a/charts/incubator/meshcentral/templates/common.yaml b/charts/incubator/meshcentral/templates/common.yaml index 70e8b2dd97d..5d43352c10f 100644 --- a/charts/incubator/meshcentral/templates/common.yaml +++ b/charts/incubator/meshcentral/templates/common.yaml @@ -4,5 +4,20 @@ {{/* Render secret */}} {{- include "meshcentral.secret" . }} +{{- define "meshcentral.probes" -}} +probes: + liveness: + type: {{ .Values.service.main.ports.main.protocol }} + path: /health.ashx + readiness: + type: {{ .Values.service.main.ports.main.protocol }} + path: /health.ashx + startup: + type: {{ .Values.service.main.ports.main.protocol }} + path: /health.ashx +{{- end -}} + +{{- $_ := mergeOverwrite .Values (include "meshcentral.probes" . | fromYaml) -}} + {{/* Render the templates */}} {{ include "tc.common.loader.apply" . }} diff --git a/charts/incubator/meshcentral/values.yaml b/charts/incubator/meshcentral/values.yaml index 7f606386eba..b6a2f5a104a 100644 --- a/charts/incubator/meshcentral/values.yaml +++ b/charts/incubator/meshcentral/values.yaml @@ -938,21 +938,11 @@ meshcentral: # - When set, limits what OIDC groups are mirrored into MeshCentral user groups. filter: [] -probes: - liveness: - type: HTTPS - path: /health.ashx - readiness: - type: HTTPS - path: /health.ashx - startup: - type: HTTPS - path: /health.ashx - service: main: ports: main: + # - Set this to HTTP if certs are served by a proxy protocol: HTTPS port: 10205 # mps: @@ -997,7 +987,7 @@ persistence: enabled: true type: secret readOnly: true - # defaultMode: "0600" + defaultMode: "0600" objectName: '{{ include "tc.common.names.fullname" . }}-secret' mountPath: /opt/meshcentral/meshcentral-config items: