File tree 6 files changed +177
-253
lines changed
6 files changed +177
-253
lines changed Original file line number Diff line number Diff line change 1
1
# In Cluster Taint Manager
2
2
3
- To add or remove taint of a node from a in-cluster pod.
3
+ To add or remove taint within a pod. The default mode is to run as a pod in a Kubernetes cluster. It will try to
4
+ authenticate to K8S API server with in-cluster config (the service account token mounted inside pod). It also uses
5
+ downward API to retrieve the node name where the pod is running on in order to change the taint.
4
6
5
7
## Compile
6
8
@@ -10,9 +12,16 @@ GOOS=linux GOARCH=amd64 go build -o taintmanager taintmanager.go
10
12
11
13
## Development and Debug
12
14
13
- The dev/debug environment is setup by ` tilt ` . To start, run ` tilt up ` .
15
+ To test outside a cluster, commandline parameter ` -kubeconfig ` and ` -node ` can be specified. If ` -kubeconfig ` is not
16
+ specified, taintmanager will try to load the kubeconfig from default path ` HOME/.kube/config `
14
17
15
- ## Test
18
+ Using default kubeconfig:
19
+
20
+ ```
21
+ taintmanager -node f6.workers.ctlt.ubc.ca -remove hub.jupyter.org/imagepulling:NoExecute
22
+ ```
23
+
24
+ ## Test in Cluster
16
25
17
26
The ` test ` directory contains YAML files for deploy a pod with required permissions to run taintmanager.
18
27
Please change ` namespace ` field in ` clusterrolebinding.yaml ` before deploying to a cluster.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ require (
20
20
github.com/google/gnostic v0.6.9 // indirect
21
21
github.com/google/go-cmp v0.5.9 // indirect
22
22
github.com/google/gofuzz v1.2.0 // indirect
23
+ github.com/imdario/mergo v0.3.6 // indirect
23
24
github.com/josharian/intern v1.0.0 // indirect
24
25
github.com/json-iterator/go v1.1.12 // indirect
25
26
github.com/mailru/easyjson v0.7.7 // indirect
26
27
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
27
28
github.com/modern-go/reflect2 v1.0.2 // indirect
28
29
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
30
+ github.com/spf13/pflag v1.0.5 // indirect
29
31
golang.org/x/net v0.2.0 // indirect
30
32
golang.org/x/oauth2 v0.2.0 // indirect
31
33
golang.org/x/sys v0.2.0 // indirect
Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
69
69
github.com/google/gofuzz v1.2.0 /go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg =
70
70
github.com/google/uuid v1.1.2 /go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo =
71
71
github.com/grpc-ecosystem/grpc-gateway v1.16.0 /go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw =
72
+ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28 =
73
+ github.com/imdario/mergo v0.3.6 /go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA =
72
74
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY =
73
75
github.com/josharian/intern v1.0.0 /go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y =
74
76
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM =
@@ -100,6 +102,7 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
100
102
github.com/rogpeppe/fastuuid v1.2.0 /go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ =
101
103
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 /go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA =
102
104
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA =
105
+ github.com/spf13/pflag v1.0.5 /go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg =
103
106
github.com/stoewer/go-strcase v1.2.0 /go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8 =
104
107
github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
105
108
github.com/stretchr/testify v1.3.0 /go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI =
You can’t perform that action at this time.
0 commit comments