0

I work in Kubernetes and I have an app I can access with a K8S service and ingress traefik with the following yaml script:

---
apiVersion: v1
kind: Secret
metadata:
  name: whoami-login
  namespace: XXX
data:
  users: XXX       # Had it with: htpasswd -nb XX XX| base64
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: whoami-login
  namespace: XXX
spec:
  basicAuth:
    secret: whoami-login
    removeHeader: true
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: login
  namespace: XXX
spec:
  entryPoints:
    - websecure
  routes:
  - match: Host(`testnifi.com`)  && Pathprefix(`/nifi`)
    kind: Rule
    services:
    - name: nifi
      port: 8080
    middlewares:
    - name: whoami-login
  tls: {}

The url is working well and I have a popup asking me to enter a login and password. When I open the link or refresh the page it doesn't ask me to login again. How can I do to achieve it ? To being asked to login everytime when I refresh the url or open the url on other tab ?

lbened
  • 65
  • 6

0 Answers0