-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add/extend some K8s-related utilities. #26
Conversation
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
a6fd60c
to
a215b17
Compare
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, minor comment but fine for now.
) | ||
|
||
|
||
def wait_for_statefulset( |
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.
we should probably just make this a wait_for_resource
in the future. Let's leave it like this for now (as we would need to update all Rocks).
@@ -142,7 +144,7 @@ def wait_for_resource( | |||
resource_type, | |||
name, | |||
"--timeout", | |||
"60s", | |||
"1s", |
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.
Actually, this should be 1min
I guess.
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.
I have “shifted” the wait from the ‘kubectl’ call to the retry function itself via the default values for the kwarga, with the total wait time still amounting to more or less 1minute.
The ‘--timeout’ kwarg to ‘kubectl’ is still required though, otherwise we risk it waiting indefinitely…
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.
with the total wait time still amounting to more or less 1minute.
Actually it just hit me that the original was about 5 minutes, updated the default kwargs to be about 5minutes again.
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
Signed-off-by: Nashwan Azhari <nazhari@cloudbasesolutions.com>
93a088f
to
bb73a1b
Compare
This patch notably:
k8s_utils.wait_for_*()
functions with configurable retry times/period argumentswait_for_statefulset
functionplatform_util
modulekubectl describe
relevant resources in case anywait_for_*()
functions fail