Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification log format and level are not configurable via ArgoCD params. #3010

Open
chatelain-io opened this issue Nov 6, 2024 · 2 comments
Labels
argo-cd bug Something isn't working

Comments

@chatelain-io
Copy link

Describe the bug

In the documentation, https://argo-cd.readthedocs.io/en/latest/operator-manual/argocd-cmd-params-cm-yaml/
it says that you can configure the notification controller via the ArgoCD params ConfigMap.

## Argo CD Notifications Controller Properties
# Set the logging level. One of: debug|info|warn|error (default "info")
notificationscontroller.log.level: "info"
# Set the logging format. One of: text|json (default "text")
notificationscontroller.log.format: "text"

The Helm chart do set the environment variables:

  env:
    - name: ARGOCD_NOTIFICATIONS_CONTROLLER_LOGLEVEL
      valueFrom:
        configMapKeyRef:
          key: notificationscontroller.log.level
          name: argocd-cmd-params-cm
          optional: true
    - name: ARGOCD_NOTIFICATIONS_CONTROLLER_LOGFORMAT
      valueFrom:
        configMapKeyRef:
          key: notificationscontroller.log.format
          name: argocd-cmd-params-cm
          optional: true

The issue is that the Helm chart set these variables in the container arguments, which override the environment variables.

# charts/argo-cd/templates/argocd-notifications/deployment.yaml
      containers:
        - name: {{ .Values.notifications.name }}
          image: {{ default .Values.global.image.repository .Values.notifications.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.notifications.image.tag }}
          imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.notifications.image.imagePullPolicy }}
          args:
            - /usr/local/bin/argocd-notifications
            - --metrics-port={{ .Values.notifications.containerPorts.metrics }}
            - --loglevel={{ default .Values.global.logging.level .Values.notifications.logLevel }}
            - --logformat={{ default .Values.global.logging.format .Values.notifications.logFormat }}
            - --namespace={{ include "argo-cd.namespace" . }}
            - --argocd-repo-server={{ template "argo-cd.repoServer.fullname" . }}:{{ .Values.repoServer.service.port }}
            - --secret-name={{ .Values.notifications.secret.name }}
            {{- range .Values.notifications.extraArgs }}
            - {{ . | squote }}
            {{- end }}

Related helm chart

argo-cd

Helm chart version

7.2.0, latest

To Reproduce

# values.yaml
configs:
  params:
    notificationscontroller.log.format: "json"
    notificationscontroller.log.level: "warn"
helm upgrade argocd argo/argocd --install --namespace=argocd --values values.yaml 

Expected behavior

The Helm chart should drop the configuration via the container arguments.

Screenshots

No response

Additional context

No response

@chatelain-io chatelain-io added the bug Something isn't working label Nov 6, 2024
@onkar6699
Copy link

Even with server same issue i am facing log not getting reflected

@onkar6699
Copy link

Even if you set in in deployment --loglevel=debug it wont reflect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
argo-cd bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants