code: def drain(self, ignore_daemonsets=False, delete_local_storage=False, force=False):
          
  
          # inventory of K8sPods found on this node.
          daemonset_pods = []
          pods = self._pod_inventory()
  
          # cordon the node.
          self.unschedulable = True
          self.update()
  
          # loop through all pods and delete them.
          for pod in pods:
              if self._is_daemonset(pod):
                  if not ignore_daemonsets:
                      raise DrainNodeException("K8sNode: pod: [ {} ] is managed by a DaemonSet.".format(pod.name))
                  else:
                      daemonset_pods.append(pod)
                      continue
              if self._has_local_storage(pod) and not delete_local_storage:
                  raise DrainNodeException("K8sNode: pod: [ {} ] has local storage that will be lost.".format(pod.name))
              if self._is_orphan(pod) and not force:
                  raise DrainNodeException("K8sNode: pod: [ {} ] is unmanaged and will be lost.".format(pod.name))
  
              pod.delete()
  
          self._wait_for_pod_deletion(daemonset_pods)
  
          return self
docs: Removes all K8sPods from this K8sNode, 
          and prevents additional K8sPods from being scheduled.
          
          :param ignore_daemonsets: a boolean. 
                  If false, will fail if a K8sDaemonSet-managed K8sPod is present.
                  If true, will continue even if a K8sDaemonSet-managed K8sPod is present.
                          
          :param delete_local_storage: a boolean.
                  If false, will fail if a K8sVolume of type 'emptyDir' is found.
                  If true, will continue even if an 'emptyDir' K8sVolume is found.
          
          :param force: a boolean.
                  If false, will fail if any K8sPods unmanaged by a parent object are found.
                  If true, will continue and any unmanaged K8sPods are lost.
          
          :return: self.