Skip to content

Commit

Permalink
enable kubeadm init verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
gtirloni committed Jul 29, 2024
1 parent ec269b0 commit 718ef7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions molecule/aio/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ platforms:
- controllers
provisioner:
name: ansible
options:
debug: true
config_options:
diff: true
connection:
pipelining: true
inventory:
Expand Down
9 changes: 8 additions & 1 deletion roles/kubernetes/tasks/bootstrap-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,20 @@
- name: Initialize cluster
throttle: 1
ansible.builtin.shell: |
kubeadm init --config /etc/kubernetes/kubeadm.yaml --upload-certs \
kubeadm init --v=5 --config /etc/kubernetes/kubeadm.yaml --upload-certs \
--ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests{% if kubernetes_allow_unsafe_swap %},Swap{% endif %}
args:
creates: /etc/kubernetes/admin.conf
environment:
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
when: inventory_hostname == kubernetes_bootstrap_node
failed_when: false

- name: debug logs

Check failure on line 113 in roles/kubernetes/tasks/bootstrap-cluster.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 113 in roles/kubernetes/tasks/bootstrap-cluster.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.shell: |
PAGER= journalctl -u kubelet
PAGER= journalctl -u containerd
failed_when: true

- name: Check if the node is already part of the cluster
ansible.builtin.stat:
Expand Down

0 comments on commit 718ef7e

Please sign in to comment.