ImageUpdateAutomation Question #4869
-
I want the ImageUpdateAutomation to commit to my repository only when there is a new image available. Currently, it commits every 5 minutes regardless of whether a new image is present. Did I miss something in my configuration? Here is my complete setup: apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageRepository
metadata:
name: angular-app-image
namespace: web
spec:
image: ghcr.io/honigeintopf/angular-app
interval: 5m
secretRef:
name: ghcr-secret
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImagePolicy
metadata:
name: angular-app-policy
namespace: web
spec:
imageRepositoryRef:
name: angular-app-image
filterTags:
pattern: "^(?P<ts>.*)"
extract: "$ts"
policy:
numerical:
order: asc
---
apiVersion: image.toolkit.fluxcd.io/v1beta2
kind: ImageUpdateAutomation
metadata:
name: angular-app-auto
namespace: web
spec:
interval: 5m
sourceRef:
kind: GitRepository
name: angular-app-repo
git:
commit:
author:
email: [email protected]
name: fluxcdbot
push:
branch: main
update:
path: "./"
strategy: Setters
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
If nothing has changed, IUA would have nothing to commit so if you see new commits arriving every 5 minutes then your image repository is changing within that timeframe, too. What exactly does IUA commit? |
Beta Was this translation helpful? Give feedback.
-
Its updating the image tag, maybe there is somewhere a loop? - name: ghcr-secret
containers:
- name: angular-app
image: ghcr.io/honigeintopf/angular-app:20240703141025 # {"$imagepolicy": "web:angular-app-policy"}
image: ghcr.io/honigeintopf/angular-app:20240703141525 # {"$imagepolicy": "web:angular-app-policy"}
ports:
- containerPort: 80
resources:
The deployment: apiVersion: apps/v1
kind: Deployment
metadata:
name: angular-app
namespace: web
spec:
replicas: 2
selector:
matchLabels:
app: angular-app
template:
metadata:
labels:
app: angular-app
spec:
imagePullSecrets:
- name: ghcr-secret
containers:
- name: angular-app
image: ghcr.io/honigeintopf/angular-app:20240703130516 # {"$imagepolicy": "web:angular-app-policy"}
ports:
- containerPort: 80
resources:
limits:
cpu: "500m"
memory: "512Mi"
requests:
cpu: "200m"
memory: "256Mi"
`` |
Beta Was this translation helpful? Give feedback.
-
This is the repository, I changed it to public: |
Beta Was this translation helpful? Give feedback.
-
Okay was a loop |
Beta Was this translation helpful? Give feedback.
Do you build and push the app container on commits to main?