argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18k stars 5.48k forks source link

Argocd behind nginx oidc not working #20867

Open onkar6699 opened 1 day ago

onkar6699 commented 1 day ago

I have started argocd behind nginx data: url: https://argocd.example.com

nignx conf server { listen 80; server_name argo.example.com;

location / {
    proxy_pass http://argocd-server.default.svc.cluster.local:80;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

}

what url should i provide ? under data? public facing URL?

onkar6699 commented 1 day ago

@cardoe @farcaller @ncdc @gpaul can someone please help me?

andrii-korotkov-verkada commented 1 day ago

Can you provide more details about where is this url configured and how does nginx config used, please? Also, what's the argocd server version?

onkar6699 commented 1 day ago

@andrii-korotkov-verkada please find below config I have nginx and proxy pass to argocd-server.argpcd.svc.cluster.local service

I have added nginx url in both argocd conf and IDP redirect url but still getting error

onkar6699 commented 1 day ago

argocd: v2.12.6+4dab5bd BuildDate: 2024-10-18T17:39:26Z GitCommit: https://github.com/argoproj/argo-cd/commit/4dab5bd6a60adea12e084ad23519e35b710060a2 GitTreeState: clean GoVersion: go1.22.4 Compiler: gc Platform: linux/amd64

andrii-korotkov-verkada commented 1 day ago

Is there anything useful in the logs with debug level enabled? Note that you may need to configure it differently for dex comparing to other containers.

onkar6699 commented 1 day ago

I have enabled debug but it's not reflecting still able to see only info log

onkar6699 commented 1 day ago

Should I try with previous version what you suggest? Similar conf grafana worked but argocd failing

andrii-korotkov-verkada commented 1 day ago

For dex you need something like

  dex.config: |
    logger:
      level: debug
      format: json
...

in argocd-cm. Can you share your argocd-cm, please? (Feel free to mock sensitive values of course)

andrii-korotkov-verkada commented 1 day ago

I'll try with v2.13.1 as well if it's not too much hassle.

onkar6699 commented 1 day ago

Not using Dex without Dex I am doing As per this PR https://github.com/argoproj/argo-cd/pull/4780 y error exact match with this PR why this change made idk

andrii-korotkov-verkada commented 1 day ago

Try setting this

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-cmd-params-cm
data:
  applicationsetcontroller.log.level: debug
  applicationsetcontroller.log.format: json
  controller.log.level: debug
  controller.log.format: json
  notificationscontroller.log.level: debug
  notificationscontroller.log.format: json
  reposerver.log.level: debug
  reposerver.log.format: json
  server.log.level: debug
  server.log.format: json
  ...
onkar6699 commented 1 day ago

For dex you need something like

  dex.config: |
    logger:
      level: debug
      format: json
...

in argocd-cm. Can you share your argocd-cm, please? (Feel free to mock sensitive values of course)

ArgoCD OIDC Config url: https://argocd.example.com/ (nginx exposed app) oidc.config: | name: MYIDP issuer: myissuerURL clientID: 0oa9abcdefgh123AB5d7 clientSecret: ABCDEFG1234567890abcdefg requestedScopes: ["openid", "profile", "email", "groups"] requestedIDTokenClaims: {"groups": {"essential": true}}

onkar6699 commented 1 day ago

@andrii-korotkov-verkada I have tried to start server log in debug mode nothing reflected as explained here https://github.com/argoproj/argo-cd/issues/17577 using 3rd party log which is not respecting our sent value always starting in info

andrii-korotkov-verkada commented 1 day ago

You can try --gloglevel N as parameter to the container args, some libs use that.

onkar6699 commented 1 day ago

containers:

onkar6699 commented 1 day ago

@andrii-korotkov-verkada also can you suggest me one stable app version of argocd so i can try loglevel as well as oidc conf

andrii-korotkov-verkada commented 1 day ago

It would be

- "--gloglevel"
- "6"

You can change verbosity level from 1 to large values, but it can get spammy.

andrii-korotkov-verkada commented 1 day ago

I recommend v2.13.1

onkar6699 commented 1 day ago

I have updated 2.13.1 but still same issue with log