gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.02k stars 1.71k forks source link

k8s service: connection hangs after booting #42759

Closed pQraus closed 6 days ago

pQraus commented 1 month ago

I have a single node k8s-cluster and a teleport agent running outside from k8s but on the same node. When the node is started, k8s and the teleport agent are started at the same time. K8s takes longer to start than the agent. The agent uses a kubeconfig to connect to the cluster.

Expected behaviour:

As soon as k8s is started, requests can also be forwarded successfully to the kube-apiserver (default behaviour in teleport < 14)

Current behaviour:

When k8s is ready, it takes about 5 minutes until the agent can forward the requests to the kube-apiserver.

Bug details:

AntonAM commented 3 weeks ago

Currently this is an expected behaviour. We update cluster details (including if it's online or offline) every five minutes, so when first request tries to get cluster status it's deemed offline (since cluster is not up yet) and for the next 5 minutes all requests will be denied, until cluster' status is updated. I'll look into improving this situation.