|
|
@ -138,7 +138,7 @@ flux create image repository podinfo \
|
|
|
|
The above command generates the following manifest:
|
|
|
|
The above command generates the following manifest:
|
|
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
```yaml
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha1
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha2
|
|
|
|
kind: ImageRepository
|
|
|
|
kind: ImageRepository
|
|
|
|
metadata:
|
|
|
|
metadata:
|
|
|
|
name: podinfo
|
|
|
|
name: podinfo
|
|
|
@ -177,7 +177,7 @@ flux create image policy podinfo \
|
|
|
|
The above command generates the following manifest:
|
|
|
|
The above command generates the following manifest:
|
|
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
```yaml
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha1
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha2
|
|
|
|
kind: ImagePolicy
|
|
|
|
kind: ImagePolicy
|
|
|
|
metadata:
|
|
|
|
metadata:
|
|
|
|
name: podinfo
|
|
|
|
name: podinfo
|
|
|
@ -258,21 +258,25 @@ flux create image update flux-system \
|
|
|
|
The above command generates the following manifest:
|
|
|
|
The above command generates the following manifest:
|
|
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
```yaml
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha1
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha2
|
|
|
|
kind: ImageUpdateAutomation
|
|
|
|
kind: ImageUpdateAutomation
|
|
|
|
metadata:
|
|
|
|
metadata:
|
|
|
|
name: flux-system
|
|
|
|
name: flux-system
|
|
|
|
namespace: flux-system
|
|
|
|
namespace: flux-system
|
|
|
|
spec:
|
|
|
|
spec:
|
|
|
|
|
|
|
|
interval: 1m0s
|
|
|
|
|
|
|
|
sourceRef:
|
|
|
|
|
|
|
|
kind: GitRepository
|
|
|
|
|
|
|
|
name: flux-system
|
|
|
|
|
|
|
|
git:
|
|
|
|
checkout:
|
|
|
|
checkout:
|
|
|
|
|
|
|
|
ref:
|
|
|
|
branch: main
|
|
|
|
branch: main
|
|
|
|
gitRepositoryRef:
|
|
|
|
|
|
|
|
name: flux-system
|
|
|
|
|
|
|
|
commit:
|
|
|
|
commit:
|
|
|
|
authorEmail: fluxcdbot@users.noreply.github.com
|
|
|
|
author:
|
|
|
|
authorName: fluxcdbot
|
|
|
|
email: fluxcdbot@users.noreply.github.com
|
|
|
|
|
|
|
|
name: fluxcdbot
|
|
|
|
messageTemplate: '{{range .Updated.Images}}{{println .}}{{end}}'
|
|
|
|
messageTemplate: '{{range .Updated.Images}}{{println .}}{{end}}'
|
|
|
|
interval: 1m0s
|
|
|
|
|
|
|
|
push:
|
|
|
|
push:
|
|
|
|
branch: main
|
|
|
|
branch: main
|
|
|
|
update:
|
|
|
|
update:
|
|
|
@ -387,21 +391,20 @@ images:
|
|
|
|
|
|
|
|
|
|
|
|
## Push updates to a different branch
|
|
|
|
## Push updates to a different branch
|
|
|
|
|
|
|
|
|
|
|
|
With `.spec.push.branch` you can configure Flux to push the image updates to different branch
|
|
|
|
With `.spec.git.push.branch` you can configure Flux to push the image updates to different branch
|
|
|
|
than the one used for checkout. If the specified branch doesn't exist, Flux will create it for you.
|
|
|
|
than the one used for checkout. If the specified branch doesn't exist, Flux will create it for you.
|
|
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
```yaml
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha1
|
|
|
|
|
|
|
|
kind: ImageUpdateAutomation
|
|
|
|
kind: ImageUpdateAutomation
|
|
|
|
metadata:
|
|
|
|
metadata:
|
|
|
|
name: flux-system
|
|
|
|
name: flux-system
|
|
|
|
spec:
|
|
|
|
spec:
|
|
|
|
|
|
|
|
git:
|
|
|
|
checkout:
|
|
|
|
checkout:
|
|
|
|
|
|
|
|
ref:
|
|
|
|
branch: main
|
|
|
|
branch: main
|
|
|
|
gitRepositoryRef:
|
|
|
|
|
|
|
|
name: flux-system
|
|
|
|
|
|
|
|
push:
|
|
|
|
push:
|
|
|
|
branch: image-updates
|
|
|
|
branch: flux-image-updates
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
You can use CI automation e.g. GitHub Actions such as
|
|
|
|
You can use CI automation e.g. GitHub Actions such as
|
|
|
@ -412,17 +415,17 @@ This way you can manually approve the image updates before they are applied on y
|
|
|
|
|
|
|
|
|
|
|
|
## Configure the commit message
|
|
|
|
## Configure the commit message
|
|
|
|
|
|
|
|
|
|
|
|
The `.spec.commit.messageTemplate` field is a string which is used as a template for the commit message.
|
|
|
|
The `.spec.git.commit.messageTemplate` field is a string which is used as a template for the commit message.
|
|
|
|
|
|
|
|
|
|
|
|
The message template is a [Go text template](https://golang.org/pkg/text/template/) that
|
|
|
|
The message template is a [Go text template](https://golang.org/pkg/text/template/) that
|
|
|
|
lets you range over the objects and images e.g.:
|
|
|
|
lets you range over the objects and images e.g.:
|
|
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
```yaml
|
|
|
|
apiVersion: image.toolkit.fluxcd.io/v1alpha1
|
|
|
|
|
|
|
|
kind: ImageUpdateAutomation
|
|
|
|
kind: ImageUpdateAutomation
|
|
|
|
metadata:
|
|
|
|
metadata:
|
|
|
|
name: flux-system
|
|
|
|
name: flux-system
|
|
|
|
spec:
|
|
|
|
spec:
|
|
|
|
|
|
|
|
git:
|
|
|
|
commit:
|
|
|
|
commit:
|
|
|
|
messageTemplate: |
|
|
|
|
messageTemplate: |
|
|
|
|
Automated image update
|
|
|
|
Automated image update
|
|
|
@ -443,8 +446,9 @@ spec:
|
|
|
|
{{ range .Updated.Images -}}
|
|
|
|
{{ range .Updated.Images -}}
|
|
|
|
- {{.}}
|
|
|
|
- {{.}}
|
|
|
|
{{ end -}}
|
|
|
|
{{ end -}}
|
|
|
|
authorEmail: flux@example.com
|
|
|
|
author:
|
|
|
|
authorName: flux
|
|
|
|
email: fluxcdbot@users.noreply.github.com
|
|
|
|
|
|
|
|
name: fluxcdbot
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Trigger image updates with webhooks
|
|
|
|
## Trigger image updates with webhooks
|
|
|
@ -884,7 +888,7 @@ Create a directory in your control repository and save this `kustomization.yaml`
|
|
|
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
|
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
|
|
kind: Kustomization
|
|
|
|
kind: Kustomization
|
|
|
|
resources:
|
|
|
|
resources:
|
|
|
|
- git@github.com/fluxcd/flux2//manifests/integrations/registry-credentials-sync/azure
|
|
|
|
- https://github.com/fluxcd/flux2/manifests/integrations/registry-credentials-sync/azure?ref=main
|
|
|
|
patchesStrategicMerge:
|
|
|
|
patchesStrategicMerge:
|
|
|
|
- config-patches.yaml
|
|
|
|
- config-patches.yaml
|
|
|
|
```
|
|
|
|
```
|
|
|
|