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

ERR_TOO_MANY_REDIRECTS #2953

Closed
wiliiwin opened this issue Jan 9, 2020 · 46 comments
Closed

ERR_TOO_MANY_REDIRECTS #2953

wiliiwin opened this issue Jan 9, 2020 · 46 comments
Labels
component:cli Affects the Argo CD CLI

Comments

@wiliiwin
Copy link

wiliiwin commented Jan 9, 2020

The following configuration was performed according to the official documentation(https://argoproj.github.io/argo-cd/getting_started/):

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: argocd-server-ingress
annotations:
kubernetes.io/ingress.class: crs-nginx
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
rules:

  • host: argocd.gril.com
    http:
    paths:
    • backend:
      serviceName: argocd-server
      servicePort: 443

now,encounter a redirect loop or are getting a 307 response code.So I added nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" according to the official documentation to the configuration above.

The web page can be opened normally,But I got the following error during argocd login command

FATA[0008] rpc error: code = Internal desc = transport: received the unexpected content-type "text/plain; charset=utf-8"

I don't know how to configure it to open the page normally and the argocd login command can log in normally.

@wiliiwin wiliiwin added the bug Something isn't working label Jan 9, 2020
@boukandouramhamed
Copy link

Same problem, any workaround ?

@otani88
Copy link

otani88 commented Mar 11, 2020

Same problem!

@leandro-manifesto
Copy link

After searching for a while I found a solution that works in my case.
I'm using Traefik instead of Nginx, but I believe this can be used with any ingress controller.

The problem is that by default Argo-CD handles TLS termination itself and always redirects HTTP requests to HTTPS. Combine that with an ingress controller that also handles TLS termination and always communicates with the backend service with HTTP and you get Argo-CD's server always responding with a redirects to HTTPS.

So one of the solutions would be to disable HTTPS on Argo-CD, which you can do by using the --insecure flag on argocd-server.

This is actually documented here:
https://argoproj.github.io/argo-cd/operator-manual/ingress/#option-2-multiple-ingress-objects-and-hosts
Its just not exactly obvious.

It would be nice if there was a page with command line flags for the server somewhere in the docs.

@alexmt alexmt added documentation and removed bug Something isn't working labels May 11, 2020
@jannfis jannfis added component:cli Affects the Argo CD CLI type:docs labels May 14, 2020
@georgepaoli
Copy link

georgepaoli commented Jun 12, 2020

Using NGINX ingress, send --insecure arg for container of argocd-server Deployment. It works for me.

spec:
  containers:
  - command:
    - argocd-server
    - --staticassets
    - /shared/app
    - --insecure

Help: https://argoproj.github.io/argo-cd/operator-manual/ingress/

@chrkaatz
Copy link

Somehow I ran into the same issue with a 308 redirect. I added the --insecure arg but no change so far. Any ideas?

@brianlmoon
Copy link

Nginx and other reverse proxies send the header X-Forwarded-Proto to indicate that TLS is being handled by the proxy. This could be checked in addition to checking the secure setting in the useSecure function. I have yet to venture into writing Go, so I am not sure of how that is done exactly. Maybe I will give it a shot.

@abdennour
Copy link

abdennour commented Sep 20, 2020

For my case, i have AWS ELB where the SSL is offloaded, then ingress controller receives on port 80, then forward to argocd-server service on insecure port (80).

I fixed the issue of too-many-redirects by implementing the above solution:

spec:
  containers:
  - command:
    - argocd-server
    - --staticassets
    - /shared/app
    - --insecure # <-- this thing needs to be added

@delucca
Copy link

delucca commented Oct 16, 2020

I was struggling with this issue for ours, and finally found this thread.

@georgepaoli suggesiton worked. Adding --insecure fixed the issue. I suggest adding this to Argo's Traefik docs while the issue persists.

@corestackdev
Copy link

Spent half a day with ingress settings only to figure out this small piece of information missing. Thanks @leandro-manifesto

@ams0
Copy link

ams0 commented Oct 16, 2020

Thanks for this, I wrote a little patch here and the IngressRoute CRD I use here. I wrote an article about all of this and more here.

@nandeeshb09
Copy link

@leandro-manifesto ,

Is it safer to use in production also? --insecure?

@leandro-manifesto
Copy link

Its not ideal, but it works.
The Ingress resource already handles TLS termination before reaching ArgoCD and if the nodes aren't publicly accessible there shouldn't be problems afaik.

@wlawton
Copy link

wlawton commented Jun 8, 2021

I'm using 'Option 2: Multiple Ingress Objects And Hosts' as per the argocd ingress documentation for nginx ingress.

I was still getting a 308 response back from nginx-ingress-controller even after setting the argocd-server insecure flag. nginx logged:

W0608 15:05:42.385812 6 controller.go:1206] Unexpected error validating SSL certificate "argocd/argocd-secret" for server "argocd-ui.x.x.com": x509: certificate is valid for localhost, argocd-server, argocd-server.argocd, argocd-server.argocd.svc, argocd-server.argocd.svc.cluster.local, not argocd-ui.x.x.com

