def _apply_node_label(label, delete=False, overwrite=False):
    ''' Invoke kubectl to apply node label changes '''
    nodename = get_node_name()

    # TODO: Make this part of the kubectl calls instead of a special string
    cmd_base = 'kubectl --kubeconfig={0} label node {1} {2}'

    if delete is True:
        label_key = label.split('=')[0]
        cmd = cmd_base.format(kubeconfig_path, nodename, label_key)
        cmd = cmd + '-'
    else:
        cmd = cmd_base.format(kubeconfig_path, nodename, label)
        if overwrite:
            cmd = '{} --overwrite'.format(cmd)
    cmd = cmd.split()

    deadline = time.time() + 60
    while time.time() < deadline:
        code = subprocess.call(cmd)
        if code == 0:
            break
        hookenv.log('Failed to apply label %s, exit code %d. Will retry.' % (
            label, code))
        time.sleep(1)
    else:
        msg = 'Failed to apply label %s' % label
        raise ApplyNodeLabelFailed(msg)