mirror of
https://gitlab.opencode.de/bmi/opendesk/deployment/opendesk.git
synced 2025-12-06 23:41:43 +01:00
Compare commits
2 Commits
renovate/o
...
sell/pytho
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d7d538626 | ||
|
|
1b9843d579 |
@@ -1,6 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-FileCopyrightText: 2024 Zentrum für Digitale Souveränität der Öffentlichen Verwaltung (ZenDiS) GmbH
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# /// script
|
||||
# requires-python = ">=3.12"
|
||||
# dependencies = [
|
||||
# "configargparse",
|
||||
# "gitpython",
|
||||
# "pyyaml",
|
||||
# ]
|
||||
# ///
|
||||
|
||||
import os.path
|
||||
import logging
|
||||
@@ -13,40 +21,6 @@ import configargparse
|
||||
from pathlib import Path
|
||||
from git import Repo
|
||||
|
||||
p = configargparse.ArgParser()
|
||||
p.add('--branch', env_var='CHART_DEV_BRANCH', help='The branch you want to work with. Will be created by the script if it does not exist yet.')
|
||||
p.add('--git_hostname', env_var='GIT_HOSTNAME', default='git@gitlab.opencode.de', help='Set the hostname for the chart git checkouts.')
|
||||
p.add('--revert', default=False, action='store_true', help='Set this parameter if you want to revert the referencing of the local helm chart checkout paths in the helmfiles.')
|
||||
p.add('--match', default='', help="Clone/pull only charts that contain the given string in their name.")
|
||||
p.add('--loglevel', env_var='LOGLEVEL', default='DEBUG', help='Set the loglevel: DEBUG, INFO, WARNING, ERROR, CRITICAL-')
|
||||
options = p.parse_args()
|
||||
|
||||
script_path = os.path.dirname(os.path.realpath(__file__))
|
||||
# some static definitions
|
||||
log_path = script_path+'/../logs'
|
||||
charts_yaml = script_path+'/../helmfile/environments/default/charts.yaml.gotmpl'
|
||||
base_repo_path = script_path+'/..'
|
||||
base_helmfile = base_repo_path+'/helmfile_generic.yaml.gotmpl'
|
||||
helmfile_backup_extension = '.bak'
|
||||
|
||||
Path(log_path).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
logFormatter = logging.Formatter("%(asctime)s %(levelname)-5.5s %(message)s")
|
||||
rootLogger = logging.getLogger()
|
||||
rootLogger.setLevel(options.loglevel)
|
||||
|
||||
fileHandler = logging.FileHandler("{0}/{1}.log".format(log_path, os.path.basename(__file__)))
|
||||
fileHandler.setFormatter(logFormatter)
|
||||
rootLogger.addHandler(fileHandler)
|
||||
|
||||
consoleHandler = logging.StreamHandler()
|
||||
consoleHandler.setFormatter(logFormatter)
|
||||
rootLogger.addHandler(consoleHandler)
|
||||
|
||||
logging.debug(f"Working with relative paths from script location: {script_path}")
|
||||
logging.debug(f"Log directory: {log_path}")
|
||||
logging.debug(f"charts.yaml.gotmpl: {charts_yaml}")
|
||||
|
||||
|
||||
def create_or_switch_branch_base_repo():
|
||||
base_repo = Repo(path=base_repo_path)
|
||||
@@ -188,11 +162,50 @@ def revert_the_helmfiles():
|
||||
##
|
||||
## Main program
|
||||
##
|
||||
if options.revert:
|
||||
revert_the_helmfiles()
|
||||
else:
|
||||
branch = create_or_switch_branch_base_repo()
|
||||
with open(charts_yaml, 'r') as file:
|
||||
charts = yaml.safe_load(file)
|
||||
charts_dict = clone_charts_locally(branch, charts)
|
||||
process_the_helmfiles(charts_dict, charts)
|
||||
if __name__ == "__main__":
|
||||
p = configargparse.ArgParser()
|
||||
p.add('--branch', env_var='CHART_DEV_BRANCH',
|
||||
help='The branch you want to work with. Will be created by the script if it does not exist yet.')
|
||||
p.add('--git_hostname', env_var='GIT_HOSTNAME', default='git@gitlab.opencode.de',
|
||||
help='Set the hostname for the chart git checkouts.')
|
||||
p.add('--revert', default=False, action='store_true',
|
||||
help='Set this parameter if you want to revert the referencing of the local helm chart checkout paths in the helmfiles.')
|
||||
p.add('--match', default='', help="Clone/pull only charts that contain the given string in their name.")
|
||||
p.add('--loglevel', env_var='LOGLEVEL', default='DEBUG',
|
||||
help='Set the loglevel: DEBUG, INFO, WARNING, ERROR, CRITICAL-')
|
||||
options = p.parse_args()
|
||||
|
||||
script_path = os.path.dirname(os.path.realpath(__file__))
|
||||
# some static definitions
|
||||
log_path = script_path + '/../logs'
|
||||
charts_yaml = script_path + '/../helmfile/environments/default/charts.yaml.gotmpl'
|
||||
base_repo_path = script_path + '/..'
|
||||
base_helmfile = base_repo_path + '/helmfile_generic.yaml.gotmpl'
|
||||
helmfile_backup_extension = '.bak'
|
||||
|
||||
Path(log_path).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
logFormatter = logging.Formatter("%(asctime)s %(levelname)-5.5s %(message)s")
|
||||
rootLogger = logging.getLogger()
|
||||
rootLogger.setLevel(options.loglevel)
|
||||
|
||||
fileHandler = logging.FileHandler("{0}/{1}.log".format(log_path, os.path.basename(__file__)))
|
||||
fileHandler.setFormatter(logFormatter)
|
||||
rootLogger.addHandler(fileHandler)
|
||||
|
||||
consoleHandler = logging.StreamHandler()
|
||||
consoleHandler.setFormatter(logFormatter)
|
||||
rootLogger.addHandler(consoleHandler)
|
||||
|
||||
logging.debug(f"Working with relative paths from script location: {script_path}")
|
||||
logging.debug(f"Log directory: {log_path}")
|
||||
logging.debug(f"charts.yaml.gotmpl: {charts_yaml}")
|
||||
|
||||
if options.revert:
|
||||
revert_the_helmfiles()
|
||||
else:
|
||||
branch = create_or_switch_branch_base_repo()
|
||||
with open(charts_yaml, 'r') as file:
|
||||
charts = yaml.safe_load(file)
|
||||
charts_dict = clone_charts_locally(branch, charts)
|
||||
process_the_helmfiles(charts_dict, charts)
|
||||
|
||||
@@ -65,7 +65,7 @@ For your convenience, we recommend creating a `*.domain.tld` A-Record for your c
|
||||
| Record name | Type | Value | Additional information |
|
||||
|-------------------------------|------|----------------------------------------------------|-------------------------------------------------------------------|
|
||||
| *.domain.tld | A | IPv4 address of your Ingress Controller | |
|
||||
| *.domain.tld | AAAA | IPv6 address of your Ingress Controller | Optional |
|
||||
| *.domain.tld | AAAA | IPv6 address of your Ingress Controller | |
|
||||
| mail.domain.tld | A | IPv4 address of your postfix NodePort/LoadBalancer | Optional, mail should directly be delivered to openDesk's Postfix |
|
||||
| mail.domain.tld | AAAA | IPv6 address of your postfix NodePort/LoadBalancer | Optional, mail should directly be delivered to openDesk's Postfix |
|
||||
| domain.tld | MX | `10 mail.domain.tld` | |
|
||||
|
||||
@@ -23,7 +23,8 @@ openDesk includes integration with Prometheus-based monitoring.
|
||||
|
||||
Together with [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack), you can easily leverage the full potential of the open-source cloud-native observability stack.
|
||||
|
||||
Before enabling the following options, you need to install the respective custom resource definitions (CRDs) from the kube-prometheus-stack repository which should at least include the Prometheus Operator.
|
||||
Before enabling the following options, you need to install the respective custom resource definitions (CRDs) from the kube-prometheus-stack
|
||||
repository or Prometheus operator.
|
||||
|
||||
# Defaults
|
||||
|
||||
@@ -32,16 +33,14 @@ All configurable options and their defaults can be found in
|
||||
|
||||
# Metrics
|
||||
|
||||
To deploy `podMonitor` and `serviceMonitor` custom resources, enable them by:
|
||||
To deploy `podMonitor` and `serviceMonitor` custom resources, enable it by:
|
||||
|
||||
```yaml
|
||||
monitoring:
|
||||
prometheus:
|
||||
serviceMonitors:
|
||||
enabled: true
|
||||
podMonitors:
|
||||
enabled: true
|
||||
```
|
||||
prometheus:
|
||||
serviceMonitors:
|
||||
enabled: true
|
||||
podMonitors:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
# Alerts
|
||||
@@ -52,23 +51,19 @@ Some of these are created by our partners while others are defined in [opendesk-
|
||||
All alert rules are deployed as [PrometheusRule](https://prometheus-operator.dev/docs/api-reference/api/#monitoring.coreos.com/v1.PrometheusRule) and can be enabled like this:
|
||||
|
||||
```yaml
|
||||
monitoring:
|
||||
prometheus:
|
||||
prometheusRules:
|
||||
enabled: true
|
||||
prometheus:
|
||||
prometheusRules:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
# Dashboards for Grafana
|
||||
|
||||
If your Grafana instance is deployed via kube-prometheus-stack, or you have deployed the [Sidecar for datasources](https://github.com/grafana/helm-charts/blob/main/charts/grafana/README.md#sidecar-for-datasources), openDesk can make dashboards available via ConfigMap resources.
|
||||
|
||||
Enable the functionality with the following snippet:
|
||||
To deploy optional Grafana dashboards with ConfigMaps, enable the functionality with:
|
||||
|
||||
```yaml
|
||||
monitoring:
|
||||
grafana:
|
||||
dashboards:
|
||||
enabled: true
|
||||
grafana:
|
||||
dashboards:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
Please find further details in the [related Helm chart](https://gitlab.opencode.de/bmi/opendesk/components/platform-development/charts/opendesk-dashboards).
|
||||
|
||||
@@ -405,7 +405,7 @@ charts:
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/charts-mirror"
|
||||
name: "appsuite-public-sector"
|
||||
version: "2.26.23"
|
||||
version: "2.23.206"
|
||||
verify: false
|
||||
oxAppSuiteBootstrap:
|
||||
# providerCategory: "Platform"
|
||||
|
||||
@@ -796,7 +796,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["8", "6", "0"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/core-guidedtours"
|
||||
tag: "8.7.1@sha256:4b74178e71f843482584803edfb655cbb8f1f6966a50009e08fca344ad1efbe5"
|
||||
tag: "8.6.21@sha256:71b4819d42a808d57951405ab6215ff9fafae43e3f10a9f388484b7fbe28849e"
|
||||
openxchangeCoreMW:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
@@ -806,7 +806,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["8", "20", "51"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/middleware-public-sector"
|
||||
tag: "8.44.35@sha256:62d2fc1767a3073cb0451fe28cd9ca99326bba53771ba71d12a3a56c0af36a55"
|
||||
tag: "8.41.58@sha256:a4c169d13a928d5532fc200be6c7c76c1d18f0579b8dbdb514583f62ac9fe8c7"
|
||||
openxchangeCoreUI:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
@@ -816,7 +816,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["8", "20", "1"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/core-ui"
|
||||
tag: "8.45.0@sha256:496ecf7fa82c8d246bef53b7c0ebdce4a1df6a004534a473bd0b106e2b130cd4"
|
||||
tag: "8.41.1@sha256:108974ea42a4cf22ea1b37b975928881b6c23a2949b51781812f5b1260873aa4"
|
||||
openxchangeCoreUIMiddleware:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
@@ -826,7 +826,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["2", "0", "0"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/core-ui-middleware"
|
||||
tag: "2.3.0@sha256:5ed58f72ff7422b51c945b2a0d59894513f4cb66d3f8f33eab139707add80213"
|
||||
tag: "2.1.8@sha256:1853e6e2b780936a18b11c208b4b39ce094e49d25830c22c5658c27274e5b7fc"
|
||||
openxchangeCoreUserGuide:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
@@ -836,7 +836,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["8", "20", "799279"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/core-user-guide"
|
||||
tag: "8.45.2198459725@sha256:181ce7d1407f6fb5cbc8f6be79cc4eb8c3380390ea73ba1d6e70f4a7958f09f4"
|
||||
tag: "8.41.1547156@sha256:fadee7a76ffa91e0be7ec643f3315806787ac2eea4b0bb271201a58580a5f456"
|
||||
openxchangeDocumentConverter:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
@@ -846,7 +846,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["8", "20", "50"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/documentconverter"
|
||||
tag: "8.45.2035@sha256:1303907ba5379d5372ffdc378dc30c922383fc3f6a9bbbaa67bda979e09faa31"
|
||||
tag: "8.41.1875@sha256:839d73bdc7b158beee5e157df4b49004c9f4f2df1afb65c1e4bae51f9f67a213"
|
||||
openxchangeGotenberg:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
@@ -866,7 +866,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["4", "2", "2"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/guard-ui"
|
||||
tag: "8.33.6@sha256:23bf9c4156b34a6fe5db1e51c826884426b62d2440794369b8524cb8b745a003"
|
||||
tag: "8.33.4@sha256:e73afec3d549943379fdb12dde1ab14d53c6fafac221e2512c6641ac71c65b3f"
|
||||
openxchangeImageConverter:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
@@ -876,7 +876,7 @@ images:
|
||||
# upstreamMirrorStartFrom: ["8", "20", "50"]
|
||||
registry: "registry.opencode.de"
|
||||
repository: "bmi/opendesk/components/supplier/open-xchange/images-mirror/imageconverter"
|
||||
tag: "8.45.2557@sha256:de20301cd84ea67204f061a4de6d7cd5230331a5a2a92f8c26bf9bde90e044d3"
|
||||
tag: "8.41.2194@sha256:8b3085642fea2bc0ab64b6a8256ce4c00952e84d4c233edd05d458a8d82045f9"
|
||||
openxchangeNextcloudIntegrationUI:
|
||||
# providerCategory: "Supplier"
|
||||
# providerResponsible: "Open-Xchange"
|
||||
|
||||
Reference in New Issue
Block a user