Score:0

Can't access Kubernetes service using curl (GKE Autopilot)

br flag

I have created GKE Autopilot private and deployed Prometheus to it. I have Prometheus service in metrics namespace.

The problem is that I can access this service with kubectl port-forwarding command, but I can't access it with following setup:

  1. execute kubectl proxy

  2. execute curl http://localhost:8001/api/v1/namespaces/metrics/services/prometheus:80/proxy

Getting response:

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "error trying to reach service: dial tcp 10.115.128.78:9090: i/o timeout",
  "reason": "ServiceUnavailable",
  "code": 503
}

But the thing is that:

  1. I can access other kubernetes API endpoints (curl http://localhost:8001/api/v1/namespaces/metrics/services for example)

  2. On GKE Autopilot public cluster I can access this prometheus endpoint

So it seems that private GKE API blocks part of requests, most probably it is expected, but is there any way to overcome this restriction (maybe some GKE configuration needs to be changed)?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.