-
Notifications
You must be signed in to change notification settings - Fork 91
Feat/delete os pod #206
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
base: main
Are you sure you want to change the base?
Feat/delete os pod #206
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: alvlkov The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
|
/remove-lifecycle stale |
iamkirkbater
left a comment
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.
Requested change relates to the name of the script. The additional check for a replicaset would be more of a nice-to-have, but we can also add that after this is merged so that we can start using this sooner rather than later.
| @@ -0,0 +1,21 @@ | |||
| # Delete Openshift Pod Script | |||
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.
Can we simplify this to just be delete-pod instead of adding the delete-os-pod? From a UX perspective, it will be easier to remember the closer the syntax name is to the actual OC command.
scripts/CEE/delete-os-pod/script.sh
Outdated
|
|
||
|
|
||
| main(){ | ||
| delete_pod |
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.
Would it be a huge lift here to validate if a pod is owned by a replicaset before proceeding? We might also need to add a "force" flag/parameter to bypass that as well, but it might be a nice protection for the rare chance that a pod isn't managed in an openshift namespace, this way we can make sure it will come back as a default behavior, but have the option to bypass it if we need to.
| author: Alex Volkov | ||
| allowedGroups: | ||
| - CEE | ||
| - SREP |
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.
| - SREP | |
| - SREP | |
| - MCSTierTwo |
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.
added the suggestions, thanks @iamkirkbater
|
Thanks @iamkirkbater for the review! I would suggest we add the safeguard in this PR to validate if a pod is backed by a replicaset, otherwise the delete operation can be too wide.
Another nice-to-have is that we put a list of allowed namespace instead of |
|
@feichashao - a few questions:
|
I would say Healthy = A pod with all containers in running state; The other should be non-healthy, eg, pending, crashloopbackoff, pod in running state but not all containers are running, showing like: (I mocked this) |
|
Added replicaset check and --force flag.
|
|
/retest |
| clusterRoleRules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - "pods" | ||
| verbs: | ||
| - "delete" | ||
| - "get" |
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 valid for all namespaces. There's no limitation to from openshift's reserved namespace. as mentioned above.
This permission extends beyond the scope even SRE-P has.
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.
The above limitation applies to the NAMESPACE parameter, to avoid deleting Openshift related pods. AFAIK I cant scope namespaces within clusterRoleRules. Please elaborate about the suggestion.
Co-authored-by: typeid <github@typeid.org>
|
/retest |
|
@alvlkov: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm |
|
Code LGTM. Pending approval from compliance: https://issues.redhat.com/browse/HCMSEC-611 |
|
/hold for compliance approve |
|
/unhold Merging this as we have not received any feedback from compliance. This does not provide read access to customer data so I'm okay just stamping this off. |
|
/retest |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
What type of PR is this?
This adds a new managed script to delete a pod from Openshift's reserved namespace.
What this PR does / Why we need it?
This will help fixing errors related to openshift reserved namespaces, essentially when pod restart is required.
Which Jira/Github issue(s) does this PR fix?
OSD_20528
Special notes for your reviewer
Pre-checks (if applicable)