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

GA: Publish v1 docs for GitRepository, Receiver & Kustomization #1427

Merged
merged 4 commits into from
Apr 6, 2023
Merged
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
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
1 change: 1 addition & 0 deletions content/en/flux/components/helm/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ please see the [bootstrap cheatsheet](../../cheatsheets/bootstrap.md).
| `--no-cross-namespace-refs` | boolean | When set to true, references between custom resources are allowed only if the reference and the referee are in the same namespace. |
| `--requeue-dependency` | duration | The interval at which failing dependencies are reevaluated. (default 30s) |
| `--watch-all-namespaces` | boolean | Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true) |
| `--watch-label-selector` | string | Watch for resources with matching labels e.g. 'sharding.fluxcd.io/shard=shard1'. |
| `--feature-gates` | mapStringBool | A comma separated list of key=value pairs defining the state of experimental features. |
| `--oom-watch-interval` | duration | The interval at which the OOM watcher will check for memory usage. Requires feature gate 'OOMWatch' to be enabled. (default 500ms) |
| `--oom-watch-memory-threshold` | unit8 | The memory threshold in percentage at which the OOM watcher will trigger a graceful shutdown. Requires feature gate 'OOMWatch' to be enabled. (default 95) |
Expand Down
2 changes: 2 additions & 0 deletions content/en/flux/components/image/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ please see the [bootstrap cheatsheet](../../cheatsheets/bootstrap.md).
| `--ssh-hostkey-algos` | strings | The list of hostkey algorithms to use for ssh connections, arranged from most preferred to the least. |
| `--ssh-kex-algos` | strings | The list of key exchange algorithms to use for ssh connections, arranged from most preferred to the least. |
| `--watch-all-namespaces` | boolean | Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true) |
| `--watch-label-selector` | string | Watch for resources with matching labels e.g. 'sharding.fluxcd.io/shard=shard1'. |
| `--feature-gates` | mapStringBool | A comma separated list of key=value pairs defining the state of experimental features. |

### Feature Gates
Expand Down Expand Up @@ -64,6 +65,7 @@ please see the [bootstrap cheatsheet](../../cheatsheets/bootstrap.md).
| `--storage-path` | string | Where to store the persistent database of image metadata. (default "/data") |
| `--storage-value-log-file-size` | int | Set the database's memory mapped value log file size in bytes. Effective memory usage is about two times this size. (default 268435456) |
| `--watch-all-namespaces` | boolean | Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true) |
| `--watch-label-selector` | string | Watch for resources with matching labels e.g. 'sharding.fluxcd.io/shard=shard1'. |
| `--feature-gates` | mapStringBool | A comma separated list of key=value pairs defining the state of experimental features. |

### Feature Gates
Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/components/kustomize/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
api.md
api/v*.md
kustomization.md
5 changes: 5 additions & 0 deletions content/en/flux/components/kustomize/api/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: API Reference
linkTitle: API Reference
weight: 1000
---
3 changes: 2 additions & 1 deletion content/en/flux/components/kustomize/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Controller Options
linkTitle: Controller Options
description: "Controller command flags and defaults."
weight: 1000
weight: 1
---

To customise the controller options at install time,
Expand Down Expand Up @@ -35,6 +35,7 @@ please see the [bootstrap cheatsheet](../../cheatsheets/bootstrap.md).
| `--no-remote-bases` | boolean | Disallow remote bases usage in Kustomize overlays. When this flag is enabled, all resources must refer to local files included in the source artifact. |
| `--requeue-dependency` | duration | The interval at which failing dependencies are reevaluated. (default 30s) |
| `--watch-all-namespaces` | boolean | Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true) |
| `--watch-label-selector` | string | Watch for resources with matching labels e.g. 'sharding.fluxcd.io/shard=shard1'. |
| `--feature-gates` | mapStringBool | A comma separated list of key=value pairs defining the state of experimental features. |


Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/components/notification/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
alert.md
api.md
api/v*.md
event.md
provider.md
receiver.md
Empty file.
5 changes: 5 additions & 0 deletions content/en/flux/components/notification/api/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: API Reference
linkTitle: API Reference
weight: 1000
---
2 changes: 1 addition & 1 deletion content/en/flux/components/notification/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Controller Options
linkTitle: Controller Options
description: "Controller command flags and defaults."
weight: 1000
weight: 1
---

To customise the controller options at install time,
Expand Down
2 changes: 1 addition & 1 deletion content/en/flux/components/source/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api.md
api/v*.md
buckets.md
gitrepositories.md
helmcharts.md
Expand Down
5 changes: 5 additions & 0 deletions content/en/flux/components/source/api/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: API Reference
linkTitle: API Reference
weight: 1000
---
3 changes: 2 additions & 1 deletion content/en/flux/components/source/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Controller Options
linkTitle: Controller Options
description: "Controller command flags and defaults."
weight: 1000
weight: 1
---

