-
Notifications
You must be signed in to change notification settings - Fork 22
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: make hostNetwork
configurable
#107
feat: make hostNetwork
configurable
#107
Conversation
- disable it by default (fixes port conflict issue on the node if another port is trying to acquire the same port)
@@ -102,7 +102,8 @@ func (m *PullExecutor) StartPulling(o *PullOptions) error { | |||
c, cancel := context.WithTimeout(context.Background(), pullCtxTimeout) | |||
defer cancel() | |||
|
|||
if pullstatus.Get(o.NamedRef) == pullstatus.StillPulling { | |||
if pullstatus.Get(o.NamedRef) == pullstatus.StillPulling || | |||
pullstatus.Get(o.NamedRef) == pullstatus.Pulled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fix for what appears to be a race condition when I was testing #81
Basically when two requests sent back-to-back with little time duration between them, one of them succeeds while the other goes into the mutex section and continues to pull the same image again (if pullAlways: true
). I haven't seen this issue outside #81 but thought it would be good to get the fix in before we get #81 merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good if we could also update other references for hostNetwork
and set it to false for maintaining consistency.
I have replaced the occurrences. |
Will ping you here once the CI finishes successfully. |
@mugdha-adhav can you review the PR again. |
@mugdha-adhav can I ask for a review again 🙏 |
Why
We use
hostNetwork: true
by default which causes problems in the following scenario:This happens because we use
hostNetwork: true
. Based on my tests and analysis (along with integration tests), we don't really needhostNetwork
because we are not accessing anything on the node nor is the node accessing anything on the warm-metal pod directly.More info
hostNetwork has been a part of the initial commit: 515cec1
https://github.com/kubernetes-csi/livenessprobe/tree/master?tab=readme-ov-file#liveness-probe
So
kubelet
basically executeslivenessProbe
which pings thehealthz
endpoint to check if the CSI driver is alive and livenessprobe server forwards that request to the CSI driver'sProbe()
endpoint to check if the driver is healthy.https://github.com/kubernetes-csi/livenessprobe/blob/ebd49b57031ab90f6f376f1472884948f381558c/cmd/livenessprobe/main.go#L169 -> https://github.com/kubernetes-csi/livenessprobe/blob/ebd49b57031ab90f6f376f1472884948f381558c/cmd/livenessprobe/main.go#L73
I don't see a need for warm metal to use
hostNetwork
since it doesn't need to access anything on the node.warm-metal can access all the unix sockets via
volumeMounts
:ref: https://github.com/warm-metal/csi-driver-image/blob/master/charts/warm-metal-csi-driver/templates/nodeplugin.yaml