Compare commits

..

2 Commits

Author SHA1 Message Date
Lilly Sell
3d7d538626 chore(misc): Add standard python script guard to charts-local.py
This adds a `if __name__ == "__main__"` guard to the charts-local.py script.
The guard should always be used to make it obvious to developers that this is
the entrypoint of the script and to prevent accidental side effects when handling
the script as a python module in any way (e.g. during interactive debugging).
2025-12-03 10:32:43 +01:00
Lilly Sell
1b9843d579 chore(misc): Add PEP723 inline script metadata to charts-local.py
This makes it possible to simply run the script e.g. via `run run charts-local.py` and without
having to setup and maintain a virtual environment.
2025-12-03 10:32:43 +01:00
6 changed files with 93 additions and 85 deletions

View File

@@ -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)

View File

@@ -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` | |

View File

@@ -12,10 +12,10 @@ SPDX-License-Identifier: Apache-2.0
* [Manual checks/actions](#manual-checksactions)
* [Versions ≥ v1.11.0](#versions--v1110)
* [Pre-upgrade to versions ≥ v1.11.0](#pre-upgrade-to-versions--v1110)
* [Deployment cleanup: Collabora Controller](#deployment-cleanup-collabora-controller)
* [Helmfile new option: Annotations for external services (Dovecot, Jitsi JVB, Postfix)](#helmfile-new-option-annotations-for-external-services-dovecot-jitsi-jvb-postfix)
* [Versions ≥ v1.10.0](#versions--v1100)
* [Pre-upgrade to versions ≥ v1.10.0](#pre-upgrade-to-versions--v1100)
* [Deployment cleanup: Collabora Controller](#deployment-cleanup-collabora-controller)
* [Helmfile new secret: `secrets.nubus.ldapSearch.postfix`](#helmfile-new-secret-secretsnubusldapsearchpostfix)
* [Helmfile new secret: `secrets.doveocot.sharedMailboxesMasterPassword`](#helmfile-new-secret-secretsdoveocotsharedmailboxesmasterpassword)
* [New Helmfile default: Nubus provisioning debug container no longer deployed](#new-helmfile-default-nubus-provisioning-debug-container-no-longer-deployed)
@@ -189,25 +189,6 @@ If you would like more details about the automated migrations, please read secti
### Pre-upgrade to versions ≥ v1.11.0
#### Deployment cleanup: Collabora Controller
**Target group:** Existing openDesk Enterprise deployments using Collabora Controller. Actually only long running
deployments are affected, but following the instructions won't hurt.
As per upstream release notes for [Collabora Online Controller 1.1.7](https://www.collaboraonline.com/cool-controller-release-notes/)
you have to remove the existing leases of the Controller. You can do so by setting `<your_namespace>` and executing
the commands below.
```shell
export NAMESPACE=<your_namespace>
export COLLABORA_CONTROLLER_DEPLOYMENT_NAME=collabora-controller-cool-controller
kubectl -n ${NAMESPACE} scale deployment/${COLLABORA_CONTROLLER_DEPLOYMENT_NAME} --replicas=0
kubectl -n ${NAMESPACE} delete -n collabora leases.coordination.k8s.io collabora-online
```
> [!note]
> The Collabora Online Controller is not scaled up again, as this would happen as part of the upgrade deployment.
#### Helmfile new option: Annotations for external services (Dovecot, Jitsi JVB, Postfix)
**Target group:** Existing deployments using `service` annotations.
@@ -237,6 +218,25 @@ annotations for the external service use the newly introduced key `annotations.o
### Pre-upgrade to versions ≥ v1.10.0
#### Deployment cleanup: Collabora Controller
**Target group:** Existing openDesk Enterprise deployments using Collabora Controller. Actually only long running
deployments are affected, but following the instructions won't hurt.
As per upstream release notes for [Collabora Online Controller 1.1.4](https://www.collaboraonline.com/cool-controller-release-notes/)
you have to remove the existing leases of the Controller. You can do so by setting `<your_namespace>` and executing
the commands below.
```shell
export NAMESPACE=<your_namespace>
export COLLABORA_CONTROLLER_DEPLOYMENT_NAME=collabora-controller-cool-controller
kubectl -n ${NAMESPACE} scale deployment/${COLLABORA_CONTROLLER_DEPLOYMENT_NAME} --replicas=0
kubectl -n ${NAMESPACE} delete -n collabora leases.coordination.k8s.io collabora-online
```
> [!note]
> The Collabora Online Controller is not scaled up again, as this would happen as part of the upgrade deployment.
#### Helmfile new secret: `secrets.nubus.ldapSearch.postfix`
**Target group:** All existing deployments that use self-defined secrets.

View File

@@ -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).

View File

@@ -65,7 +65,7 @@ charts:
registry: "registry.opencode.de"
repository: "zendis/opendesk-enterprise/components/supplier/collabora/charts-mirror"
name: "cool-controller"
version: "1.1.11"
version: "1.1.10"
verify: false
cryptpad:
# providerCategory: "Supplier"

View File

@@ -57,7 +57,7 @@ images:
# providerResponsible: "Collabora"
registry: "registry.opencode.de"
repository: "zendis/opendesk-enterprise/components/supplier/collabora/images-mirror/cool-controller"
tag: "1.1.7@sha256:f9b43219cf9de521b39bfe91e78b1e5e32a0b61712ab4ca2b401c67bc4a326fc"
tag: "1.1.6@sha256:7935f21bf75cdddbbbd01754d8d0458014a68ab64b08121c8fca7a2715e0d85b"
cryptpad:
# providerCategory: "Supplier"
# providerResponsible: "XWiki"