You want to rate limit and add basic auth at the ingress. How?
IntermediateScenarioServices, Ingress and DNS
Answer
Situation read → A staging site must be protected and API abuse limited.
What I'd do →
- For ingress-nginx use annotations
nginx.ingress.kubernetes.io/limit-rpsandauth-type: basicwithauth-secret - Create the htpasswd secret with
htpasswd -c auth userandkubectl create secret generic basic-auth --from-file=auth - Use OAuth2 Proxy for real SSO
- Apply WAF at the CDN or ALB layer for serious protection
- Verify with
curl -u user:pass
Why → Cheap controls at the edge protect the backend before traffic reaches the app.
Interview tip → Say basic auth is for staging, SSO for production.
More on Services, Ingress and DNS
A Service has no endpoints. How do you find out why?BeginnerWhen do you use ClusterIP, NodePort, LoadBalancer and ExternalName?BeginnerTraffic to a Service works from some pods but times out from others. How do you debug it?AdvancedYou want to expose three HTTP services under one hostname with different paths. How?Intermediateingress-nginx returns 404 for a new host. What do you check?Intermediateingress-nginx returns 502 or 503 intermittently. What are the likely reasons?Intermediate