[platform]: add migration for kube-rbac-proxy daemonset (#830)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Introduced a migration script to update monitoring resources, ensuring
refreshed configurations and pod restarts for improved system stability.
	- Updated installer version tracking to support the latest migration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Andrei Kvapil
2025-04-22 12:44:56 +02:00
committed by GitHub
2 changed files with 19 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ set -o pipefail
set -e
BUNDLE=$(set -x; kubectl get configmap -n cozy-system cozystack -o 'go-template={{index .data "bundle-name"}}')
VERSION=10
VERSION=12
run_migrations() {
if ! kubectl get configmap -n cozy-system cozystack-version; then

18
scripts/migrations/11 Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
# Migration 11 --> 12
# Recreate daemonset kube-rbac-proxy
if kubectl get daemonset kube-rbac-proxy -n cozy-monitoring; then
kubectl delete daemonset kube-rbac-proxy --cascade=orphan -n cozy-monitoring
fi
if kubectl get helmrelease monitoring-agents -n cozy-monitoring; then
timestamp=$(date --rfc-3339=ns)
kubectl annotate helmrelease monitoring-agents -n cozy-monitoring \
reconcile.fluxcd.io/forceAt="$timestamp" \
reconcile.fluxcd.io/requestedAt="$timestamp" \
--overwrite
fi
kubectl delete pods -l app.kubernetes.io/component=kube-rbac-proxy -n cozy-monitoring