Skip to content
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

k8s_drain delete option 'delete_emptydir_data' not available #400

Closed
kagehisa opened this issue Mar 8, 2022 · 2 comments
Closed

k8s_drain delete option 'delete_emptydir_data' not available #400

kagehisa opened this issue Mar 8, 2022 · 2 comments

Comments

@kagehisa
Copy link

kagehisa commented Mar 8, 2022

SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME

kubernetes.core.k8s_drain

ANSIBLE VERSION
ansible [core 2.11.6] 
  config file = /home/manji/ansible/3t6_lif_ansible/ansible.cfg
  configured module search path = ['/home/berd/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/berd/.local/lib/python3.6/site-packages/ansible
  ansible collection location = /home/berd/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/berd/.local/bin/ansible
  python version = 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC]
  jinja version = 2.10.1
  libyaml = False
COLLECTION VERSION
Collection      Version
--------------- -------
kubernetes.core 2.2.3 
CONFIGURATION
DEFAULT_ROLES_PATH(/home/berd/ansible/3t6_lif_ansible/ansible.cfg) = ['/home/berd/ansible/3t6_lif_ansible/roles', '/home/berd/.ansible/roles']
DEFAULT_VAULT_PASSWORD_FILE(/home/berd/ansible/3t6_lif_ansible/ansible.cfg) = /home/berd/ansible/3t6_lif_ansible/ansi-vault.py
OS / ENVIRONMENT

SUSE Linux Enterprise 15 SP3

STEPS TO REPRODUCE
  • Use the latest kubernetes core collection ( according to this, it is 2.2.3 )
  • drain cluster node with the settings described in the kubernetes core collection readme linked documentation for k8s_drain
  • receive error about unsupported parameters for kubernetes.core.k8s_drain --> delete_options.delete_emptydir_data
- name: cordon and drain node 1
  kubernetes.core.k8s_drain:
    api_key: "{{ rancher_api_key }}"
    host: "{{ rancher_ds1_cluster_url }}"
    name: node1
    state: drain
    delete_options:
      terminate_grace_period: 120
      ignore_daemonsets: yes
      delete_emptydir_data: yes
EXPECTED RESULTS

A drained node even when pods with local dir data would be deployed there.

ACTUAL RESULTS

The k8s_drain module in the latest kubernetes.core collection seems to be missing the delete_emptydir_data parameter as described in the documentation. Or the documentation is not the right one for the 2.2.3 release of kubernetes.core.

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (kubernetes.core.k8s_drain) module: delete_options.delete_emptydir_data. Supported parameters include: host, proxy_headers, delete_options, proxy, ca_cert (ssl_ca_cert), state, api_key, client_cert (cert_file), client_key (key_file), validate_certs (verify_ssl), password, context, kubeconfig, persist_config, name, username."}
@Akasurde
Copy link
Member

Akasurde commented Mar 8, 2022

@kagehisa Thanks for reporting this issue. The delete_emptydir_data will be released kubernetes.core 2.3.0 release. The documentation link provided is for the latest devel branch (which will be cut to 2.3.0 once it is released). So you will have to wait for 2.3.0 release to get this feature. Thanks.

@gravesm
Copy link
Member

gravesm commented Mar 8, 2022

I'm going to go ahead and close this issue as it is resolved by #322 in the upcoming release.

@gravesm gravesm closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants