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

debug for the expired join token

parent 3c631c23
......@@ -20,7 +20,7 @@
```
* 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 @@
./helm-install.sh
args:
chdir: /home/prlab/k8s/k8s-install
- name: execute k8s cmd
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
- name: install k8s nodes
hosts: nodes
remote_user: prlab
become: true
......@@ -59,7 +42,7 @@
name: git
state: present
- name: git clone
- name: git clone
ansible.builtin.git:
repo: https://git.prlab.io/andrewli315/k8s-install
dest: /home/prlab/k8s/k8s-install
......@@ -74,10 +57,42 @@
echo "Install finish"
args:
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:
src: /tmp/192.168.88.104/tmp/join.sh
src: /tmp/join.sh
dest: /tmp/join.sh
- name: execute
- name: join to cluster
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