mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 09:38:12 -03:30
Use a variable for standardizing kubectl invocation (#8329)
* Add kubectl variable * Replace kubectl usage by kubectl variable in roles * Remove redundant --kubeconfig on kubectl usage * Replace unecessary shell usage with command
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: remove-node | List nodes
|
||||
command: >-
|
||||
{{ bin_dir }}/kubectl get nodes -o go-template={% raw %}'{{ range .items }}{{ .metadata.name }}{{ "\n" }}{{ end }}'{% endraw %}
|
||||
{{ kubectl }} get nodes -o go-template={% raw %}'{{ range .items }}{{ .metadata.name }}{{ "\n" }}{{ end }}'{% endraw %}
|
||||
register: nodes
|
||||
delegate_to: "{{ groups['kube_control_plane']|first }}"
|
||||
changed_when: false
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
- name: remove-node | Drain node except daemonsets resource # noqa 301
|
||||
command: >-
|
||||
{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf drain
|
||||
{{ kubectl }} drain
|
||||
--force
|
||||
--ignore-daemonsets
|
||||
--grace-period {{ drain_grace_period }}
|
||||
|
||||
Reference in New Issue
Block a user