...where argocd-ui.x.x.com (redacted) is the dns name i chose for the aws nlb in front of nginx.
I removed the tls section of the argocd ingress yaml completely i.e.

  tls:
  - hosts:
    - argocd-ui.x.x.com 
     secretName: argocd-secret # do not change, this is provided by Argo CD

And following this I could access the UI using argocd-ui.x.x.com with no apparent issues. Not sure if I was meant to set argocd-ui.x.x.com as the tls host nor not, but the argocd docs suggest this is what you are meant to do i.e. they use argocd.example.com as their example which isn't in compatible with their default tls.crt either.

@suharevA
Copy link

suharevA commented Jul 19, 2021

cluster rancher
added in container and works
spec:
containers:

  • command:
    • argocd-server
    • --staticassets
    • /shared/app
    • --insecure # <-- this thing needs to be added

@Syntax3rror404
Copy link

i also have this problem

@atrakic
Copy link

atrakic commented Jul 31, 2021

This works for me:

$ NS=argocd
$  kubectl -n "$NS" patch deployment argocd-server --type json \
    -p='[ { "op": "replace", "path":"/spec/template/spec/containers/0/command","value": ["argocd-server","--staticassets","/shared/app","--insecure"] }]

@kxw9298
Copy link

kxw9298 commented Aug 4, 2021

This works for me:

$ NS=argocd
$  kubectl -n "$NS" patch deployment argocd-server --type json \
    -p='[ { "op": "replace", "path":"/spec/template/spec/containers/0/command","value": ["argocd-server","--staticassets","/shared/app","--insecure"] }]

also works with me

@chtime
Copy link

chtime commented Aug 25, 2021

I encountered the same error and found that when installing ArgoCD, one can either add the --insecure flag (as written above) or you can update the ConfigMap to populate the environment variables used by argo-server (only the data object is new):

# [snip]
---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cmd-params-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cmd-params-cm
data:
  server.insecure: "true"
---
# [snip]

Unfortunately you can't apply this after running the installer since it will have no effect on the already deployed service, and applying it before the install will have the install overwrite it.

-- edit: While the install yaml file will overwrite this definition, you can put this in a separate file and apply it after the install yaml and then force a restart of the argocd-server deployment, like so:

  1. Put the contents shown above in a file called e.g. argocd-config.yaml
  2. kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
  3. kubectl apply -n argocd -f argocd-config.yaml
  4. kubectl scale -n argocd deployment/argocd-server --replicas=0 && kubectl scale -n argocd deployment/argocd-server --replicas=1

@penglei
Copy link

penglei commented Sep 6, 2021

I use passthrough mode in my Ingress, but I forget the annotation nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" and it resulted in nginx-ingress-controller generating proxy_pass http://upstream_balancer in the nginx.conf. After I added this annotation, the server stopped responsing 307.

@kszpakowski
Copy link

Following configuration works without further modifications

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-http-ingress
  namespace: argocd
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  rules:
  - http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: argocd-server
            port: 
              name: https
    host: argocd.example.com
  tls:
  - hosts:
    - argocd.example.com
    secretName: argocd-secret

@gsthamu
Copy link

gsthamu commented Jan 23, 2022

I encountered the same error and found that when installing ArgoCD, one can either add the --insecure flag (as written above) or you can update the ConfigMap to populate the environment variables used by argo-server (only the data object is new):

# [snip]
---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cmd-params-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cmd-params-cm
data:
  server.insecure: "true"
---
# [snip]

Unfortunately you can't apply this after running the installer since it will have no effect on the already deployed service, and applying it before the install will have the install overwrite it.

-- edit: While the install yaml file will overwrite this definition, you can put this in a separate file and apply it after the install yaml and then force a restart of the argocd-server deployment, like so:

0. Put the contents shown above in a file called e.g. argocd-config.yaml

1. `kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml`

2. `kubectl apply -n argocd -f argocd-config.yaml`

3. `kubectl scale -n argocd deployment/argocd-server --replicas=0 && kubectl scale -n argocd deployment/argocd-server --replicas=1`
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-http-ingress
  namespace: argocd
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
spec:
  rules:
  - http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: argocd-server
            port: 
              name: http
    host: argocd.example.com
  tls:
  - hosts:
    - argocd.example.com
    secretName: argocd-secret
