Ive added basic-auth annotation to nginx ingress to require login password.
It worked well, but every time i change a page it keep requesting the password. I can click cancel and it let me continue, but it is rather annoying.
Here is the full ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/auth-realm: Authentication Required
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
name: ui-portal
namespace: dev
spec:
ingressClassName: nginx-open
rules:
- host: some-host.co
http:
paths:
- backend:
service:
name: ui-portal
port:
number: 8998
path: /
pathType: Prefix
tls:
- hosts:
- some-host.co
secretName: secret
Interesting point: it only happened in chrome, not firefox…