dynatrace-oss / progressiveDelivery-masterclass

Apache License 2.0
4 stars 11 forks source link

argocd ingress too many redirects #21

Closed agardnerIT closed 1 year ago

agardnerIT commented 1 year ago
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd
  namespace: argocd
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  ingressClassName: nginx
  rules:
  - host: argocd.127.0.0.1.nip.io
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              number: 80

Now that #20 is solved, navigating to http://argocd.127.0.0.1.nip.io results in a too many redirects error.

Adding nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" gets us to the login page but then logging in redirects endlessly back to login.

This set of annotation magic (gleaned through trial and error from this page) seems to work correctly:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd
  namespace: argocd
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: argocd.127.0.0.1.nip.io
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              number: 80