argocd-image-updater icon indicating copy to clipboard operation
argocd-image-updater copied to clipboard

servicemonitor and argocd-image-updater service is not made by default

Open yasharne opened this issue 2 years ago • 1 comments

Describe the bug I have installed argocd-image-updater based on this documents (first method): https://argocd-image-updater.readthedocs.io/en/stable/install/installation/#method-1-installing-as-kubernetes-workload-in-argo-cd-namespace But as metrics part says, there should be a services called argocd-image-updater which exposes metrics port but there are no service created with this method:

 kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/stable/manifests/install.yaml
serviceaccount/argocd-image-updater unchanged
role.rbac.authorization.k8s.io/argocd-image-updater unchanged
rolebinding.rbac.authorization.k8s.io/argocd-image-updater unchanged
configmap/argocd-image-updater-config unchanged
configmap/argocd-image-updater-ssh-config unchanged
secret/argocd-image-updater-secret unchanged
deployment.apps/argocd-image-updater unchanged

To Reproduce Steps to reproduce the behavior: install with this command:

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/stable/manifests/install.yaml

Expected behavior create the service

Additional context Add any other context about the problem here.

Version v0.12.0

Logs Please paste any relevant logs here

yasharne avatar Oct 12 '23 21:10 yasharne

Having the same issue.

For now, I managed to monitor the metrics by kustomizing the deployment to add the argument --metrics-port=8081 to the container.

Then, I added a service with port 8081 named metrics with a selector to point to the pod:

apiVersion: v1
kind: Service
metadata:
  name: argocd-image-updater
  labels:
    app.kubernetes.io/name: argocd-image-updater
spec:
  selector:
    app.kubernetes.io/name: argocd-image-updater
  ports:
    - protocol: TCP
      port: 8081
      name: metrics

The patch file is as follows (probably can be more concise):

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: argocd-image-updater
    app.kubernetes.io/part-of: argocd-image-updater
  name: argocd-image-updater
spec:
  template:
    spec:
      containers:
      - command:
        - /usr/local/bin/argocd-image-updater
        - run
        - --metrics-port=8081
        env:
        - name: APPLICATIONS_API
          valueFrom:
            configMapKeyRef:
              key: applications_api
              name: argocd-image-updater-config
              optional: true
        - name: ARGOCD_GRPC_WEB
          valueFrom:
            configMapKeyRef:
              key: argocd.grpc_web
              name: argocd-image-updater-config
              optional: true
        - name: ARGOCD_SERVER
          valueFrom:
            configMapKeyRef:
              key: argocd.server_addr
              name: argocd-image-updater-config
              optional: true
        - name: ARGOCD_INSECURE
          valueFrom:
            configMapKeyRef:
              key: argocd.insecure
              name: argocd-image-updater-config
              optional: true
        - name: ARGOCD_PLAINTEXT
          valueFrom:
            configMapKeyRef:
              key: argocd.plaintext
              name: argocd-image-updater-config
              optional: true
        - name: ARGOCD_TOKEN
          valueFrom:
            secretKeyRef:
              key: argocd.token
              name: argocd-image-updater-secret
              optional: true
        - name: IMAGE_UPDATER_LOGLEVEL
          valueFrom:
            configMapKeyRef:
              key: log.level
              name: argocd-image-updater-config
              optional: true
        - name: GIT_COMMIT_USER
          valueFrom:
            configMapKeyRef:
              key: git.user
              name: argocd-image-updater-config
              optional: true
        - name: GIT_COMMIT_EMAIL
          valueFrom:
            configMapKeyRef:
              key: git.email
              name: argocd-image-updater-config
              optional: true
        - name: IMAGE_UPDATER_KUBE_EVENTS
          valueFrom:
            configMapKeyRef:
              key: kube.events
              name: argocd-image-updater-config
              optional: true
        image: quay.io/argoprojlabs/argocd-image-updater:v0.12.0
        imagePullPolicy: Always
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 30
        name: argocd-image-updater
        ports:
        - containerPort: 8080
        readinessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 30
        volumeMounts:
        - mountPath: /app/config
          name: image-updater-conf
        - mountPath: /app/config/ssh
          name: ssh-known-hosts
        - mountPath: /app/.ssh
          name: ssh-config

tglanz avatar Oct 22 '23 18:10 tglanz