From 515ce2da362b67fcf7519462c718a95973c55830 Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Tue, 17 Sep 2024 08:29:21 +0200 Subject: [PATCH] =?UTF-8?q?chore(base-cluster):=20this=20is=20now=20suppor?= =?UTF-8?q?ted=20=F0=9F=A5=B3=20(#1135)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- charts/base-cluster/README.md.gotmpl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/charts/base-cluster/README.md.gotmpl b/charts/base-cluster/README.md.gotmpl index 81097edb8..fd56cc950 100644 --- a/charts/base-cluster/README.md.gotmpl +++ b/charts/base-cluster/README.md.gotmpl @@ -1,4 +1,6 @@ -[modeline]: # ( vim: set ft=markdown: ) +{{- $majorVersion := index ((.Files.Get "Chart.yaml" | fromYaml).version | split ".") "_0" -}} +{{- $fluxMajorVersion := "2" -}} + {{ template "chart.header" . }} {{ template "chart.deprecationWarning" . }} @@ -17,7 +19,7 @@ git init # create empty cluster HelmRelease; -flux create helmrelease --export base-cluster -n flux-system --source HelmRepository/teuto-net.flux-system --chart base-cluster --chart-version 5.x.x > cluster.yaml +flux create helmrelease --export base-cluster -n flux-system --source HelmRepository/teuto-net.flux-system --chart base-cluster --chart-version {{ $majorVersion }}.x.x > cluster.yaml # maybe use the following name for your cluster; kubectl get node -o jsonpath='{.items[0].metadata.annotations.cluster\.x-k8s\.io/cluster-name}' @@ -30,7 +32,7 @@ vi cluster.yaml # create HelmRelease for flux to manage itself kubectl create namespace flux-system --dry-run=client -o yaml > flux.yaml flux create source helm --url https://fluxcd-community.github.io/helm-charts flux -n flux-system --export >> flux.yaml -flux create helmrelease --export flux -n flux-system --source HelmRepository/flux.flux-system --chart flux2 --chart-version 2.x.x >> flux.yaml +flux create helmrelease --export flux -n flux-system --source HelmRepository/flux.flux-system --chart flux2 --chart-version {{ $fluxMajorVersion }}.x.x >> flux.yaml # add, commit and push resources git add cluster.yaml flux.yaml @@ -40,11 +42,11 @@ git push # after this you should be on the KUBECONFIG for the cluster # we explicitly do not use `flux bootstrap` or `flux install` as this creates kustomization stuff and installs flux manually kubectl apply --server-side -f flux.yaml # ignore the errors about missing CRDs -helm install -n flux-system flux flux2 --repo https://fluxcd-community.github.io/helm-charts --version 2.x.x --atomic +helm install -n flux-system flux flux2 --repo https://fluxcd-community.github.io/helm-charts --version {{ $fluxMajorVersion }}.x.x --atomic # manual initial installation of the chart, afterwards the chart takes over # after the installation finished, follow the on-screen instructions to configure your flux, distribute KUBECONFIGs, ... -helm install -n flux-system base-cluster oci://ghcr.io/teutonet/teutonet-helm-charts/base-cluster --version 4.x.x --atomic --values <(cat cluster.yaml | yq -y .spec.values) +helm install -n flux-system base-cluster oci://ghcr.io/teutonet/teutonet-helm-charts/base-cluster --version {{ $majorVersion }}.x.x --atomic --values <(cat cluster.yaml | yq -y .spec.values) # you can use this command to get the instructions again # e.g. when adding users, gitRepositories, ... @@ -302,7 +304,7 @@ haven't already. ### 5.x.x -> 6.0.0 The kyverno 2.x.x -> 3.x.x upgrade cannot be done without manual intervention, see -https://artifacthub.io/packages/helm/kyverno/kyverno#option-1---uninstallation-and-reinstallation + So you have to backup your resources and delete the kyverno HelmReleases before the upgrade, they will be recreated in version 6.