To customise the controller options at install time,
Expand Down Expand Up @@ -42,6 +42,7 @@ please see the [bootstrap cheatsheet](../../cheatsheets/bootstrap.md).
| `--storage-adv-addr` | string | The advertised address of the static file server. |
| `--storage-path` | string | The local storage path. |
| `--watch-all-namespaces` | boolean | Watch for custom resources in all namespaces, if set to false it will only watch the runtime namespace. (default true) |
| `--watch-label-selector` | string | Watch for resources with matching labels e.g. 'sharding.fluxcd.io/shard=shard1'. |
| `--feature-gates` | mapStringBool | A comma separated list of key=value pairs defining the state of experimental features. |

### Feature Gates
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
36 changes: 24 additions & 12 deletions content/en/flux/gitops-toolkit/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ go get github.com/fluxcd/source-controller/api
Import package

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

and for `GitRepository` objects:

```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 +61,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 +101,22 @@ go get github.com/fluxcd/notification-controller/api
Import package

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

and for `Receiver` objects:

```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 Expand Up @@ -156,7 +168,7 @@ import (

helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
apimeta "github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
)

func main() {
Expand Down
23 changes: 11 additions & 12 deletions content/en/flux/gitops-toolkit/source-watcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ events and reacts to revision changes by downloading the artifact produced by

On your dev machine install the following tools:

* go >= 1.19
* go >= 1.20
* kubebuilder >= 3.0
* kind >= 0.8
* kubectl >= 1.21
* kind >= 0.17
* kubectl >= 1.25

## Install Flux

Expand Down Expand Up @@ -93,14 +93,13 @@ Create a Git source:
flux create source git test \
--url=https://github.com/fluxcd/flux2 \
--ignore-paths='/*,!/manifests' \
--tag=v0.34.0
--tag=v0.41.2
```

The source-watcher will log the revision:

```sh
New revision detected {"gitrepository": "flux-system/test", "revision": "v0.34.0@sha1:90f0d81532f6ea76c30974267956c7eaee5c1dea"}
Processing manifests...
{"level":"info","ts":"2023-03-31T16:43:42.703+0200","msg":"New revision detected","controller":"gitrepository","controllerGroup":"source.toolkit.fluxcd.io","controllerKind":"GitRepository","GitRepository":{"name":"test","namespace":"flux-system"},"namespace":"flux-system","name":"test","reconcileID":"ef0fe80e-3952-4835-ae9d-01760c4eadde","revision":"v0.41.2@sha1:81606709114f6d16a432f9f4bfc774942f054327"}
```

Change the Git tag:
Expand All @@ -109,13 +108,13 @@ Change the Git tag:
flux create source git test \
--url=https://github.com/fluxcd/flux2 \
--ignore-paths='/*,!/manifests' \
--tag=v0.35.0
--tag=v2.0.0-rc.1
```

And source-watcher will log the new revision:

```sh
New revision detected {"gitrepository": "flux-system/test", "revision": "v0.35.0@sha1:1bf63a94c22d1b9b7ccf92f66a1a34a74bd72fca"}
{"level":"info","ts":"2023-03-31T16:51:33.499+0200","msg":"New revision detected","controller":"gitrepository","controllerGroup":"source.toolkit.fluxcd.io","controllerKind":"GitRepository","GitRepository":{"name":"test","namespace":"flux-system"},"namespace":"flux-system","name":"test","reconcileID":"cc0f83bb-b7a0-4c19-a254-af9962ae39cd","revision":"v2.0.0-rc.1@sha1:658925c2c0e6c408597d907a8ebee06a9a6d7f30"}
```

The source-controller reports the revision under `GitRepository.Status.Artifact.Revision` in the format: `<branch|tag>@sha1:<commit>`.
Expand Down Expand Up @@ -172,7 +171,7 @@ func (r *GitRepositoryWatcher) Reconcile(ctx context.Context, req ctrl.Request)
defer os.RemoveAll(tmpDir)

// download and extract artifact
if err := r.artifactFetcher.Fetch(artifact.URL, artifact.Checksum, tmpDir); err != nil {
if err := r.artifactFetcher.Fetch(artifact.URL, artifact.Digest, tmpDir); err != nil {
log.Error(err, "unable to fetch artifact")
return ctrl.Result{}, err
}
Expand Down Expand Up @@ -204,7 +203,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 Expand Up @@ -236,8 +235,8 @@ and Kubernetes [controller-runtime](https://pkg.go.dev/sigs.k8s.io/controller-ru

```go
require (
github.com/fluxcd/pkg/runtime v0.20.0
sigs.k8s.io/controller-runtime v0.13.0
github.com/fluxcd/pkg/runtime v0.35.0
sigs.k8s.io/controller-runtime v0.14.6
)
```

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
Loading