Skip to content

Commit 3cd5ae5

Browse files
authored
Merge pull request #501 from saidjawad/support_for_karpenter_start_up_taint
Support for removing start up taint
2 parents 3c29b0c + f5fe753 commit 3cd5ae5

30 files changed

+393
-61
lines changed

cmd/local-volume-provisioner/main.go

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package main
1818

1919
import (
20-
"context"
2120
"flag"
2221
"log"
2322
"math/rand"
@@ -33,15 +32,12 @@ import (
3332
"sigs.k8s.io/sig-storage-local-static-provisioner/pkg/deleter"
3433
"sigs.k8s.io/sig-storage-local-static-provisioner/pkg/metrics"
3534
"sigs.k8s.io/sig-storage-local-static-provisioner/pkg/metrics/collectors"
35+
"sigs.k8s.io/sig-storage-local-static-provisioner/pkg/util"
3636
"sigs.k8s.io/sig-storage-local-static-provisioner/pkg/watcher"
3737

38-
v1 "k8s.io/api/core/v1"
3938
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
40-
"k8s.io/client-go/kubernetes"
4139
)
4240

43-
const maxGetNodesRetries = 3
44-
4541
var (
4642
optListenAddress string
4743
optMetricsPath string
@@ -86,7 +82,7 @@ func main() {
8682
}
8783

8884
client := common.SetupClient()
89-
node := getNode(client, nodeName)
85+
node := util.GetNode(client.CoreV1(), nodeName)
9086

9187
configUpdate := make(chan common.ProvisionerConfiguration)
9288
defer close(configUpdate)
@@ -115,22 +111,3 @@ func main() {
115111
http.Handle(optMetricsPath, promhttp.Handler())
116112
log.Fatal(http.ListenAndServe(optListenAddress, nil))
117113
}
118-
119-
func getNode(client *kubernetes.Clientset, name string) *v1.Node {
120-
var retries int
121-
122-
for {
123-
node, err := client.CoreV1().Nodes().Get(context.TODO(), name, metav1.GetOptions{})
124-
if err == nil {
125-
return node
126-
}
127-
128-
retries++
129-
klog.Infof("Could not get node information (remaining retries: %d): %v", maxGetNodesRetries-retries, err)
130-
131-
if retries >= maxGetNodesRetries {
132-
klog.Fatalf("Could not get node information: %v", err)
133-
}
134-
time.Sleep(time.Second)
135-
}
136-
}

helm/generated_examples/additional-volumes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ rules:
5959
verbs: ["create", "update", "patch"]
6060
- apiGroups: [""]
6161
resources: ["nodes"]
62-
verbs: ["get"]
62+
verbs: ["get", "update"]
6363
---
6464
# Source: local-static-provisioner/templates/rbac.yaml
6565
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-affinity.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rules:
7171
verbs: ["create", "update", "patch"]
7272
- apiGroups: [""]
7373
resources: ["nodes"]
74-
verbs: ["get"]
74+
verbs: ["get", "update"]
7575
---
7676
# Source: local-static-provisioner/templates/rbac.yaml
7777
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-cleanbyjobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rules:
7171
verbs: ["create", "update", "patch"]
7272
- apiGroups: [""]
7373
resources: ["nodes"]
74-
verbs: ["get"]
74+
verbs: ["get", "update"]
7575
---
7676
# Source: local-static-provisioner/templates/rbac.yaml
7777
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-default-storage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ rules:
7070
verbs: ["create", "update", "patch"]
7171
- apiGroups: [""]
7272
resources: ["nodes"]
73-
verbs: ["get"]
73+
verbs: ["get", "update"]
7474
---
7575
# Source: local-static-provisioner/templates/rbac.yaml
7676
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-nodeselector.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rules:
7171
verbs: ["create", "update", "patch"]
7272
- apiGroups: [""]
7373
resources: ["nodes"]
74-
verbs: ["get"]
74+
verbs: ["get", "update"]
7575
---
7676
# Source: local-static-provisioner/templates/rbac.yaml
7777
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-priority-critical.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rules:
7171
verbs: ["create", "update", "patch"]
7272
- apiGroups: [""]
7373
resources: ["nodes"]
74-
verbs: ["get"]
74+
verbs: ["get", "update"]
7575
---
7676
# Source: local-static-provisioner/templates/rbac.yaml
7777
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-priority-noncritical.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rules:
7171
verbs: ["create", "update", "patch"]
7272
- apiGroups: [""]
7373
resources: ["nodes"]
74-
verbs: ["get"]
74+
verbs: ["get", "update"]
7575
---
7676
# Source: local-static-provisioner/templates/rbac.yaml
7777
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-prometheus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ rules:
7171
verbs: ["create", "update", "patch"]
7272
- apiGroups: [""]
7373
resources: ["nodes"]
74-
verbs: ["get"]
74+
verbs: ["get", "update"]
7575
---
7676
# Source: local-static-provisioner/templates/rbac.yaml
7777
apiVersion: rbac.authorization.k8s.io/v1

helm/generated_examples/baremetal-provisioner.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ rules:
7070
verbs: ["create", "update", "patch"]
7171
- apiGroups: [""]
7272
resources: ["nodes"]
73-
verbs: ["get"]
73+
verbs: ["get", "update"]
7474
---
7575
# Source: local-static-provisioner/templates/rbac.yaml
7676
apiVersion: rbac.authorization.k8s.io/v1

0 commit comments

Comments
 (0)