mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
dns: hack: new k8s client for each query
- rest.Config Timeout setting does not work right now [1] - number of connections will not increase along with newed client: they use a single connection always... [1] https://github.com/kubernetes/client-go/issues/374#issuecomment-413842964
This commit is contained in:
+5
-1
@@ -271,7 +271,11 @@ func (r *SRegionDNS) getK8sServiceBackends(req *recordRequest) ([]string, error)
|
||||
}
|
||||
|
||||
func (r *SRegionDNS) getK8sServicePods(namespace, name string) ([]v1.Pod, error) {
|
||||
cli := r.K8sClient
|
||||
cli, err := k8s.NewClientByFile(r.K8sConfigFile, nil)
|
||||
if err != nil {
|
||||
ylog.Errorf("Init kubernetes client error: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
svc, err := cli.CoreV1().Services(namespace).Get(name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user