From f9a02815b7cae7645d79776488b36c6526685b06 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Mon, 11 Dec 2023 02:00:45 -0500 Subject: [PATCH] feat(MeshCentral): Move to postgres **Breaking** (#15954) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ 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?** **📃 Notes:** **✔️ 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._ --------- Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/stable/meshcentral/Chart.yaml | 9 +-------- charts/stable/meshcentral/templates/_secret.tpl | 8 ++++++-- charts/stable/meshcentral/values.yaml | 10 +++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/charts/stable/meshcentral/Chart.yaml b/charts/stable/meshcentral/Chart.yaml index 2dee80cb105..40dec0a0f88 100644 --- a/charts/stable/meshcentral/Chart.yaml +++ b/charts/stable/meshcentral/Chart.yaml @@ -1,7 +1,7 @@ kubeVersion: ">=1.24.0" apiVersion: v2 name: meshcentral -version: 11.0.15 +version: 12.0.0 appVersion: 1.1.16 description: MeshCentral is a full computer management web site home: https://truecharts.org/charts/stable/meshcentral @@ -27,13 +27,6 @@ dependencies: alias: "" tags: [] import-values: [] - - name: mongodb - version: 6.0.67 - repository: https://deps.truecharts.org/ - condition: mongodb.enabled - alias: "" - tags: [] - import-values: [] annotations: max_scale_version: 23.10.1 min_scale_version: 22.12.4 diff --git a/charts/stable/meshcentral/templates/_secret.tpl b/charts/stable/meshcentral/templates/_secret.tpl index 4709820c8a5..dd6451341b1 100644 --- a/charts/stable/meshcentral/templates/_secret.tpl +++ b/charts/stable/meshcentral/templates/_secret.tpl @@ -43,8 +43,12 @@ {{- $_ := set $config "settings" dict -}} {{- end -}} -{{- $_ := set $config.settings "mongoDB" (.Values.mongodb.creds.complete | trimAll "\"") -}} -{{- $_ := set $config.settings "mongoDbName" .Values.mongodb.mongodbDatabase -}} +{{- $_ := set $config.settings "postgres" dict -}} +{{- $_ := set $config.settings.postgres "database" .Values.cnpg.main.database -}} +{{- $_ := set $config.settings.postgres "user" .Values.cnpg.main.user -}} +{{- $_ := set $config.settings.postgres "host" (.Values.cnpg.main.creds.host | trimAll "\"") -}} +{{- $_ := set $config.settings.postgres "port" 5432 -}} +{{- $_ := set $config.settings.postgres "password" (.Values.cnpg.main.creds.password | trimAll "\"") -}} {{- $_ := set $config.settings "sessionKey" $sessionKey -}} {{- $_ := set $config.settings "port" .Values.service.main.ports.main.port -}} diff --git a/charts/stable/meshcentral/values.yaml b/charts/stable/meshcentral/values.yaml index 11ad1ad8b9a..067343b5c73 100644 --- a/charts/stable/meshcentral/values.yaml +++ b/charts/stable/meshcentral/values.yaml @@ -23,7 +23,6 @@ securityContext: # - Any service that uses port other than 443, need to be manually configured. meshcentral: settings: - mongoDbBulkOperations: true # - The actual main port as seen externally on the Internet, this setting is often used when a reverse-proxy is used. aliasPort: 443 # - When set, relayPort value is ignored. Set this to a DNS name the points to this server. When the server is accessed using the DNS name, the main web server port is used as a web relay port. @@ -967,10 +966,11 @@ service: # enabled: true # port: 9971 # targetPort: 9971 -mongodb: - enabled: true - mongodbUsername: meshcentral - mongodbDatabase: meshcentral +cnpg: + main: + enabled: true + username: meshcentral + database: meshcentral persistence: data: enabled: true