Commit cc5809cc authored by Wen Wei Li's avatar Wen Wei Li

debug for the expired join token

parent 3c631c23
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
``` ```
* execute ansible-playbook * execute ansible-playbook
`ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook install_k8s_nodes.yml -i inventory.ini` `ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook install_k8s_nodes.yml -i inventory.ini --extra-vars "cp_ip={cp_ip}"`
...@@ -27,24 +27,7 @@ ...@@ -27,24 +27,7 @@
./helm-install.sh ./helm-install.sh
args: args:
chdir: /home/prlab/k8s/k8s-install chdir: /home/prlab/k8s/k8s-install
- name: execute k8s cmd - name: install k8s nodes
shell: |
echo "$(kubeadm token create --print-join-command)" > /tmp/join.sh
chmod +x /tmp/join.sh
- name: copy file
fetch:
src: '/tmp/join.sh'
dest: '/tmp/'
- name: get the result
hosts: localhost
tasks:
- name: cat
shell: |
cat /tmp/192.168.88.104/tmp/join.sh
- name: put the join.sh
hosts: nodes hosts: nodes
remote_user: prlab remote_user: prlab
become: true become: true
...@@ -59,7 +42,7 @@ ...@@ -59,7 +42,7 @@
name: git name: git
state: present state: present
- name: git clone - name: git clone
ansible.builtin.git: ansible.builtin.git:
repo: https://git.prlab.io/andrewli315/k8s-install repo: https://git.prlab.io/andrewli315/k8s-install
dest: /home/prlab/k8s/k8s-install dest: /home/prlab/k8s/k8s-install
...@@ -74,10 +57,42 @@ ...@@ -74,10 +57,42 @@
echo "Install finish" echo "Install finish"
args: args:
chdir: /home/prlab/k8s/k8s-install chdir: /home/prlab/k8s/k8s-install
- name: copy join.sh
- name: retrieve join.sh
hosts: cp
remote_user: prlab
become: true
become_user: root
tasks:
- name: get join command
shell: |
echo "$(kubeadm token create --print-join-command)" > /tmp/join.sh
chmod +x /tmp/join.sh
- name: copy file
fetch:
src: '/tmp/join.sh'
dest: '/tmp'
- name: get the command line
hosts: localhost
tasks:
- name: mv join.sh
shell: |
cp /tmp/{{cp_ip}}/tmp/join.sh /tmp/join.sh
chmod +x /tmp/join.sh
- name: join to k8s cp
hosts: nodes
remote_user: prlab
become: true
become_user: root
tasks:
- name: get join command shell script
copy: copy:
src: /tmp/192.168.88.104/tmp/join.sh src: /tmp/join.sh
dest: /tmp/join.sh dest: /tmp/join.sh
- name: execute - name: join to cluster
shell: | shell: |
sh /tmp/join.sh sh /tmp/join.sh
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment