Which Kubernetes client method methods are safe for simultaneous calls?

The Kubernetes client-go package includes a good example for creating a single deployment using the client-go api.

I want to create and destroy many kubernet resources without waiting for each HTTP request to complete.

Is it possible to use client-go api asynchronously?

Are there methods like the ones below that are safe for calling from multiple goroutines at the same time?

 resultPod, err := clientset.CoreV1().Pods("default").Create(desiredPod) 
+5
source share
1 answer

The k8s client uses http.Client internally, which is safe to call at the same time. But it's probably wise to limit the number of simultaneous API calls to a reasonable upper limit (I would start with 4: something higher, which probably won't improve performance).

+1
source

Source: https://habr.com/ru/post/1274954/


All Articles