-
Notifications
You must be signed in to change notification settings - Fork 71
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
install: add probes for caa ds rolling update #1323
Conversation
Deployed a nginx deployment PeerPods against a k8s cluster with 2 workers. and then rolling update the cloud-api-adaptor ds, logs looks like below from 2 console:
|
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.
LGTM. thanks @huoqifeng
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.
small nits
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.
LGTM, thanks @huoqifeng
I haven't had a chance to actually test this and I'm on holiday from tomorrow (so I won't formally approve) but the code makes sense and looks good.
Did another test like below:
Logs: |
Files used for testing:
|
cmd/cloud-api-adaptor/main.go
Outdated
@@ -139,6 +140,7 @@ func (cfg *daemonConfig) Setup() (cmd.Starter, error) { | |||
var config cmd.Config = &daemonConfig{} | |||
|
|||
func main() { | |||
go probe.Start() |
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.
What happens if the probe.Start fails ? Does CAA needs to bail out as well?
Also if CAA fails to start due to an error post starting the probe, does the goroutine needs to be killed ?
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.
failed startupProbe will cause pods recreating. per https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
If the startup probe never succeeds, the container is killed after 300s and subject to the pod's restartPolicy
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'll be good to add a comment in the code, to help new devs understand why error from the goroutine is not handled.
Like "We don't handle error from the probe goroutine since if the goroutine fails to start, the probe configured as part of the deployment will fail and the CAA containerwill be killed and restarted"
Fixes: confidential-containers#1322 Signed-off-by: Qi Feng Huo <huoqif@cn.ibm.com>
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.
/lgtm
Thanks @huoqifeng
b3c073a
into
confidential-containers:main
Fixes: #1322