Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ansible-k8s-cluster
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wen Wei Li
ansible-k8s-cluster
Commits
cc5809cc
Commit
cc5809cc
authored
Apr 11, 2024
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug for the expired join token
parent
3c631c23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
24 deletions
+39
-24
README.md
README.md
+1
-1
install_k8s_nodes.yml
install_k8s_nodes.yml
+38
-23
No files found.
README.md
View file @
cc5809cc
...
...
@@ -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}"
`
install_k8s_nodes.yml
View file @
cc5809cc
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment