Skip to content

Commit

Permalink
bump API version on all pages
Browse files Browse the repository at this point in the history
- GitRepository v1
- Kustomization v1
- Receiver v1
- CronJob v1

Signed-off-by: Max Jonas Werner <mail@makk.es>
  • Loading branch information
Max Jonas Werner committed Apr 5, 2023
1 parent 3d32a85 commit e67c2c1
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 55 deletions.
2 changes: 1 addition & 1 deletion content/en/flux/cheatsheets/oci-artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
ref:
tag: latest
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/cheatsheets/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ in [`helm/helm#8281`](https://github.com/helm/helm/issues/8281).

If you are running into this, confirm first that your chart has all the required excludes in
their respective [`.helmignore`](https://helm.sh/docs/chart_template_guide/helm_ignore_file/) and
[`.sourceignore`](/flux/components/source/api/#source.toolkit.fluxcd.io/v1beta2.GitRepository) files.
[`.sourceignore`](/flux/components/source/api/#source.toolkit.fluxcd.io/v1.GitRepository) files.

### How to debug "not ready" errors?

Expand Down
14 changes: 7 additions & 7 deletions content/en/flux/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Define a source of type `gitrepository.source.toolkit.fluxcd.io`
that pulls changes from the app repository every 5 minutes inside the cluster:

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: my-app
Expand All @@ -63,7 +63,7 @@ Then define a `kustomization.kustomize.toolkit.fluxcd.io` that uses the `kustomi
from `./deploy/prod` to determine which resources to create, update or delete:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: my-app
Expand Down Expand Up @@ -122,7 +122,7 @@ Assuming an app repository with the following structure:
Create a `GitRepository` definition and exclude all the files that are not Kubernetes manifests:

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: my-app
Expand All @@ -144,7 +144,7 @@ spec:
Then create a `Kustomization` definition to reconcile the `./deploy/prod` dir:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: my-app
Expand Down Expand Up @@ -257,7 +257,7 @@ spec:
Then to reconcile the manifests on a cluster, you'll use the ones from the verified source:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: kyverno
Expand Down Expand Up @@ -488,7 +488,7 @@ roll out a new version. We have couple options:
#### Using Kustomize patches:
```yaml
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: apps
Expand Down Expand Up @@ -537,7 +537,7 @@ spec:

To enable the replacement of the `PODINFO_CHART_VERSION` variable with a different version than the `6.2.0` default, specify `postBuild` in the `Kustomization`:
```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: apps
Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/flux-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ In the analogy, the fruits are the charts and the GitRepository is the bag – 
Flux provides tools that you have at your disposal for making sources narrowly scoped, here's one example:

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: my-chart-git-repo
Expand Down
4 changes: 2 additions & 2 deletions content/en/flux/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ podinfo is a tiny web application made with Go.
The output is similar to:

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo
Expand Down Expand Up @@ -168,7 +168,7 @@ directory located in the podinfo repository.
The output is similar to:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
Expand Down
35 changes: 24 additions & 11 deletions content/en/flux/gitops-toolkit/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,24 @@ go get github.com/fluxcd/source-controller/api
Import package

```go
import sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
import sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
```

and/or (depending on the API types you will be consuming)

```go
import sourcev1 "github.com/fluxcd/source-controller/api/v1"
```


API Types

| Name | Version |
|---|---|
| [GitRepository](../components/source/gitrepositories.md) | v1beta1 |
| [HelmRepository](../components/source/helmrepositories.md) | v1beta1 |
| [HelmChart](../components/source/helmcharts.md) | v1beta1 |
| [Bucket](../components/source/buckets.md) | v1beta1 |
| [GitRepository](../components/source/gitrepositories.md) | v1 |
| [HelmRepository](../components/source/helmrepositories.md) | v1beta2 |
| [HelmChart](../components/source/helmcharts.md) | v1beta2 |
| [Bucket](../components/source/buckets.md) | v1beta2 |

### kustomize.toolkit.fluxcd.io

Expand All @@ -55,14 +62,14 @@ go get github.com/fluxcd/kustomize-controller/api
Import package

```go
import kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
import kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
```

API Types

| Name | Version |
|---|---|
| [Kustomization](../components/kustomize/kustomization.md) | v1beta1 |
| [Kustomization](../components/kustomize/kustomization.md) | v1 |

### helm.toolkit.fluxcd.io

Expand Down Expand Up @@ -95,16 +102,22 @@ go get github.com/fluxcd/notification-controller/api
Import package

```go
import helmv2 "github.com/fluxcd/notification-controller/api/v1beta1"
import notificationv1 "github.com/fluxcd/notification-controller/api/v1beta2"
```

and/or (depending on the API types you will be consuming)

```go
import notificationv1 "github.com/fluxcd/notification-controller/api/v1"
```

API Types

| Name | Version |
|---|---|
| [Receiver](../components/notification/receiver.md) | v1beta1 |
| [Provider](../components/notification/provider.md) | v1beta1 |
| [Alert](../components/notification/alert.md) | v1beta1 |
| [Receiver](../components/notification/receiver.md) | v1 |
| [Provider](../components/notification/provider.md) | v1beta2 |
| [Alert](../components/notification/alert.md) | v1beta2 |

### image.toolkit.fluxcd.io

Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/gitops-toolkit/source-watcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"

sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions content/en/flux/guides/cron-job-image-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ metadata:
# annotations:
# eks.amazonaws.com/role-arn: <role arn>
---
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: ecr-credentials-sync
Expand Down Expand Up @@ -208,7 +208,7 @@ metadata:
name: gcr-credentials-sync
namespace: flux-system
---
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: gcr-credentials-sync
Expand Down Expand Up @@ -309,7 +309,7 @@ our desired Namespace.
Create a directory in your control repository and save this `kustomization.yaml`:
```yaml
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
apiVersion: kustomize.config.k8s.io/v1
kind: Kustomization
resources:
- https://github.com/fluxcd/flux2/manifests/integrations/registry-credentials-sync/azure?ref=main
Expand Down
8 changes: 4 additions & 4 deletions content/en/flux/guides/helmreleases.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ later on in the guide).
An example `GitRepository`:

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: podinfo
Expand Down Expand Up @@ -349,7 +349,7 @@ spec:
Create a `kustomization.yaml` that generates the `ConfigMap` using our kustomize config:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
apiVersion: kustomize.config.k8s.io/v1
kind: Kustomization
namespace: podinfo
resources:
Expand Down Expand Up @@ -436,7 +436,7 @@ Kustomize configuration.
Create a `kustomization.yaml` that generates the `Secret`:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
apiVersion: kustomize.config.k8s.io/v1
kind: Kustomization
namespace: podinfo
resources:
Expand Down Expand Up @@ -594,7 +594,7 @@ kubectl -n flux-system create secret generic webhook-token \
When using [Harbor](https://goharbor.io/) as your Helm repository, you can define a receiver with:

```yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta2
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata:
name: helm-podinfo
Expand Down
6 changes: 3 additions & 3 deletions content/en/flux/guides/image-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ spec:
Flux `Kustomization` example:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
Expand All @@ -445,7 +445,7 @@ spec:
Kustomize config (`kustomization.yaml`) example:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
apiVersion: kustomize.config.k8s.io/v1
kind: Kustomization
resources:
- deployment.yaml
Expand Down Expand Up @@ -537,7 +537,7 @@ kubectl -n flux-system create secret generic webhook-token \
Define a receiver for DockerHub:

```yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta2
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata:
name: podinfo
Expand Down
4 changes: 2 additions & 2 deletions content/en/flux/guides/mozilla-sops.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ add the GitRepository/Kustomization manifests to the fleet repository.
Git repository manifest:

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: my-secrets
Expand All @@ -522,7 +522,7 @@ spec:
Kustomization manifest:

```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: my-secrets
Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/guides/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ metadata:

Then create a Kustomization to deploy podinfo.
```yaml
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: podinfo
Expand Down
8 changes: 4 additions & 4 deletions content/en/flux/guides/repository-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ App repository plain Kubernetes manifests example:
Delivery example (stored in config repo):

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: app
Expand All @@ -164,7 +164,7 @@ spec:
ref:
semver: "1.x"
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: app
Expand Down Expand Up @@ -195,7 +195,7 @@ App repository Kustomize overlays example:
Delivery example (stored in config repo):

```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: app
Expand All @@ -204,7 +204,7 @@ spec:
ref:
branch: main
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: app
Expand Down
4 changes: 2 additions & 2 deletions content/en/flux/guides/webhook-receivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Add any necessary annotations for your ingress controller or, for example, cert-
Create a Git source pointing to a GitHub repository that you have control over:
```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: webapp
Expand Down Expand Up @@ -119,7 +119,7 @@ kubectl -n flux-system create secret generic webhook-token \
Create a receiver for GitHub and specify the `GitRepository` object:

```yaml
apiVersion: notification.toolkit.fluxcd.io/v1beta2
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata:
name: webapp
Expand Down
4 changes: 2 additions & 2 deletions content/en/flux/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ touch clusters/my-cluster/flux-system/gotk-components.yaml \
Add patches to `kustomization.yaml`:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
apiVersion: kustomize.config.k8s.io/v1
kind: Kustomization
resources: # manifests generated during bootstrap
- gotk-components.yaml
Expand Down Expand Up @@ -543,7 +543,7 @@ Assuming you want to lock down Flux on multi-tenant clusters,
add the following patches to `clusters/my-cluster/flux-system/kustomization.yaml`:

```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
apiVersion: kustomize.config.k8s.io/v1
kind: Kustomization
resources:
- gotk-components.yaml
Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/migration/faq-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Custom Prometheus metrics | Generic / common `controller-runtime` Prometheus met

### Are there any breaking changes?

- In Flux v1 Kustomize support was implemented through `.flux.yaml` files in the Git repository. As indicated in the comparison table above, while this approach worked, we found it to be error-prone and hard to debug. The new [Kustomization CR](https://github.com/fluxcd/kustomize-controller/blob/master/docs/spec/v1beta1/kustomization.md) should make troubleshooting much easier. Unfortunately we needed to drop the support for custom commands as running arbitrary shell scripts in-cluster poses serious security concerns.
- In Flux v1 Kustomize support was implemented through `.flux.yaml` files in the Git repository. As indicated in the comparison table above, while this approach worked, we found it to be error-prone and hard to debug. The new [Kustomization CR](https://github.com/fluxcd/kustomize-controller/blob/main/docs/spec/v1/kustomization.md) should make troubleshooting much easier. Unfortunately we needed to drop the support for custom commands as running arbitrary shell scripts in-cluster poses serious security concerns.
- Helm users: we redesigned the `HelmRelease` API and the automation will work quite differently, so upgrading to `HelmRelease` v2 will require a little work from you, but you will gain more flexibility, better observability and performance.

### Is the GitOps Toolkit related to the GitOps Engine?
Expand Down
Loading

0 comments on commit e67c2c1

Please sign in to comment.