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 22:10:16 +03: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
kubeVersion: ">=1.16.0-0"
name: meshcentral
version: 9.0.33
version: 10.0.0
appVersion: "1.1.4"
description: MeshCentral is a full computer management web site
type: application
@@ -18,11 +18,11 @@ sources:
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 11.1.2
version: 12.4.15
- condition: mongodb.enabled
name: mongodb
repository: https://deps.truecharts.org/
version: 6.0.3
version: 6.0.10
maintainers:
- email: info@truecharts.org
name: TrueCharts
+1 -1
View File
@@ -2,4 +2,4 @@ service:
main:
ports:
main:
protocol: HTTPS
protocol: https
+21 -26
View File
@@ -629,13 +629,7 @@ questions:
default: ""
# Include{containerConfig}
# Include{serviceRoot}
- variable: main
label: Main Service
description: The Primary service on which the healthcheck runs, often the webUI
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceMain}
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
@@ -701,28 +695,29 @@ questions:
# Include{ingressTraefik}
# Include{ingressList}
# Include{podSecurityContextRoot}
- variable: runAsUser
label: runAsUser
description: The UserID of the user running the application
schema:
type: int
default: 0
- variable: runAsGroup
label: runAsGroup
description: The groupID this App of the user running the application
schema:
type: int
default: 0
# Include{securityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 0
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID this App of the user running the application"
schema:
type: int
default: 0
# Include{securityContextContainer}
# Include{securityContextAdvanced}
# Include{securityContextPod}
- variable: fsGroup
label: fsGroup
description: The group that should own ALL storage.
schema:
type: int
default: 568
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
schema:
type: int
default: 568
# Include{resources}
# Include{advanced}
+19 -30
View File
@@ -1,15 +1,16 @@
{{/* Define the secret */}}
{{- define "meshcentral.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) -}}
{{- $secretStorageName := printf "%s-storage-secret" (include "tc.common.names.fullname" .) -}}
{{- $fullname := include "tc.v1.common.lib.chart.names.fullname" $ -}}
{{- $secretName := printf "%s-mesh-secret" $fullname -}}
{{- $secretStoreName := printf "%s-sec-store" $fullname -}}
{{- $config := .Values.meshcentral -}}
{{- $mc_custom := .Values.additional_meshcentral -}}
{{- $isScale := false -}}
{{- if hasKey .Values.global "isSCALE" -}}
{{- $isScale = .Values.global.isSCALE -}}
{{- if hasKey .Values.global "ixChartContext" -}}
{{- $isScale = true -}}
{{- else -}}
{{- $isScale = false -}}
{{- end -}}
@@ -29,7 +30,7 @@
{{- end -}}
{{- $sessionKey := "" -}}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretStorageName) -}}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretStoreName) -}}
{{- $sessionKey = (index .data "session_key") | b64dec -}}
{{- else -}}
{{- $sessionKey = randAlphaNum 32 -}}
@@ -42,7 +43,7 @@
{{- $_ := set $config "settings" dict -}}
{{- 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 "sessionKey" $sessionKey -}}
{{- $_ := set $config.settings "port" .Values.service.main.ports.main.port -}}
@@ -66,30 +67,18 @@
{{- $config = (include "prune.keys" $config) -}}
{{- end }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ $secretStorageName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
data:
{{/* Store session_key to reuse */}}
session_key: {{ $sessionKey | b64enc }}
---
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 }}
secret:
sec-store:
enabled: true
data:
{{/* Store session_key to reuse */}}
session_key: {{ $sessionKey }}
mesh-secret:
enabled: true
data:
{{/* The actual config */}}
config.json: |
{{- toPrettyJson (fromYaml $config) | nindent 8 }}
{{- end -}}
{{/* Prunes keys that start with _ */}}
@@ -1,8 +1,7 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{ include "tc.v1.common.loader.init" . }}
{{/* Render secret */}}
{{- include "meshcentral.secret" . }}
{{- $_ := mustMergeOverwrite .Values (include "meshcentral.secret" $ | fromYaml) -}}
{{- define "meshcentral.probes" -}}
probes:
@@ -17,7 +16,7 @@ probes:
path: /health.ashx
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "meshcentral.probes" . | fromYaml) -}}
{{- $_ := mergeOverwrite .Values.workload.main.podSpec.containers.main (include "meshcentral.probes" . | fromYaml) -}}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}
{{ include "tc.v1.common.loader.apply" . }}
+18 -14
View File
@@ -1,19 +1,23 @@
image:
repository: tccr.io/truecharts/meshcentral
pullPolicy: IfNotPresent
tag: 1.1.4@sha256:897de1ed255c6f8587f1bc9af4b0e86bfd004c4659eedc2e5cd73de3f40deb0b
tag: 1.1.5@sha256:91564f7e1d65c007e732bb3e468bafb381ffd257fa85b6e5ef6691c89de0b3d0
command:
- node
- meshcentral/meshcentral
workload:
main:
podSpec:
containers:
main:
command:
- node
- meshcentral/meshcentral
securityContext:
readOnlyRootFilesystem: false
runAsNonRoot: false
podSecurityContext:
runAsUser: 0
runAsGroup: 0
container:
readOnlyRootFilesystem: false
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0
# - 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
@@ -952,7 +956,7 @@ service:
ports:
main:
# Only use HTTPS if meshcental handles the certs
protocol: HTTP
protocol: http
port: 10205
# mps:
# enabled: true
@@ -973,7 +977,6 @@ mongodb:
enabled: true
mongodbUsername: meshcentral
mongodbDatabase: meshcentral
existingSecret: mongodbcreds
persistence:
data:
@@ -997,9 +1000,10 @@ persistence:
type: secret
readOnly: true
defaultMode: "0600"
objectName: '{{ include "tc.common.names.fullname" . }}-secret'
objectName: mesh-secret
mountPath: /opt/meshcentral/meshcentral-data/config.json
subPath: config.json
portal:
enabled: true
open:
enabled: true