`
I have changed the above ingress setting. Now, no looping for me

@dadav
Copy link

dadav commented Mar 19, 2022

This fixed my redirection issue on openshift: redhat-developer/gitops-operator#277 (comment)

@wadexu007
Copy link

wadexu007 commented Jul 28, 2022

Fixed via this

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/force-ssl-redirect: "true"
    ingress.kubernetes.io/ssl-redirect: "true"
    kubernetes.io/ingress.class: nginx

    # If you encounter a redirect loop or are getting a 307 response code 
    # then you need to force the nginx ingress to connect to the backend using HTTPS.
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" # argocd backend using HTTPS

@begemotik
Copy link

Nginx and other reverse proxies send the header X-Forwarded-Proto to indicate that TLS is being handled by the proxy. This could be checked in addition to checking the secure setting in the useSecure function. I have yet to venture into writing Go, so I am not sure of how that is done exactly. Maybe I will give it a shot.

Did you have a possibility to implement it?

@robozb
Copy link

robozb commented Oct 7, 2022

Thank you @kszpakowski

Following configuration works without further modifications

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-http-ingress
  namespace: argocd
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  rules:
  - http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: argocd-server
            port: 
              name: https
    host: argocd.example.com
  tls:
  - hosts:
    - argocd.example.com
    secretName: argocd-secret

Beautiful, this worked for me too, the main lines:

nginx.ingress.kubernetes.io/backend-protocol: HTTPS
name: https

@ramesh-m99
Copy link

Thank you @kszpakowski

Following configuration works without further modifications

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-http-ingress
  namespace: argocd
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  rules:
  - http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: argocd-server
            port: 
              name: https
    host: argocd.example.com
  tls:
  - hosts:
    - argocd.example.com
    secretName: argocd-secret

Beautiful, this worked for me too, the main lines:

nginx.ingress.kubernetes.io/backend-protocol: HTTPS name: https

its working thanks

@thatsankur
Copy link

I encountered the same error and found that when installing ArgoCD, one can either add the --insecure flag (as written above) or you can update the ConfigMap to populate the environment variables used by argo-server (only the data object is new):

# [snip]
---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/name: argocd-cmd-params-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cmd-params-cm
data:
  server.insecure: "true"
---
# [snip]

Unfortunately you can't apply this after running the installer since it will have no effect on the already deployed service, and applying it before the install will have the install overwrite it.
-- edit: While the install yaml file will overwrite this definition, you can put this in a separate file and apply it after the install yaml and then force a restart of the argocd-server deployment, like so:

0. Put the contents shown above in a file called e.g. argocd-config.yaml

1. `kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml`

2. `kubectl apply -n argocd -f argocd-config.yaml`

3. `kubectl scale -n argocd deployment/argocd-server --replicas=0 && kubectl scale -n argocd deployment/argocd-server --replicas=1`
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-http-ingress
  namespace: argocd
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
spec:
  rules:
  - http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: argocd-server
            port: 
              name: http
    host: argocd.example.com
  tls:
  - hosts:
    - argocd.example.com
    secretName: argocd-secret
`
I have changed the above ingress setting. Now, no looping for me

These three annotations did the magic for me ! Thanks
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"

@downvoteit
Copy link

downvoteit commented Jan 2, 2023

On a newer version of Bitnami ArgoCD (Helm chart version: argo-cd-4.4.0, application version: 2.5.5) I just run this:

k patch $(k get deployment -l app.kubernetes.io/component=server -oname) --type=json \
  -p='[{
    "op" : "add" ,
    "path" : "/spec/template/spec/containers/0/args/-" ,
    "value" : "--insecure"
  }]'

k get deployment -l app.kubernetes.io/component=server -ojsonpath='{.items[0].spec.template.spec.containers[0].args}' | jq  

@Naradsingh
Copy link

I used this in aanotations and it worked for me

kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"

@aberenshtein
Copy link

aberenshtein commented Feb 3, 2023

After many hours of debugging....
We are running argocd with --insecure and with ingress without special annotations.
Argo is installed with helm on an EKS cluster.
The problem for us was the argocd cli version.
With 2.3.12:
argocd login <domain>:<port> --grpc-web works
WIth 2.5.9:
argocd login <domain>:<port> --grpc-web --skip-test-tls works
This is what saved me #9679

@dev-sareno
Copy link

Using Helm, I managed to set the --insecure flag using the following values (values.yaml)

