I have an issue and I'm looking for more general answer approach or strategy. I have flux with HelmRelease that points to oct container registry. The chart stays static and has one deployment with image set to develop tag.
My setup pulls the image when I trigger chart version change, but I don't want to change the chart ver on each build(as chart hasn't changed), but rather have either flux or implement strategy that pulls a new image when the image digest differs from the one currently deployed.
My pipeline builds a new image every time there are changes to develop branch and adds new image to CR with develop tag.
So, again what I have is a deployment that is statically using an image reference with develop tag, but when image digest changes it is not pulled until I change chart version. Has anyone worked this out or faced similar situation?
These are my flux specs:
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: nchart-repository
namespace: flux-system
spec:
interval: 1m0s
url: oci://gitttt.asd.com:5050/company/assets/asd/chart
type: oci
secretRef:
name: temp-credz
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: niccom-dev
namespace: flux-system
spec:
chart:
spec:
chart: ncom-chart
sourceRef:
kind: HelmRepository
name: nchart-repository
version: 0.1.6
valuesFiles:
- values-dev.yaml
reconcileStrategy: Revision
interval: 2m
timeout: 1m
driftDetection:
mode: enabled
My chart I published to CR oci://gitttt.asd.com:5050/company/assets/asd/chart/ncom-chart:0.1.6
which contains a deployment with snippet of
containers:
- name: {{ .Values.www.name }}
image: "{{ .Values.base_repo.path }}{{ .Values.www.www_container_repository }}:{{ .Values.www.www_container_tag }}"
and after install through helm generates image value of gitttt.asd.com:5050/company/assets/xyz/www:develop
As I mentioned above it all works when I bump chart ver to 0.1.7 etc., but what I want is to keep chart static pointed to develop tag and just build an image.
1- Utilize Kubernetes ImagePullPolicy:
2- Update the Image Digest in HelmRelease:
3- Flux Image Update Automation: