Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
tingweiwang
/
k8s
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 07e84df5
authored
Aug 28, 2020
by
tingweiwang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test node type 判断逻辑
1 parent
b8eead73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
script/k8s/deploy-gpu-k8s.sh
script/k8s/deploy-gpu-k8s.sh
View file @
07e84df
...
@@ -201,8 +201,8 @@ ansible master -m copy -a "src=/lib/systemd/system/flanneld.service dest=/lib/sy
...
@@ -201,8 +201,8 @@ ansible master -m copy -a "src=/lib/systemd/system/flanneld.service dest=/lib/sy
ansible master -m shell -a
"systemctl daemon-reload && service flanneld restart && service flanneld status && systemctl enable flanneld.service"
ansible master -m shell -a
"systemctl daemon-reload && service flanneld restart && service flanneld status && systemctl enable flanneld.service"
###################################根据不同节点类型,安装设置docker#####################################
###################################根据不同节点类型,安装设置docker#####################################
echo
"判断当前节点是gpu,还是cpu节点,根据节点不同,完成不同操作&& sleep 2"
echo
"判断当前节点是gpu,还是cpu节点,根据节点不同,完成不同操作&& sleep 2"
lspci |grep -i vga |grep -v ASPEED >/dev/null
test
=
`
lspci |grep -i vga |wc -l >/dev/null
`
if
[
$
?
-eq 0
]
;
then
if
[
$
test
-gt 1
]
;
then
echo
"当前节点是GPU节点,开始安装gpu docker"
&&
sleep 2
&&
apt install nvidia-docker2 --allow-unauthenticated -y
echo
"当前节点是GPU节点,开始安装gpu docker"
&&
sleep 2
&&
apt install nvidia-docker2 --allow-unauthenticated -y
echo
"当前harbor仓库地址为
$harbor_host
"
echo
"当前harbor仓库地址为
$harbor_host
"
sed -i s/harbor_host/
$harbor_host
/g /root/k8s/config/daemon.json_gpu
sed -i s/harbor_host/
$harbor_host
/g /root/k8s/config/daemon.json_gpu
...
@@ -471,8 +471,8 @@ sleep 5
...
@@ -471,8 +471,8 @@ sleep 5
echo
"请手动在master节点 设置命令自动补全,命令在脚本最后一行注释"
echo
"请手动在master节点 设置命令自动补全,命令在脚本最后一行注释"
#source <(kubectl completion bash) && echo "source <(kubectl completion bash)" >> ~/.bashrc"
#source <(kubectl completion bash) && echo "source <(kubectl completion bash)" >> ~/.bashrc"
##############################################################################
##############################################################################
lspci |grep -i vga |grep -v ASPEED
test
=
`
lspci |grep -i vga |wc -l >/dev/null
`
if
[
$
?
-eq 0
]
;
then
if
[
$
test
-gt 1
]
;
then
echo
"为gpu节点打lable"
&&
sleep 1
echo
"为gpu节点打lable"
&&
sleep 1
kubectl label node
$host_name
autodl
=
true
kpl
=
true
gpu
=
true
cpu
=
true
user_job_node
=
true
internal_service_node
=
true
kubectl label node
$host_name
autodl
=
true
kpl
=
true
gpu
=
true
cpu
=
true
user_job_node
=
true
internal_service_node
=
true
else
else
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment