diff --git a/content/en/docs/guides/upgrade/_index.md b/content/en/docs/guides/upgrade/_index.md new file mode 100644 index 000000000..c448db9bc --- /dev/null +++ b/content/en/docs/guides/upgrade/_index.md @@ -0,0 +1,9 @@ +--- +title: "Upgrade Flux" +weight: 43 +--- + +{{% note %}} +It is safe and advised to use the latest PATCH version when upgrading to a +new MINOR version. +{{% /note %}} diff --git a/content/en/docs/guides/upgrade/azuredo.md b/content/en/docs/guides/upgrade/azuredo.md new file mode 100644 index 000000000..25b067f39 --- /dev/null +++ b/content/en/docs/guides/upgrade/azuredo.md @@ -0,0 +1,35 @@ +--- +title: "Upgrade an Azure DevOps deployment of Flux" +--- + +## Before you begin + +You will need the following: + +- Upgraded the Flux CLI to the latest version + +## Generate updated Flux component manifests + +Generate manifests for Flux with ``flux install``: + +```bash +flux install \ + --export > ./flux-system/gotk-components.yaml +``` + +## Commit and push the updated component manifests + +1. Add the manifest + ```bash + git add flux-system/gotk-components.yaml + ``` + +2. Commit the changes + ```bash + git commit -m "Upgrade to $(flux -v)" + ``` + +3. Push the changes + ```bash + git push + ``` \ No newline at end of file diff --git a/content/en/docs/guides/upgrade/bootstrap.md b/content/en/docs/guides/upgrade/bootstrap.md new file mode 100644 index 000000000..f4033e130 --- /dev/null +++ b/content/en/docs/guides/upgrade/bootstrap.md @@ -0,0 +1,41 @@ +--- +title: "Upgrade using the bootstrap command" +--- + +## Before you begin + +You will need the following: + +- Upgraded the Flux CLI to the latest version + +## Run the bootstrap command + +Update the component manifests with ``flux bootstrap``: + +```bash +flux bootstrap github \ + --owner=my-github-username \ + --repository=my-repository \ + --branch=main \ + --personal +``` + +## Reconcile the changes + +Reconcile manifests from Git and upgrade using ``flux reconcile``: + +```bash +flux reconcile source git flux-system +``` + +## Verify the upgrade + +Verify that the controllers have been upgraded with: + +```bash +flux check +``` + +## Next Steps + +- Learn how to [Setup a GitHub action that opens a PR to update Flux](https://github.com/fluxcd/flux2/tree/main/action). diff --git a/content/en/docs/guides/upgrade/incluster.md b/content/en/docs/guides/upgrade/incluster.md new file mode 100644 index 000000000..3fc92956f --- /dev/null +++ b/content/en/docs/guides/upgrade/incluster.md @@ -0,0 +1,41 @@ +--- +title: "In Cluster Upgrade" +description: Direct with flux and kubectl +--- + +## Before you begin + +You will need the following: + +- Upgraded the Flux CLI to the latest version + +## Upgrade Flux + +Use the upgrade method that is similar to how you bootstrapped Flux. + +{{% tabs %}} +{{% tab flux install %}} +Apply the new Flux manifests by running ``flux install``: + +``` +flux install + +``` +{{% /tab %}} +{{% tab kubectl %}} +If you've installed Flux directly on the cluster with kubectl, +then rerun the command using the latest manifests from the `main` branch: + +```bash +kustomize build | kubectl apply -f- +``` +{{% /tab %}} +{{% /tabs %}} + +## Check the upgrade + +Use ``flux check``: + +```bash +flux check +``` diff --git a/content/en/docs/guides/upgrade/terraform.md b/content/en/docs/guides/upgrade/terraform.md new file mode 100644 index 000000000..d7f45e082 --- /dev/null +++ b/content/en/docs/guides/upgrade/terraform.md @@ -0,0 +1,18 @@ +--- +title: "Terraform" +date: 2021-09-12T23:51:42+01:00 +draft: true +--- + +## Update the Flux Provider + +Update the Flux provider to the [latest release](https://github.com/fluxcd/terraform-provider-flux/releases) +and run `terraform apply`. + +### Tell flux to upgrade itself + +Tell Flux to upgrade itself in-cluster or wait for it to pull the latest commit from Git: + +``` +kubectl annotate --overwrite gitrepository/flux-system reconcile.fluxcd.io/requestedAt="$(date +%s)" +``` diff --git a/content/en/docs/installation.md b/content/en/docs/installation.md index c4026f10d..12ddb7f8d 100644 --- a/content/en/docs/installation.md +++ b/content/en/docs/installation.md @@ -565,83 +565,7 @@ flux create helmrelease nginx \ ## Upgrade -{{% alert color="info" title="Patch versions" %}} -It is safe and advised to use the latest PATCH version when upgrading to a -new MINOR version. -{{% /alert %}} - -Update Flux CLI to the latest release with `brew upgrade fluxcd/tap/flux` or by -downloading the binary from [GitHub](https://github.com/fluxcd/flux2/releases). - -Verify that you are running the latest version with: - -```sh -flux --version -``` - -### Bootstrap upgrade - -If you've used the [bootstrap](#bootstrap) procedure to deploy Flux, -then rerun the bootstrap command for each cluster using the same arguments as before: - -```sh -flux bootstrap github \ - --owner=my-github-username \ - --repository=my-repository \ - --branch=main \ - --path=clusters/my-cluster \ - --personal -``` - -The above command will clone the repository, it will update the components manifest in -`/flux-system/gotk-components.yaml` and it will push the changes to the remote branch. - -Tell Flux to pull the manifests from Git and upgrade itself with: - -```sh -flux reconcile source git flux-system -``` - -Verify that the controllers have been upgrade with: - -```sh -flux check -``` - -{{% alert color="info" title="Automated upgrades" %}} -You can automate the components manifest update with GitHub Actions -and open a PR when there is a new Flux version available. -For more details please see [Flux GitHub Action docs](https://github.com/fluxcd/flux2/tree/main/action). -{{% /alert %}} - -### Terraform upgrade - -Update the Flux provider to the [latest release](https://github.com/fluxcd/terraform-provider-flux/releases) -and run `terraform apply`. - -Tell Flux to upgrade itself in-cluster or wait for it to pull the latest commit from Git: - -```sh -kubectl annotate --overwrite gitrepository/flux-system reconcile.fluxcd.io/requestedAt="$(date +%s)" -``` - -### In-cluster upgrade - -If you've installed Flux directly on the cluster, then rerun the install command: - -```sh -flux install -``` - -The above command will apply the new manifests on your cluster. -You can verify that the controllers have been upgraded to the latest version with `flux check`. - -If you've installed Flux directly on the cluster with kubectl, -then rerun the command using the latest manifests from the `main` branch: - -```sh -kustomize build https://github.com/fluxcd/flux2/manifests/install?ref=main | kubectl apply -f- -``` +See [Upgrade Flux](guides/upgrade/_index.md) for instructions for all upgrade methods. ## Uninstall