title: Kubernetes - How to acces to service from a web server in pod with a rest request
body: <p>I'm looking to use Kubernetes DNS to requetes pods from pods. All is in my Kubernetes cluster.</p>
  
  <p>I would like to use a http requeste from a web app to call another web app </p>
  
  <p>For exemple I would like to call ProductWebApp from DashboardWebApp</p>
  
  <p>I found kubernetes rest api</p>
  
  <p>➜  ~ kubectl exec -it dashboard-57f598dd76-54s2x -- /bin/bash</p>
  
  <p>➜  ~ curl -X GET <a href="https://4B3449144A41F5488D670E69D41222D.sk1.us-east-1.eks.amazonaws.com/api/v1/namespaces/staging/services/product-app/proxy/api/product/5bf42b2ca5fc050616640dc6" rel="nofollow noreferrer">https://4B3449144A41F5488D670E69D41222D.sk1.us-east-1.eks.amazonaws.com/api/v1/namespaces/staging/services/product-app/proxy/api/product/5bf42b2ca5fc050616640dc6</a> 
  {
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {</p>
  
  <p>},
    "status": "Failure",
    "message": "services \"product-app\" is forbidden: User \"system:anonymous\" cannot get services/proxy in the namespace \"staging\"",
    "reason": "Forbidden",
    "details": {
      "name": "product-app",
      "kind": "services"
    },
    "code": 403
  }%        </p>
  
  <p>I don't understand why it's block</p>
  
  <p>I found also this url<br>
  ➜  ~ curl -XGET product-app.staging.svc.cluster.local/api/product/5bf42b2ca5fc050616640dc6</p>
  
  <p>But it's also not work </p>
  
  <p>So what is the good way to make a call from a pod to service ?</p>