Skip to content

Commit 788b201

Browse files
committed
feat(ImageUpdater): Provide option in Argo CD CR to enable/disable image updater
Signed-off-by: Denis Karpelevich <[email protected]>
1 parent dfdd7f8 commit 788b201

28 files changed

+3559
-214
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ fmt: ## Run go fmt against code.
101101
vet: ## Run go vet against code.
102102
go vet ./...
103103

104+
get-image-updater-crd: ## Download Image Updater CRD.
105+
@echo "downloading image updater crd"
106+
@curl -sSLo config/crd/bases/argocd-image-updater.argoproj.io_imageupdaters.yaml https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/crd/config/crd/bases/argocd-image-updater.argoproj.io_imageupdaters.yaml
107+
104108

105109
# Exclude E2E tests from the list of unit test packages
106110
UNIT_TEST_PACKAGES := $(shell go list ./... | grep -E -v '/tests/ginkgo')

api/v1beta1/argocd_types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,18 @@ type ArgoCDHASpec struct {
325325
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
326326
}
327327

328+
// ArgoCDImageUpdaterSpec defines whether the Argo CD Image Updater controller should be installed.
329+
type ArgoCDImageUpdaterSpec struct {
330+
// Enabled defines whether argocd image updater controller should be deployed or not
331+
Enabled bool `json:"enabled"`
332+
333+
// Env let you specify environment variables for ImageUpdater pods
334+
Env []corev1.EnvVar `json:"env,omitempty"`
335+
336+
// Resources defines the Compute Resources required by the container for Argo CD Image Updater.
337+
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
338+
}
339+
328340
// ArgoCDImportSpec defines the desired state for the ArgoCD import/restore process.
329341
type ArgoCDImportSpec struct {
330342
// Name of an ArgoCDExport from which to import data.
@@ -885,6 +897,9 @@ type ArgoCDSpec struct {
885897
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Image",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:fieldGroup:ArgoCD","urn:alm:descriptor:com.tectonic.ui:text"}
886898
Image string `json:"image,omitempty"`
887899

900+
// ImageUpdater defines whether the Argo CD ImageUpdater controller should be installed.
901+
ImageUpdater ArgoCDImageUpdaterSpec `json:"imageUpdater,omitempty"`
902+
888903
// Import is the import/restore options for ArgoCD.
889904
Import *ArgoCDImportSpec `json:"import,omitempty"`
890905

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/argocd-image-updater.argoproj.io_imageupdaters.yaml

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

bundle/manifests/argocd-operator.clusterserviceversion.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ metadata:
257257
capabilities: Deep Insights
258258
categories: Integration & Delivery
259259
certified: "false"
260-
createdAt: "2025-08-28T14:32:44Z"
260+
createdAt: "2025-10-06T18:15:27Z"
261261
description: Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.
262262
operators.operatorframework.io/builder: operator-sdk-v1.35.0
263263
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
@@ -1565,6 +1565,9 @@ spec:
15651565
x-descriptors:
15661566
- urn:alm:descriptor:com.tectonic.ui:text
15671567
version: v1beta1
1568+
- kind: ImageUpdater
1569+
name: imageupdaters.argocd-image-updater.argoproj.io
1570+
version: v1alpha1
15681571
- description: NamespaceManagement is the Schema for the namespacemanagements
15691572
API
15701573
displayName: Namespace Management
@@ -1767,6 +1770,13 @@ spec:
17671770
- deployments/finalizers
17681771
verbs:
17691772
- update
1773+
- apiGroups:
1774+
- argocd-image-updater.argoproj.io
1775+
resources:
1776+
- imageupdaters
1777+
- imageupdaters/finalizers
1778+
verbs:
1779+
- '*'
17701780
- apiGroups:
17711781
- argoproj.io
17721782
resources:

bundle/manifests/argoproj.io_argocds.yaml

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16064,6 +16064,198 @@ spec:
1606416064
image:
1606516065
description: Image is the ArgoCD container image for all ArgoCD components.
1606616066
type: string
16067+
imageUpdater:
16068+
description: ImageUpdater defines whether the Argo CD ImageUpdater
16069+
controller should be installed.
16070+
properties:
16071+
enabled:
16072+
description: Enabled defines whether argocd image updater controller
16073+
should be deployed or not
16074+
type: boolean
16075+
env:
16076+
description: Env let you specify environment variables for ImageUpdater
16077+
pods
16078+
items:
16079+
description: EnvVar represents an environment variable present
16080+
in a Container.
16081+
properties:
16082+
name:
16083+
description: Name of the environment variable. Must be a
16084+
C_IDENTIFIER.
16085+
type: string
16086+
value:
16087+
description: |-
16088+
Variable references $(VAR_NAME) are expanded
16089+
using the previously defined environment variables in the container and
16090+
any service environment variables. If a variable cannot be resolved,
16091+
the reference in the input string will be unchanged. Double $$ are reduced
16092+
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
16093+
"$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
16094+
Escaped references will never be expanded, regardless of whether the variable
16095+
exists or not.
16096+
Defaults to "".
16097+
type: string
16098+
valueFrom:
16099+
description: Source for the environment variable's value.
16100+
Cannot be used if value is not empty.
16101+
properties:
16102+
configMapKeyRef:
16103+
description: Selects a key of a ConfigMap.
16104+
properties:
16105+
key:
16106+
description: The key to select.
16107+
type: string
16108+
name:
16109+
default: ""
16110+
description: |-
16111+
Name of the referent.
16112+
This field is effectively required, but due to backwards compatibility is
16113+
allowed to be empty. Instances of this type with an empty value here are
16114+
almost certainly wrong.
16115+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
16116+
type: string
16117+
optional:
16118+
description: Specify whether the ConfigMap or its
16119+
key must be defined
16120+
type: boolean
16121+
required:
16122+
- key
16123+
type: object
16124+
x-kubernetes-map-type: atomic
16125+
fieldRef:
16126+
description: |-
16127+
Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
16128+
spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
16129+
properties:
16130+
apiVersion:
16131+
description: Version of the schema the FieldPath
16132+
is written in terms of, defaults to "v1".
16133+
type: string
16134+
fieldPath:
16135+
description: Path of the field to select in the
16136+
specified API version.
16137+
type: string
16138+
required:
16139+
- fieldPath
16140+
type: object
16141+
x-kubernetes-map-type: atomic
16142+
resourceFieldRef:
16143+
description: |-
16144+
Selects a resource of the container: only resources limits and requests
16145+
(limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
16146+
properties:
16147+
containerName:
16148+
description: 'Container name: required for volumes,
16149+
optional for env vars'
16150+
type: string
16151+
divisor:
16152+
anyOf:
16153+
- type: integer
16154+
- type: string
16155+
description: Specifies the output format of the
16156+
exposed resources, defaults to "1"
16157+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
16158+
x-kubernetes-int-or-string: true
16159+
resource:
16160+
description: 'Required: resource to select'
16161+
type: string
16162+
required:
16163+
- resource
16164+
type: object
16165+
x-kubernetes-map-type: atomic
16166+
secretKeyRef:
16167+
description: Selects a key of a secret in the pod's
16168+
namespace
16169+
properties:
16170+
key:
16171+
description: The key of the secret to select from. Must
16172+
be a valid secret key.
16173+
type: string
16174+
name:
16175+
default: ""
16176+
description: |-
16177+
Name of the referent.
16178+
This field is effectively required, but due to backwards compatibility is
16179+
allowed to be empty. Instances of this type with an empty value here are
16180+
almost certainly wrong.
16181+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
16182+
type: string
16183+
optional:
16184+
description: Specify whether the Secret or its key
16185+
must be defined
16186+
type: boolean
16187+
required:
16188+
- key
16189+
type: object
16190+
x-kubernetes-map-type: atomic
16191+
type: object
16192+
required:
16193+
- name
16194+
type: object
16195+
type: array
16196+
resources:
16197+
description: Resources defines the Compute Resources required
16198+
by the container for Argo CD Image Updater.
16199+
properties:
16200+
claims:
16201+
description: |-
16202+
Claims lists the names of resources, defined in spec.resourceClaims,
16203+
that are used by this container.
16204+
16205+
This is an alpha field and requires enabling the
16206+
DynamicResourceAllocation feature gate.
16207+
16208+
This field is immutable. It can only be set for containers.
16209+
items:
16210+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
16211+
properties:
16212+
name:
16213+
description: |-
16214+
Name must match the name of one entry in pod.spec.resourceClaims of
16215+
the Pod where this field is used. It makes that resource available
16216+
inside a container.
16217+
type: string
16218+
request:
16219+
description: |-
16220+
Request is the name chosen for a request in the referenced claim.
16221+
If empty, everything from the claim is made available, otherwise
16222+
only the result of this request.
16223+
type: string
16224+
required:
16225+
- name
16226+
type: object
16227+
type: array
16228+
x-kubernetes-list-map-keys:
16229+
- name
16230+
x-kubernetes-list-type: map
16231+
limits:
16232+
additionalProperties:
16233+
anyOf:
16234+
- type: integer
16235+
- type: string
16236+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
16237+
x-kubernetes-int-or-string: true
16238+
description: |-
16239+
Limits describes the maximum amount of compute resources allowed.
16240+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
16241+
type: object
16242+
requests:
16243+
additionalProperties:
16244+
anyOf:
16245+
- type: integer
16246+
- type: string
16247+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
16248+
x-kubernetes-int-or-string: true
16249+
description: |-
16250+
Requests describes the minimum amount of compute resources required.
16251+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
16252+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
16253+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
16254+
type: object
16255+
type: object
16256+
required:
16257+
- enabled
16258+
type: object
1606716259
import:
1606816260
description: Import is the import/restore options for ArgoCD.
1606916261
properties:

cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ import (
5757
"sigs.k8s.io/controller-runtime/pkg/healthz"
5858
"sigs.k8s.io/controller-runtime/pkg/log/zap"
5959

60+
imageupdaterv1alpha1 "github.com/argoproj-labs/argocd-image-updater/api/v1alpha1"
61+
6062
v1alpha1 "github.com/argoproj-labs/argocd-operator/api/v1alpha1"
6163
v1beta1 "github.com/argoproj-labs/argocd-operator/api/v1beta1"
6264
"github.com/argoproj-labs/argocd-operator/version"
@@ -73,6 +75,7 @@ func init() {
7375

7476
utilruntime.Must(v1alpha1.AddToScheme(scheme))
7577
utilruntime.Must(v1beta1.AddToScheme(scheme))
78+
utilruntime.Must(imageupdaterv1alpha1.AddToScheme(scheme))
7679
//+kubebuilder:scaffold:scheme
7780
}
7881

common/defaults.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ vs-ssh.visualstudio.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7Hr1oTWqNqOlzGJOf
289289

290290
// ArgoCDAgentPrincipalDefaultImageName is the default image name for the ArgoCD agent principal.
291291
ArgoCDAgentPrincipalDefaultImageName = "quay.io/argoprojlabs/argocd-agent:v0.3.2"
292+
293+
// ArgoCDImageUpdaterControllerComponent is the name of the Image Updater controller control plane component
294+
ArgoCDImageUpdaterControllerComponent = "argocd-image-updater-controller"
292295
)
293296

294297
// DefaultLabels returns the default set of labels for controllers.

common/keys.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,8 @@ const (
238238
// ALLOW_NAMESPACE_MANAGEMENT_IN_NAMESPACE_SCOPED_INSTANCES is an environment variable that controls whether
239239
// the Namespace Management feature is enabled.
240240
EnableManagedNamespace = "ALLOW_NAMESPACE_MANAGEMENT_IN_NAMESPACE_SCOPED_INSTANCES"
241+
242+
// ArgoCDImageUpdaterImageEnvName is the environment variable used to get the image
243+
// to used for the Image Updater container.
244+
ArgoCDImageUpdaterImageEnvName = "ARGOCD_IMAGE_UPDATER_IMAGE"
241245
)

0 commit comments

Comments
 (0)