Skip to content

Commit

Permalink
Add upgrade guides
Browse files Browse the repository at this point in the history
- Break out upgrade instructions under docs/installation.md into individual pages

Signed-off-by: Alison Dowdney <alison@alisondowdney.com>
  • Loading branch information
alisondy committed Sep 13, 2021
1 parent b786cd2 commit f4dec50
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 77 deletions.
9 changes: 9 additions & 0 deletions content/en/docs/guides/upgrade/_index.md
Original file line number Diff line number Diff line change
@@ -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 %}}
35 changes: 35 additions & 0 deletions content/en/docs/guides/upgrade/azuredo.md
Original file line number Diff line number Diff line change
@@ -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
```
41 changes: 41 additions & 0 deletions content/en/docs/guides/upgrade/bootstrap.md
Original file line number Diff line number Diff line change
@@ -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).
41 changes: 41 additions & 0 deletions content/en/docs/guides/upgrade/incluster.md
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/fluxcd/flux2/manifests/install?ref=main> | kubectl apply -f-
```
{{% /tab %}}
{{% /tabs %}}

## Check the upgrade

Use ``flux check``:

```bash
flux check
```
18 changes: 18 additions & 0 deletions content/en/docs/guides/upgrade/terraform.md
Original file line number Diff line number Diff line change
@@ -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:

```bash
kubectl annotate --overwrite gitrepository/flux-system reconcile.fluxcd.io/requestedAt="$(date +%s)"
```
78 changes: 1 addition & 77 deletions content/en/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
`<path>/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

Expand Down

0 comments on commit f4dec50

Please sign in to comment.