Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
k8s-install
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
k8s-install
Commits
aacb16f1
Commit
aacb16f1
authored
Apr 09, 2024
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cp to user's home and generate the join cp cmd
parent
ee61d2cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
k8s-install.sh
k8s-install.sh
+12
-10
No files found.
k8s-install.sh
View file @
aacb16f1
...
@@ -206,16 +206,15 @@ eval "systemctl enable --now kubelet"
...
@@ -206,16 +206,15 @@ eval "systemctl enable --now kubelet"
eval
"kubeadm init --v=5 --config=/opt/deploy/k8s/kubeadm-config.yaml
\
eval
"kubeadm init --v=5 --config=/opt/deploy/k8s/kubeadm-config.yaml
\
--skip-phases=addon/kube-proxy"
--skip-phases=addon/kube-proxy"
export
HOME
=
/home/prlab
export
HOME
=
/home/prlab
mkdir
-p
$HOME
/.kube
cp
-i
/etc/kubernetes/admin.conf
$HOME
/.kube/config
chown
$(
id
-u
)
:
$(
id
-g
)
$HOME
/.kube/config
}
}
copy_k8s_config
(){
copy_k8s_config
(){
export
HOME
=
/home/prlab
export
USER
=
prlab
mkdir
-p
$HOME
/.kube
mkdir
-p
$HOME
/.kube
cp
-i
/etc/kubernetes/admin.conf
$HOME
/.kube/config
cp
-i
/etc/kubernetes/admin.conf
$HOME
/.kube/config
chown
$(
id
-u
)
:
$(
id
-g
)
$HOME
/.kube/config
chown
-R
$USER
:
$USER
$HOME
/.kube/
}
}
copy_host_file
(){
copy_host_file
(){
...
@@ -227,8 +226,9 @@ copy_host_file(){
...
@@ -227,8 +226,9 @@ copy_host_file(){
}
}
add_to_master
(){
add_to_master
(){
echo
"Add node to CP"
echo
"Add node to CP cmd"
#$key=kubeadm token create --print-join-command
cmd
=
$(
kubeadm token create
--print-join-command
)
echo
$cmd
}
}
main
(){
main
(){
...
@@ -239,10 +239,12 @@ main(){
...
@@ -239,10 +239,12 @@ main(){
echo
"Installing"
echo
"Installing"
copy_host_file
$1
copy_host_file
$1
if
[[
$2
==
"cp"
]]
;
then
if
[[
$2
==
"cp"
]]
;
then
prerequisite
# prerequisite
install_cri
# install_cri
install_k8s
# install_k8s
copy_k8s_config
#echo "COPY K8S Config"
#copy_k8s_config
add_to_master
else
else
add_to_master
add_to_master
fi
fi
...
...
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