Kuberntes nginx ingress suddenly requires basic auth to access path

I am trying to deploy a K8S application locally and have a:

Frontend container (nginx listening on port 80, proxying requests to my back service).
Backend container (.NET listening on 5194/HTTP)
Also have a DB and a Redis cache.

My application currently works locally and I can access everything fine, the issue is that I am currently using NodePorts, and would like to use an NGINX Ingress Controller to handle traffic and routing to my Kubernetes services.

The issue is that suddenly when I try to access my application using the Domain name I set in my hosts file, it asks for basic authentication and I have no idea why.

I did initially test the ingress using a simple docker image and that worked fine, when I then tried to do the same for my current application it prompted me for Basic authentication when accessing it using the host defined in the Ingress resource.

This is my current deployment/service for my React frontend image that is served using Nginx in a multi stage dockerfile.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-deployment
  namespace: demo-ns
  labels:
    app: demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      name: demo-pod
      labels:
    app: demo
    spec:
      containers:
      - name: demo-container
        image: <my_nginx_based_react_img>
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: demo-service
  namespace: demo-ns
spec:
  selector:
    app: demo
  ports:
  - port: 80
    targetPort: 80

This is my Nginx Ingress Resource

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: nginx-ingress
  namespace: demo-ns
  labels:
    app: demo
spec:
  ingressClassName: nginx
  rules:
  - host: hello-world.info
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: demo-service
            port:
              number: 80

I am creating the NGINX Ingress controller like this

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml

I edited my hosts file to include the domain to test locally.

127.0.0.1 kubernetes.docker.internal hello-world.info

This is what I see when i try to access my application

kubectl get ingress

kubectl get all -n ingress-nginx

What I don’t understand is how it was working properly when I was initially using a simple container to test the Ingress. (It wasn’t asking me for Basic auth)

I did try removing everything, the Ingress controller, Ingress itself, and recreated it using the simple docker container I used initially, but even now I get prompted for auth.

Does anyone have an idea why?

EDIT 1

I noticed in my Ingress controller logs, I see this.

The no object matching is for my application I want to containerize currently, I did remove everything in that namespace when I tried to go back to the simple docker container I had before that was working.

Could this somehow be contributing to the issue I’m facing?

EDIT 2

Seem to have fixed it, I forgot that my Nginx Ingress Resource was in my default namespace, not the namespace where I have all my kubernetes objects for my application.

Fixed this by deleting the ingress and recreating it in my desired namespace.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật