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
447a3ec2
Commit
447a3ec2
authored
Apr 10, 2024
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distinguish cp and node installation
parent
65b27353
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
k8s-install.sh
k8s-install.sh
+24
-9
No files found.
k8s-install.sh
View file @
447a3ec2
...
@@ -227,12 +227,24 @@ copy_host_file(){
...
@@ -227,12 +227,24 @@ copy_host_file(){
fi
fi
}
}
add_to_master
(){
install_k8s_node
{
echo
"Add node to CP cmd"
export
KUBE_VERSION
=
v1.28
cmd
=
$(
kubeadm token create
--print-join-command
)
eval
"DEBIAN_FRONTEND=noninteractive apt-get update -y"
echo
$cmd
# apt-transport-https may be a dummy package; if so, you can skip that package
eval
"DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https ca-certificates curl gpg"
curl
-fsSL
https://pkgs.k8s.io/core:/stable:/
$KUBE_VERSION
/deb/Release.key | gpg
--yes
--dearmor
-o
/etc/apt/keyrings/kubernetes-apt-keyring.gpg
# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list
rm
/etc/apt/sources.list.d/kubernetes.list
echo
"deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/
$KUBE_VERSION
/deb/ /"
|
tee
/etc/apt/sources.list.d/kubernetes.list
eval
"DEBIAN_FRONTEND=noninteractive apt-get update -y"
eval
"DEBIAN_FRONTEND=noninteractive apt-get install -y kubelet kubeadm kubectl"
eval
"DEBIAN_FRONTEND=noninteractive apt-mark hold kubelet kubeadm kubectl"
}
}
main
(){
main
(){
...
@@ -242,11 +254,14 @@ main(){
...
@@ -242,11 +254,14 @@ main(){
copy_host_file
$1
copy_host_file
$1
prerequisite
prerequisite
install_cri
install_cri
install_k8s
if
[[
$2
==
"cp"
]]
;
then
echo
"COPY K8S Config"
install_k8s
copy_k8s_config
echo
"COPY K8S Config"
echo
"Please add to Cluster CP"
copy_k8s_config
echo
"Finish Setup K8S"
echo
"Finish Setup K8S"
else
install_k8s_node
fi
exit
exit
else
else
...
...
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