|
74 | 74 |
|
75 | 75 | defaultFSType = flag.String("default-fstype", "", "The default filesystem type of the volume to provision when fstype is unspecified in the StorageClass. If the default is not set and fstype is unset in the StorageClass, then no fstype will be set")
|
76 | 76 |
|
| 77 | + kubeAPIQPS = flag.Float32("kube-api-qps", 5, "QPS to use while communicating with the kubernetes apiserver. Defaults to 5.0.") |
| 78 | + kubeAPIBurst = flag.Int("kube-api-burst", 10, "Burst to use while communicating with the kubernetes apiserver. Defaults to 10.") |
| 79 | + |
77 | 80 | featureGates map[string]bool
|
78 | 81 | provisionController *controller.ProvisionController
|
79 | 82 | version = "unknown"
|
@@ -124,10 +127,15 @@ func main() {
|
124 | 127 | if err != nil {
|
125 | 128 | klog.Fatalf("Failed to create config: %v", err)
|
126 | 129 | }
|
| 130 | + |
| 131 | + config.QPS = *kubeAPIQPS |
| 132 | + config.Burst = *kubeAPIBurst |
| 133 | + |
127 | 134 | clientset, err := kubernetes.NewForConfig(config)
|
128 | 135 | if err != nil {
|
129 | 136 | klog.Fatalf("Failed to create client: %v", err)
|
130 | 137 | }
|
| 138 | + |
131 | 139 | // snapclientset.NewForConfig creates a new Clientset for VolumesnapshotV1beta1Client
|
132 | 140 | snapClient, err := snapclientset.NewForConfig(config)
|
133 | 141 | if err != nil {
|
@@ -282,7 +290,13 @@ func main() {
|
282 | 290 | // to preserve backwards compatibility
|
283 | 291 | lockName := strings.Replace(provisionerName, "/", "-", -1)
|
284 | 292 |
|
285 |
| - le := leaderelection.NewLeaderElection(clientset, lockName, run) |
| 293 | + // create a new clientset for leader election |
| 294 | + leClientset, err := kubernetes.NewForConfig(config) |
| 295 | + if err != nil { |
| 296 | + klog.Fatalf("Failed to create leaderelection client: %v", err) |
| 297 | + } |
| 298 | + |
| 299 | + le := leaderelection.NewLeaderElection(leClientset, lockName, run) |
286 | 300 |
|
287 | 301 | if *leaderElectionNamespace != "" {
|
288 | 302 | le.WithNamespace(*leaderElectionNamespace)
|
|
0 commit comments