Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
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
5d71c26a
Commit
5d71c26a
authored
Apr 10, 2024
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit & need to validate
parents
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
0 deletions
+83
-0
.gitignore
.gitignore
+2
-0
install_k8s_nodes.yml
install_k8s_nodes.yml
+81
-0
No files found.
.gitignore
0 → 100644
View file @
5d71c26a
hosts
inventory.ini
install_k8s_nodes.yml
0 → 100644
View file @
5d71c26a
---
-
name
:
Install K8S
hosts
:
cp
remote_user
:
prlab
become
:
true
become_user
:
root
tasks
:
-
name
:
update system
apt
:
update_cache
:
yes
cache_valid_time
:
3600
-
name
:
install git
apt
:
name
:
git
state
:
present
-
name
:
git clone k8s installer
git
:
repo
:
https://git.prlab.io/andrewli315/k8s-install
dest
:
/home/prlab/k8s/k8s-install
-
name
:
copy hosts file
copy
:
src
:
./hosts
dest
:
/home/prlab/k8s/k8s-install
-
name
:
install k8s CP and helm chart
shell
:
|
./k8s-install.sh ./hosts cp
./helm-install.sh
-
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
hosts
:
nodes
remote_user
:
prlab
become
:
true
become_user
:
root
tasks
:
-
name
:
apt update
apt
:
update_cache
:
yes
cache_valid_time
:
3600
-
name
:
install git
apt
:
name
:
git
state
:
present
-
name
:
git clone
ansible.builtin.git
:
repo
:
https://git.prlab.io/andrewli315/k8s-install
dest
:
/home/prlab/k8s/k8s-install
-
name
:
copy
copy
:
src
:
./hosts
dest
:
/home/prlab/k8s/k8s-install/hosts
-
name
:
install k8s
shell
:
|
./k8s-install.sh hosts
echo "Install finish"
args
:
chdir
:
/home/prlab/k8s/k8s-install
-
name
:
copy join.sh
copy
:
src
:
/tmp/192.168.88.104/tmp/join.sh
dest
:
/tmp/join.sh
-
name
:
execute
shell
:
|
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