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
8af28bec
Commit
8af28bec
authored
Mar 26, 2024
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete install k8s
parent
0422a180
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
k8s-install.sh
k8s-install.sh
+13
-1
No files found.
k8s-install.sh
View file @
8af28bec
#!/bin/bash
# need to change to the dedicated home directory
HOME
=
/home/prlab
check_root
(){
root
=
`
whoami
`
if
[[
"
$root
"
==
"root"
]]
;
then
...
...
@@ -115,7 +118,7 @@ mkdir -p /opt/deploy/k8s/
cat
>
/opt/deploy/k8s/kubeadm-config.yaml
<<
EOF
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
controlPlaneEndpoint: "
p
k8scp1:6443"
controlPlaneEndpoint: "
d
k8scp1:6443"
bootstrapTokens:
- token: "abcdef.0123456789abcdef"
description: "kubeadm bootstrap token"
...
...
@@ -209,6 +212,12 @@ cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
chown
$(
id
-u
)
:
$(
id
-g
)
$HOME
/.kube/config
}
copy_k8s_config
(){
mkdir
-p
$HOME
/.kube
cp
-i
/etc/kubernetes/admin.conf
$HOME
/.kube/config
chown
$(
id
-u
)
:
$(
id
-g
)
$HOME
/.kube/config
}
copy_host_file
(){
if
[[
-z
$1
]]
;
then
...
...
@@ -223,10 +232,13 @@ main(){
if
check_root
;
then
#update_system
echo
"Installing"
copy_host_file
$1
prerequisite
install_cri
install_k8s
copy_k8s_config
echo
"Finish Setup K8S"
exit
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