Answers: <p>You need to add the required annotations to the ingress as required.For nginx, you can follow <a href="https://github.com/kubernetes/ingress-nginx/tree/main/docs/examples/auth/basic" rel="nofollow noreferrer">this</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2021-08-14T06:46:19.223Z
Answers: 2021-08-15T08:49:48.160Z
Answers: 2021-08-15T08:49:48.160Z
Answers: rohatgisanat
Body: <p>How to setup basic auth for Prometheus deployed on K8s cluster using yamls??</p>
  <p>I was able to achieve this easily when Prometheus was deployed on a host locally using tar file. But when it is deployed as a pod in K8s cluster, tried almost everything on the internet but no luck.</p>
  <p>Any kind of help would be really appreciated!</p>
  <p>Thanks!</p>
  
Tags: <kubernetes><prometheus>
Title: How to setup basic auth for Prometheus deployed on K8s cluster using yamls?
UserDisplayName: Saurabh
ThreadText: # How to setup basic auth for Prometheus deployed on K8s cluster using yamls?
  
  (Asked by: username_0 on 2021-08-09)
  
  How to setup basic auth for Prometheus deployed on K8s cluster using yamls??
  
  I was able to achieve this easily when Prometheus was deployed on a host locally using tar file. But when it is deployed as a pod in K8s cluster, tried almost everything on the internet but no luck.
  
  Any kind of help would be really appreciated!
  
  Thanks!
  
  **Tags:** kubernetes, prometheus
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-14. Score: 1
  
  You need to add the required annotations to the ingress as required.For nginx, you can follow [this](https://github.com/kubernetes/ingress-nginx/tree/main/docs/examples/auth/basic)
  
  
  ---
  
  