Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Force drain pods. (#33)
Browse files Browse the repository at this point in the history
Testing done:

- Unit tests
- Ran minion-manager with bare pods running on nodes. It drained them and
  switched between on-demand and spot successfully.
  • Loading branch information
shrinandj authored and vgunapati committed Mar 27, 2019
1 parent 8379376 commit e4d1b12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cloud_provider/aws/aws_minion_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def cordon_node(self, instance):
instance_name = self.get_name_for_instance(instance)
if instance_name:
try:
cmd = "kubectl drain " + instance_name + " --ignore-daemonsets=true --delete-local-data=true"
cmd = "kubectl drain " + instance_name + " --ignore-daemonsets=true --delete-local-data=true --force --grace-period=-1"
subprocess.check_call(shlex.split(cmd))
logger.info("Drained instance %s", instance_name)
except Exception as ex:
Expand Down

0 comments on commit e4d1b12

Please sign in to comment.