server:
  ingress:
    enabled: "true"
    ingressClassName: "nginx"
configs:
  params:
    server.insecure: "true"
$ helm install argocd -n argocd argo/argo-cd -f values.yaml

@AximPushpa
Copy link

AximPushpa commented Jun 7, 2023

ERROR: err_too_many_redirects using Nginx ingress

For argocd 2.7.4 version, set server.insecure: "true" in the argocd-cmd-params-cm ConfigMap.

apiVersion: v1
data:
redis.server: argocd-redis-ha-haproxy:6379
server.insecure: "true"

Also edit the env optional value of ARGOCD_SERVER_INSECURE to false in argocd-server deployment.

  • name: ARGOCD_SERVER_INSECURE
    valueFrom:
    configMapKeyRef:
    key: server.insecure
    name: argocd-cmd-params-cm
    optional: false

@VesperDev
Copy link

VesperDev commented Jun 23, 2023

The solution for me
Version ArgoCD: v2.7.6+00c914a.dirty

image

data:
  server.insecure: "true"

@mztnnrt
Copy link

mztnnrt commented Jun 26, 2023

Thanks to all #2953 (comment) , We also resolved this problem.

@VitorNilson
Copy link

I have followed the quickstart of ArgoCD documentation https://argo-cd.readthedocs.io/en/stable/#quick-start

The only difference is that I deployed in argo-cd namespace instead of argocd.

Now, I'm having issues to access this application through my Nginx ingress. It's throwing ERR_TOO_MANY_REDIRECTS on the browser and in the logs of Nginx:

172.71.6.219 - - [05/Jul/2023:23:01:54 +0000] "GET / HTTP/1.1" 308 164 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" 904 0.000 [argo-cd-argocd-server-http] [] - - - - ba62103809faf5da2f9e2661a2c1f50b
172.71.6.219 - - [05/Jul/2023:23:01:54 +0000] "GET / HTTP/1.1" 308 164 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" 904 0.000 [argo-cd-argocd-server-http] [] - - - - 0d05a1f48fdceb5d4c557884c3850074
172.71.6.219 - - [05/Jul/2023:23:01:55 +0000] "GET / HTTP/1.1" 308 164 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" 904 0.000 [argo-cd-argocd-server-http] [] - - - - d724f5d890ce91e713c768db2126d44f
.......... more and more

On the ArgoCD server, I've setted the server.insecure:"true" on argocd-cmd-params-cm.

This is my Ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-ingress
  namespace: argo-cd
  annotations:
    cert-manager.io/issuer: prod-issuer
    cert-manager.io/issuer-kind: OriginIssuer
    cert-manager.io/issuer-group: cert-manager.k8s.cloudflare.com
    nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
spec:
  tls:
  - hosts:
    - '*.my_site.dev'
    secretName: argocd-secret
  ingressClassName: nginx
  rules:
  - host: argocd.my_site.dev
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              name: http

I've tried to set server.insecure:"false" and my Ingress like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-ingress
  namespace: argo-cd
  annotations:
    cert-manager.io/issuer: prod-issuer
    cert-manager.io/issuer-kind: OriginIssuer
    cert-manager.io/issuer-group: cert-manager.k8s.cloudflare.com
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
  tls:
  - hosts:
    - '*.my_site.dev'
    secretName: argocd-secret
  ingressClassName: nginx
  rules:
  - host: argocd.my_site.dev
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              name: https

I've tried even to use another secret to store my TLS given that I'm using cloudflare certificates.

PS: Of course I've deleted the argo-cd-server between the changes on the ConfigMap.

Nothing is working.

Do you guys have any idea how to solve this?

@Erokos
Copy link

Erokos commented Jul 26, 2023

I have a similar case as @abdennour , of a load balancer that terminates TLS and behind it a kubernetes ingress nginx controller that is used for routing. The thing I'm trying to do is use paths e.g. example.com/argocd instead of subdomains such as argocd.example.com to access the server, is this possible?

@kszpakowski
Copy link

kszpakowski commented Jul 26, 2023

Documentation suggests disabling the TLS on the Argo server side using deployment flags - https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#traefik-v22. Personally I don't think this is a good idea to use the server without the encryption, as you could get sensitive data by running tcpdump, or am I missing something?

@zeyad-sitech
Copy link

Helm Deployment [Nginx Ingress]

I struggled with this issue for 3 days, the only thing worked for me was the following:

  1. Change the following in values.yaml
