I'm looking to use Kubernetes DNS to requetes pods from pods. All is in my Kubernetes cluster.
I would like to use a http requeste from a web app to call another web app
For exemple I would like to call ProductWebApp from DashboardWebApp
I found kubernetes rest api
➜ ~ kubectl exec -it dashboard-57f598dd76-54s2x -- /bin/bash
➜ ~ curl -X GET https://4B3449144A41F5488D670E69D41222D.sk1.us-east-1.eks.amazonaws.com/api/v1/namespaces/staging/services/product-app/proxy/api/product/5bf42b2ca5fc050616640dc6 { "kind": "Status", "apiVersion": "v1", "metadata": {
}, "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 }%
I don't understand why it's block
I found also this url
➜ ~ curl -XGET product-app.staging.svc.cluster.local/api/product/5bf42b2ca5fc050616640dc6
But it's also not work
So what is the good way to make a call from a pod to service ?