-
Notifications
You must be signed in to change notification settings - Fork 6
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
modify on_error:destroy behavior for deployments #317
Conversation
connectors/kubernetes.py: a deployment handled by the connector is 'foreign' (not created by the connector), the connector cannot auto-restore it if it has been deleted. Therefore, it should not delete its deployment-under-control when the on_error setting is configured to 'destroy' (which is actually intended as 'destroy and re-create on the next adjust'). This patch modifies the connector to set replicas=0, instead - consistent with the behavior of the servoX predecessor (servo-k8s).
ENG-257 ServoX/kubernetes: modify on_failure: destroy behavior for deployments
when working with a deployment (that isn't created by ServoX/kubernetes), the 'on_failure: destroy' behavior should be modified to match the old servo-k8s, namely: scale the deployment to 0 instances (thus destroying all pods). This proposed change should not affect the 'canary mode' behavior - in this mode, the kubernetes connector itself creates the canary pod and it can (and should) destroy it when a n adjust failure occurs. |
- rename 'destroy' config option to 'shutdown' - modify tests to match - fix method 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.
Changes look good overall
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.
Please add requested unit test.
Also probably worth resolving the the open items from the last review although I will leave those to your discretion
https://github.com/opsani/servox/pull/317/files#r698604812
https://github.com/opsani/servox/pull/317/files#r698605379
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
connectors/kubernetes.py: a deployment handled by the connector is
'foreign' (not created by the connector), the connector cannot
auto-restore it if it has been deleted. Therefore, it should not delete
its deployment-under-control when the on_error setting is configured to
'destroy' (which is actually intended as 'destroy and re-create on the next
adjust').
This patch modifies the connector to set replicas=0, instead -
consistent with the behavior of the servoX predecessor (servo-k8s).
(Linear task: https://linear.app/opsani/issue/ENG-257/servoxkubernetes-modify-on-failure-destroy-behavior-for-deployments)