Disable external authentication on Kubernetes Ingress

Viewed 123

I run a bare-metal Kubernetes cluster and want to map services onto URLs instead of ports (I used NodePort so far).

To achieve this I tried to install an IngressController to be able to deploy Ingress objects containing routing.

I installed the IngressController via helm:

helm install my-ingress helm install my-ingress stable/nginx-ingress

and the deployment worked fine so far. To just use the node's domain name, I enabled hostNetwork: true in the nginx-ingress-controller.

Then, I created an Ingress deployment with this definition:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 80

which also deployed fine. Finally, when I try to access http://my-url.com/testpath I get a login-prompt. I nowhere set up login-credentials nor do I intend to do so as the services should be publicly available and/or handle authentication on their own.

How do I disable this behavior? I want to access the services just as I would use a NodePort solution.

1 Answers

To clarify the case I am posting answer (from comments area) as Community Wiki.

The problem here was not in configuration but in environment - there was running another ingress in the pod during Longhorn' deployment. This situation led to force basic authentication to both ones.

To resolve that problem it was necessary to to clean up all deployments.

Related