Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cni): taint controller #4650

Merged
merged 41 commits into from
Aug 4, 2022
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4d096dd
feat(cni): add delay to the cni startup and a failing test
slonka Jul 21, 2022
86476d4
feat(cni): make check pass
slonka Jul 21, 2022
ac24d98
feat(cni): taint controller e2e test passes
slonka Jul 24, 2022
47abf1a
feat(cni): add post meet comments and use kuma version instead of a h…
slonka Jul 25, 2022
8644d88
feat(cni): hook up new test into CI
slonka Jul 25, 2022
f4516ab
feat(cni): make check pass
slonka Jul 25, 2022
5ac9872
feat(cni): update golden files
slonka Jul 25, 2022
8939e78
feat(cni): make k3d makefile target use k3d
slonka Jul 25, 2022
c795ea2
feat(cni): fix target name
slonka Jul 25, 2022
6e4d858
feat(cni): update golden files
slonka Jul 25, 2022
012ff3e
feat(cni): add test that shows old cni is susceptible to the race con…
slonka Jul 26, 2022
9e498b4
feat(cni): clean up
slonka Jul 27, 2022
6553ac5
feat(cni): remove separate target
slonka Jul 27, 2022
b651262
feat(cni): self review fixes
slonka Jul 27, 2022
87611c6
feat(cni): move kind not supported flag to circleci config
slonka Jul 27, 2022
cc6e2a6
feat(cni): move create delete node to k8s implementation
slonka Jul 28, 2022
8866b3c
feat(cni): move filter label back to makefile
slonka Jul 28, 2022
66ae209
Update app/cni/pkg/install/main.go
slonka Jul 29, 2022
1dfad5f
feat(cni): apply review suggestions
slonka Jul 29, 2022
0564256
chore: merge with master
slonka Jul 29, 2022
66aab3e
Merge branch 'master' into feat/add-cni-taint-controller
slonka Jul 29, 2022
ef6e801
feat(cni): add index on spec node name
slonka Jul 29, 2022
cee53d9
Merge branch 'feat/add-cni-taint-controller' of github.com:slonka/kum…
slonka Jul 29, 2022
4cdedd9
feat(cni): remove no longer needed comment
slonka Aug 1, 2022
b58865f
feat(cni): apply review suggestions
slonka Aug 2, 2022
ee78af6
feat(cni): remove if around sleep
slonka Aug 2, 2022
f66140a
feat(cni): fix tests
slonka Aug 2, 2022
c35b5c6
feat(cni): shorten the waiting time
slonka Aug 2, 2022
fec6dd5
feat(cni): remove arm not supported label from new cni test
slonka Aug 2, 2022
30bb406
fix(cni): tmp
slonka Aug 3, 2022
7990c47
feat(cni): apply review suggestions
slonka Aug 4, 2022
67fbd7a
chore: merge with master
slonka Aug 4, 2022
a1ac880
feat(cni): update golden files
slonka Aug 4, 2022
7e1259b
fix(cni): make check pass
slonka Aug 4, 2022
63c05ee
fix(cni): remove filtering of nodes
slonka Aug 4, 2022
55a9aa8
chore: fix bad merge
slonka Aug 4, 2022
b9c1cf4
fix(cni): check that node name exists for both old and new object
slonka Aug 4, 2022
8dad501
Revert "fix(cni): check that node name exists for both old and new ob…
slonka Aug 4, 2022
e801dc1
fix(cni): udpate comment
slonka Aug 4, 2022
f6c9a77
fix(cni): change log level
slonka Aug 4, 2022
92cacba
fix(cni): put pod filtering in mapper because it is more performant
slonka Aug 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions pkg/plugins/runtime/k8s/controllers/cni_taint_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ func podToNodeMapper(log logr.Logger) kube_handler.MapFunc {
return nil
}

// For some reason in the logs there are a lot of 'could not find a node with name ""'
// so this is why I'm filtering it out here
if pod.Spec.NodeName == "" {
slonka marked this conversation as resolved.
Show resolved Hide resolved
slonka marked this conversation as resolved.
Show resolved Hide resolved
return nil
}

req := kube_reconcile.Request{NamespacedName: kube_types.NamespacedName{
Name: pod.Spec.NodeName,
}}
Expand All @@ -157,13 +163,13 @@ func podToNodeMapper(log logr.Logger) kube_handler.MapFunc {

var nodeEvents = predicate.Funcs{
CreateFunc: func(event event.CreateEvent) bool {
return filterNodes(event.Object)
return true
},
DeleteFunc: func(deleteEvent event.DeleteEvent) bool {
return false
},
UpdateFunc: func(updateEvent event.UpdateEvent) bool {
return filterNodes(updateEvent.ObjectNew)
return true
},
GenericFunc: func(genericEvent event.GenericEvent) bool {
return false
Expand All @@ -187,18 +193,6 @@ func podEvents(cniApp string) predicate.Funcs {
}
}

func filterNodes(obj kube_client.Object) bool {
node, ok := obj.(*kube_core.Node)
if !ok {
return false
}
if node.Name == "" {
return false
}

return true
}

func filterPods(obj kube_client.Object, cniApp string) bool {
slonka marked this conversation as resolved.
Show resolved Hide resolved
pod, ok := obj.(*kube_core.Pod)
if !ok {
Expand Down