Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(base-cluster): this is now supported 🥳 #1135

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions charts/base-cluster/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -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" . }}

Expand All @@ -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}'
Expand All @@ -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
Expand All @@ -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, ...
Expand Down Expand Up @@ -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
<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.
Expand Down