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

Add upgrade guides #519

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions content/en/docs/deploy-manage-flux/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/deploy-manage-flux/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/deploy-manage-flux/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/deploy-manage-flux/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/deploy-manage-flux/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)"
```
80 changes: 2 additions & 78 deletions content/en/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ If your Git provider is **GitHub**, **GitLab** or **Azure DevOps** please follow

* [GitHub.com and GitHub Enterprise](#github-and-github-enterprise)
* [GitLab.com and GitLab Enterprise](#gitlab-and-gitlab-enterprise)
* [Azure DevOps](../use-cases/azure#flux-installation-for-azure-devops)
* [Azure DevOps](use-cases/azure.md##flux-installation-for-azure-devops)

### Generic Git Server

Expand Down 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](deploy-manage-flux/upgrade/_index.md) for instructions for all upgrade methods.

## Uninstall

Expand Down