Skip to content

Commit

Permalink
Unsuspend system helmreleases on cozystack restart (#219)
Browse files Browse the repository at this point in the history
Developers ofthen forget to unsuspend helm releases after the local
development (I do!)
This change make ensure that all system helm charts are getting
reconciled by flux after cozystack container restart

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
  • Loading branch information
kvaps authored Jul 18, 2024
1 parent 9bbdb11 commit 7c77a65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/platform/templates/helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ metadata:
namespace: {{ $x.namespace }}
labels:
cozystack.io/repository: system
cozystack.io/system-app: "true"
spec:
interval: 5m
releaseName: {{ $x.releaseName | default $x.name }}
Expand Down
5 changes: 5 additions & 0 deletions scripts/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ fi
# Reconcile Helm repositories
kubectl annotate helmrepositories.source.toolkit.fluxcd.io -A -l cozystack.io/repository reconcile.fluxcd.io/requestedAt=$(date +"%Y-%m-%dT%H:%M:%SZ") --overwrite

# Unsuspend all system charts
kubectl get hr -A -l cozystack.io/system-app=true --no-headers | while read namespace name rest; do
kubectl patch hr -n "$namespace" "$name" -p '{"spec": {"suspend": null}}' --type=merge --field-manager=flux-client-side-apply
done

# Reconcile platform chart
trap 'exit' INT TERM
while true; do
Expand Down

0 comments on commit 7c77a65

Please sign in to comment.