fix(meshcentral): fixup/port meshcentral (#8066)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  #8062

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [ ] ⚖️ My code follows the style guidelines of this project
- [ ] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Stavros Kois
2023-04-16 21:10:16 +02:00
committed by GitHub
parent f523c51647
commit b66f63028d
6 changed files with 66 additions and 79 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
name: meshcentral name: meshcentral
version: 9.0.33 version: 10.0.0
appVersion: "1.1.4" appVersion: "1.1.4"
description: MeshCentral is a full computer management web site description: MeshCentral is a full computer management web site
type: application type: application
@@ -18,11 +18,11 @@ sources:
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.truecharts.org repository: https://library-charts.truecharts.org
version: 11.1.2 version: 12.4.15
- condition: mongodb.enabled - condition: mongodb.enabled
name: mongodb name: mongodb
repository: https://deps.truecharts.org/ repository: https://deps.truecharts.org/
version: 6.0.3 version: 6.0.10
maintainers: maintainers:
- email: info@truecharts.org - email: info@truecharts.org
name: TrueCharts name: TrueCharts
+1 -1
View File
@@ -2,4 +2,4 @@ service:
main: main:
ports: ports:
main: main:
protocol: HTTPS protocol: https
+21 -26
View File
@@ -629,13 +629,7 @@ questions:
default: "" default: ""
# Include{containerConfig} # Include{containerConfig}
# Include{serviceRoot} # Include{serviceRoot}
- variable: main # Include{serviceMain}
label: Main Service
description: The Primary service on which the healthcheck runs, often the webUI
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceSelectorLoadBalancer} # Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras} # Include{serviceSelectorExtras}
- variable: main - variable: main
@@ -701,28 +695,29 @@ questions:
# Include{ingressTraefik} # Include{ingressTraefik}
# Include{ingressList} # Include{ingressList}
# Include{podSecurityContextRoot} # Include{securityContextRoot}
- variable: runAsUser
label: runAsUser - variable: runAsUser
description: The UserID of the user running the application label: "runAsUser"
schema: description: "The UserID of the user running the application"
type: int schema:
default: 0 type: int
- variable: runAsGroup default: 0
label: runAsGroup - variable: runAsGroup
description: The groupID this App of the user running the application label: "runAsGroup"
schema: description: "The groupID this App of the user running the application"
type: int schema:
default: 0 type: int
default: 0
# Include{securityContextContainer} # Include{securityContextContainer}
# Include{securityContextAdvanced} # Include{securityContextAdvanced}
# Include{securityContextPod} # Include{securityContextPod}
- variable: fsGroup - variable: fsGroup
label: fsGroup label: "fsGroup"
description: The group that should own ALL storage. description: "The group that should own ALL storage."
schema: schema:
type: int type: int
default: 568 default: 568
# Include{resources} # Include{resources}
# Include{advanced} # Include{advanced}
+19 -30
View File
@@ -1,15 +1,16 @@
{{/* Define the secret */}} {{/* Define the secret */}}
{{- define "meshcentral.secret" -}} {{- define "meshcentral.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) -}} {{- $fullname := include "tc.v1.common.lib.chart.names.fullname" $ -}}
{{- $secretStorageName := printf "%s-storage-secret" (include "tc.common.names.fullname" .) -}} {{- $secretName := printf "%s-mesh-secret" $fullname -}}
{{- $secretStoreName := printf "%s-sec-store" $fullname -}}
{{- $config := .Values.meshcentral -}} {{- $config := .Values.meshcentral -}}
{{- $mc_custom := .Values.additional_meshcentral -}} {{- $mc_custom := .Values.additional_meshcentral -}}
{{- $isScale := false -}} {{- $isScale := false -}}
{{- if hasKey .Values.global "isSCALE" -}} {{- if hasKey .Values.global "ixChartContext" -}}
{{- $isScale = .Values.global.isSCALE -}} {{- $isScale = true -}}
{{- else -}} {{- else -}}
{{- $isScale = false -}} {{- $isScale = false -}}
{{- end -}} {{- end -}}
@@ -29,7 +30,7 @@
{{- end -}} {{- end -}}
{{- $sessionKey := "" -}} {{- $sessionKey := "" -}}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretStorageName) -}} {{- with (lookup "v1" "Secret" .Release.Namespace $secretStoreName) -}}
{{- $sessionKey = (index .data "session_key") | b64dec -}} {{- $sessionKey = (index .data "session_key") | b64dec -}}
{{- else -}} {{- else -}}
{{- $sessionKey = randAlphaNum 32 -}} {{- $sessionKey = randAlphaNum 32 -}}
@@ -42,7 +43,7 @@
{{- $_ := set $config "settings" dict -}} {{- $_ := set $config "settings" dict -}}
{{- end -}} {{- end -}}
{{- $_ := set $config.settings "mongoDB" (.Values.mongodb.url.complete | trimAll "\"") -}} {{- $_ := set $config.settings "mongoDB" (.Values.mongodb.creds.complete | trimAll "\"") -}}
{{- $_ := set $config.settings "mongoDbName" .Values.mongodb.mongodbDatabase -}} {{- $_ := set $config.settings "mongoDbName" .Values.mongodb.mongodbDatabase -}}
{{- $_ := set $config.settings "sessionKey" $sessionKey -}} {{- $_ := set $config.settings "sessionKey" $sessionKey -}}
{{- $_ := set $config.settings "port" .Values.service.main.ports.main.port -}} {{- $_ := set $config.settings "port" .Values.service.main.ports.main.port -}}
@@ -66,30 +67,18 @@
{{- $config = (include "prune.keys" $config) -}} {{- $config = (include "prune.keys" $config) -}}
{{- end }} {{- end }}
--- secret:
apiVersion: v1 sec-store:
kind: Secret enabled: true
type: Opaque data:
metadata: {{/* Store session_key to reuse */}}
name: {{ $secretStorageName }} session_key: {{ $sessionKey }}
labels: mesh-secret:
{{- include "tc.common.labels" . | nindent 4 }} enabled: true
data: data:
{{/* Store session_key to reuse */}} {{/* The actual config */}}
session_key: {{ $sessionKey | b64enc }} config.json: |
{{- toPrettyJson (fromYaml $config) | nindent 8 }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
{{/* The actual config */}}
config.json: |
{{- toPrettyJson (fromYaml $config) | b64enc | nindent 4 }}
{{- end -}} {{- end -}}
{{/* Prunes keys that start with _ */}} {{/* Prunes keys that start with _ */}}
@@ -1,8 +1,7 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }} {{ include "tc.v1.common.loader.init" . }}
{{/* Render secret */}} {{- $_ := mustMergeOverwrite .Values (include "meshcentral.secret" $ | fromYaml) -}}
{{- include "meshcentral.secret" . }}
{{- define "meshcentral.probes" -}} {{- define "meshcentral.probes" -}}
probes: probes:
@@ -17,7 +16,7 @@ probes:
path: /health.ashx path: /health.ashx
{{- end -}} {{- end -}}
{{- $_ := mergeOverwrite .Values (include "meshcentral.probes" . | fromYaml) -}} {{- $_ := mergeOverwrite .Values.workload.main.podSpec.containers.main (include "meshcentral.probes" . | fromYaml) -}}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }} {{ include "tc.v1.common.loader.apply" . }}
+18 -14
View File
@@ -1,19 +1,23 @@
image: image:
repository: tccr.io/truecharts/meshcentral repository: tccr.io/truecharts/meshcentral
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: 1.1.4@sha256:897de1ed255c6f8587f1bc9af4b0e86bfd004c4659eedc2e5cd73de3f40deb0b tag: 1.1.5@sha256:91564f7e1d65c007e732bb3e468bafb381ffd257fa85b6e5ef6691c89de0b3d0
command: workload:
- node main:
- meshcentral/meshcentral podSpec:
containers:
main:
command:
- node
- meshcentral/meshcentral
securityContext: securityContext:
readOnlyRootFilesystem: false container:
runAsNonRoot: false readOnlyRootFilesystem: false
runAsNonRoot: false
podSecurityContext: runAsUser: 0
runAsUser: 0 runAsGroup: 0
runAsGroup: 0
# - Values with the character _ in-front of them are pruned. Add or remove _ to disable or enable options # - Values with the character _ in-front of them are pruned. Add or remove _ to disable or enable options
# - More in-depth info for each options can be found here: https://github.com/Ylianst/MeshCentral/blob/master/meshcentral-config-schema.json # - More in-depth info for each options can be found here: https://github.com/Ylianst/MeshCentral/blob/master/meshcentral-config-schema.json
@@ -952,7 +956,7 @@ service:
ports: ports:
main: main:
# Only use HTTPS if meshcental handles the certs # Only use HTTPS if meshcental handles the certs
protocol: HTTP protocol: http
port: 10205 port: 10205
# mps: # mps:
# enabled: true # enabled: true
@@ -973,7 +977,6 @@ mongodb:
enabled: true enabled: true
mongodbUsername: meshcentral mongodbUsername: meshcentral
mongodbDatabase: meshcentral mongodbDatabase: meshcentral
existingSecret: mongodbcreds
persistence: persistence:
data: data:
@@ -997,9 +1000,10 @@ persistence:
type: secret type: secret
readOnly: true readOnly: true
defaultMode: "0600" defaultMode: "0600"
objectName: '{{ include "tc.common.names.fullname" . }}-secret' objectName: mesh-secret
mountPath: /opt/meshcentral/meshcentral-data/config.json mountPath: /opt/meshcentral/meshcentral-data/config.json
subPath: config.json subPath: config.json
portal: portal:
enabled: true open:
enabled: true