Skip to content

Commit

Permalink
Update dev guides to Flux v2.3
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
(cherry picked from commit e48ef4d)
  • Loading branch information
stefanprodan authored and github-actions[bot] committed May 14, 2024
1 parent 4c1d41c commit f1633cf
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 41 deletions.
4 changes: 2 additions & 2 deletions content/en/flux/gitops-toolkit/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ to debug e.g. performance issues.

## Pprof

The [GitOps Toolkit components](../components/_index.md) serve [`pprof`](https://golang.org/pkg/net/http/pprof/)
The [GitOps Toolkit components](/flux/components/) serve [`pprof`](https://golang.org/pkg/net/http/pprof/)
runtime profiling data on their metrics HTTP server (default `:8080`).

### Endpoints
Expand Down Expand Up @@ -43,5 +43,5 @@ or shared with one of the maintainers.

As `kubectl top` gives a limited (and at times inaccurate) overview of
resource usage, it is often better to make use of the Grafana metrics
to gather insights. See [Flux Prometheus metrics](../monitoring/metrics.md) for a
to gather insights. See [Flux Prometheus metrics](/flux/monitoring/metrics/) for a
guide on how to visualize this data with a Grafana dashboard.
57 changes: 29 additions & 28 deletions content/en/flux/gitops-toolkit/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,24 @@ go get github.com/fluxcd/source-controller/api
Import package

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

and for `GitRepository` objects:
and for `OCIRepository` objects:

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

API Types

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

### kustomize.toolkit.fluxcd.io

Expand All @@ -66,9 +67,9 @@ import kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"

API Types

| Name | Version |
|------------------------------------------------------------|---------|
| [Kustomization](../components/kustomize/kustomizations.md) | v1 |
| Name | Version |
|-------------------------------------------------------------|---------|
| [Kustomization](/flux/components/kustomize/kustomizations/) | v1 |

### helm.toolkit.fluxcd.io

Expand All @@ -81,14 +82,14 @@ go get github.com/fluxcd/helm-controller/api
Import package

```go
import helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
import helmv2 "github.com/fluxcd/helm-controller/api/v2"
```

API Types

| Name | Version |
|---------------------------------------------------|---------|
| [HelmRelease](../components/helm/helmreleases.md) | v2beta2 |
| Name | Version |
|----------------------------------------------------|---------|
| [HelmRelease](/flux/components/helm/helmreleases/) | v2 |

### notification.toolkit.fluxcd.io

Expand All @@ -112,11 +113,11 @@ import notificationv1 "github.com/fluxcd/notification-controller/api/v1"

API Types

| Name | Version |
|----------------------------------------------------|---------|
| [Receiver](../components/notification/receiver.md) | v1 |
| [Provider](../components/notification/provider.md) | v1beta3 |
| [Alert](../components/notification/alert.md) | v1beta3 |
| Name | Version |
|------------------------------------------------------|---------|
| [Receiver](/flux/components/notification/receivers/) | v1 |
| [Provider](/flux/components/notification/providers/) | v1beta3 |
| [Alert](/flux/components/notification/alerts/) | v1beta3 |

### image.toolkit.fluxcd.io

Expand All @@ -138,11 +139,11 @@ import (

API Types

| Name | Version |
|------------------------------------------------------------------------|---------|
| [ImageRepository](../components/image/imagerepositories.md) | v1beta2 |
| [ImagePolicy](../components/image/imagepolicies.md) | v1beta2 |
| [ImageUpdateAutomation](../components/image/imageupdateautomations.md) | v1beta2 |
| Name | Version |
|-------------------------------------------------------------------------|---------|
| [ImageRepository](/flux/components/image/imagerepositories/) | v1beta2 |
| [ImagePolicy](/flux/components/image/imagepolicies/) | v1beta2 |
| [ImageUpdateAutomation](/flux/components/image/imageupdateautomations/) | v1beta2 |

## CRUD Example

Expand All @@ -166,9 +167,9 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

helmv2 "github.com/fluxcd/helm-controller/api/v2beta2"
helmv2 "github.com/fluxcd/helm-controller/api/v2"
apimeta "github.com/fluxcd/pkg/apis/meta"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
)

func main() {
Expand Down
22 changes: 11 additions & 11 deletions content/en/flux/gitops-toolkit/source-watcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ weight: 20

In this guide you'll be developing a Kubernetes controller with
[Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)
that subscribes to [GitRepository](../components/source/gitrepositories.md)
that subscribes to [GitRepository](/flux/components/source/gitrepositories/)
events and reacts to revision changes by downloading the artifact produced by
[source-controller](../components/source/_index.md).
[source-controller](/flux/components/source/).

## Prerequisites

On your dev machine install the following tools:

* go >= 1.20
* go >= 1.22
* kubebuilder >= 3.0
* kind >= 0.17
* kubectl >= 1.25
* kind >= 0.22
* kubectl >= 1.29

## Install Flux

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

The source-watcher will log the revision:

```sh
{"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"}
{"level":"info","ts":"2024-05-14T16: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":"v2.2.0@sha1:81606709114f6d16a432f9f4bfc774942f054327"}
```

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

And source-watcher will log the new revision:

```sh
{"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"}
{"level":"info","ts":"2024-05-14T16: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.3.0@sha1:658925c2c0e6c408597d907a8ebee06a9a6d7f30"}
```

The source-controller reports the revision under `GitRepository.Status.Artifact.Revision` in the format: `<branch|tag>@sha1:<commit>`.
Expand Down Expand Up @@ -235,8 +235,8 @@ and Kubernetes [controller-runtime](https://pkg.go.dev/sigs.k8s.io/controller-ru

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

Expand Down

0 comments on commit f1633cf

Please sign in to comment.