server.insecure: false  -> server.insecure: true
  1. Make sure to use the following annotations:
  ingress:
    # -- Enable an ingress resource for the Argo CD server
    enabled: true
    # -- Additional ingress annotations
    annotations:
      nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
      nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
    # -- Additional ingress labels
    labels: {}
    # -- Defines which ingress controller will implement the resource
    ingressClassName: "nginx"

    # -- List of ingress hosts
    ## Argo Ingress.
    ## Hostnames must be provided if Ingress is enabled.
    ## Secrets must be manually created in the namespace
    hosts:
       - argocd.example.com

    # -- List of ingress paths
    paths:
      - /
    # -- Ingress path type. One of `Exact`, `Prefix` or `ImplementationSpecific`
    pathType: Prefix
    # -- Additional ingress paths
    extraPaths: []
      # - path: /*
      #   pathType: Prefix
      #   backend:
      #     service:
      #       name: ssl-redirect
      #       port:
      #         name: use-annotation

    # -- Ingress TLS configuration
    tls:
      - secretName: <Secret>
        hosts:
          - argocd.example.com

    # -- Uses 'server.service.servicePortHttps' instead 'server.service.servicePortHttp'
    https: false

@cmoulliard
Copy link

I succeeded on a kind cluster where ingress nginx controller is deployed using this values.yml config

server:
  ingress:
    # -- Enable an ingress resource for the Argo CD server
    enabled: true
    # -- Additional ingress annotations
    annotations:
      nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
      nginx.ingress.kubernetes.io/ssl-passthrough: "true"
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

    # -- Defines which ingress controller will implement the resource
    ingressClassName: "nginx"

    # -- List of ingress hosts
    hosts:
      - argocd-ui.127.0.0.1.nip.io

    # -- Ingress TLS configuration
    #tls:
    #  - secretName: argocd-secret
    #    hosts:
    #    - argocd-ui.127.0.0.1.nip.io

    # -- Uses 'server.service.servicePortHttps' instead 'server.service.servicePortHttp'
    https: true

and

helm install argocd argo/argo-cd -n argocd --create-namespace=true -f values.yml

@christianh814
Copy link
Member

I believe the original issue was solved by @kszpakowski's post #issuecomment-93219085. It's also documented. Therefore I'm closing this issue.

Please open another issue or ping us on Slack if you are still experiencing issues.

@vikas027
Copy link

On v2.9.3, this worked for me with an nginx controller

k patch $(k get deployment -l app.kubernetes.io/component=server -oname) --type=json \
  -p='[{
    "op" : "add" ,
    "path" : "/spec/template/spec/containers/0/args/-" ,
    "value" : "--insecure"
  }]'
---
# NOTE: I did not had to use any special annotatations
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd
  namespace: argocd
spec:
  ingressClassName: nginx
  rules:
    - host: argocd.example.com
      http:
        paths:
          - backend:
              service:
                name: argocd-server
                port:
                  name: http
            path: /
            pathType: Prefix

@bloomingFlower
Copy link

Thanks to this thread, I was able to resolve it well. it's also necessary in Istio.

@gabriel-suela
Copy link

fixed this issue adding nginx.ingress.kubernetes.io/rewrite-target: / to the ingress annotations.

@cooervo
Copy link

cooervo commented May 22, 2024

just adding in values yaml of argocd helm chart fixed it for me

configs:
  params:
    server.insecure: "true"

then I ran kubectl -n argocd rollout restart deploy to restart all deployments in argocd namespace and it works 👍🏽

I'm using istio-ingressgateway and GCP load balancer in case someone else stuck with this bug

@escummy
Copy link

escummy commented Jun 11, 2024

I was exploring solutions to set the --insecure flag to true for the deployment and configmap files mentioned above. However, with the current ArgoCD Helm chart and newer versions, the configuration has slightly changed:

  • The server.insecure option is already set to true in the deployment YAML file.
kubectl get deployment argo-cd-argocd-server -n argocd -o yaml

deployment-argocd

  • So you need simply apply this true value in the configmap new location file as below (by default it is set to false )
kubectl get configmap argocd-cmd-params-cm -n argocd -o yaml

cinfigmap-argocd

  • Finally, use a rollout to restart deployment and your ingress should work properly.
kubectl rollout restart deployment argo-cd-argocd-server -n argocd

I hope this helps!

@dmuiX
Copy link

dmuiX commented Jun 27, 2024

Stumbling into 307 with a gateway-api tlsroute. Is there some possible way to solve this?
Already enabled server.insecure: "true" and passthrough in gateway is enabled as well...

okay this is interesting. Its working fine now^^.
Maybe I just needed to wait a while. Sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:cli Affects the Argo CD CLI
Projects
None yet
Development

No branches or pull requests