Skip to content

Commit

Permalink
Add in cluster kubeconfig config
Browse files Browse the repository at this point in the history
  • Loading branch information
Duke0404 committed Aug 12, 2024
1 parent a7ee2b2 commit ee6d4f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cluster-autoscaler/utils/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func GetKubeConfig(opts config.KubeClientOptions) *rest.Config {
if err != nil {
klog.Fatalf("%v: %v", failedToBuildConfigErr, err)
}
} else {
} else if opts.Master != "" {
url, err := url.Parse(opts.Master)
if err != nil {
klog.Fatalf("%v: %v", failedToParseK8sUrlErr, err)
Expand All @@ -60,8 +60,12 @@ func GetKubeConfig(opts config.KubeClientOptions) *rest.Config {
if err != nil {
klog.Fatalf("%v: %v", failedToBuildClientConfigErr, err)
}
} else {
kubeConfig, err = rest.InClusterConfig()
if err != nil {
klog.Fatalf("%v: %v", failedToBuildConfigErr, err)
}
}

kubeConfig.QPS = opts.KubeClientQPS
kubeConfig.Burst = opts.KubeClientBurst
kubeConfig.ContentType = opts.APIContentType
Expand Down

0 comments on commit ee6d4f9

Please sign in to comment.