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 2bd8a9c2
authored
Sep 26, 2020
by
tingweiwang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决add_node.sh node节点安装docker没有分发定制flannel配置的docker.service
1 parent
1e9ddaf6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
script/k8s/add_node.sh
script/k8s/add_node.sh
View file @
2bd8a9c
...
...
@@ -62,6 +62,8 @@ ansible new_node -m copy -a "src=/root/k8s/config/daemon.json_cpu dest=/tmp/"
echo
"判断当前节点是gpu,还是cpu节点,根据节点不同,完成不同操作&& sleep 2"
ansible new_node -m shell -a
'if [ `lspci |grep -i nvidia|wc -l` -gt 0 ]; then echo "gpu节点安装docker" && apt install nvidia-docker2 docker-ce --allow-unauthenticated -y; else echo "cpu节点安装docker"&& apt install docker-ce --allow-unauthenticated -y ; fi'
ansible new_node -m shell -a
'if [ `lspci |grep -i nvidia|wc -l` -gt 0 ]; then echo "gpu节点分发自己节点tmp目录下的daemon.json" && mv /tmp/daemon.json_gpu /etc/docker/daemon.json; else echo "cpu节点分发自己节点tmp目录下的daemon.json"&& mv /tmp/daemon.json_cpu /etc/docker/daemon.json; fi'
echo
"为新加节点拷贝自定义docker.service"
&&
sleep 3
&&
\
ansible new_node -m copy -a
"src=/root/k8s/service/docker.service dest=/lib/systemd/system/docker.service mode=755"
ansible new_node -m shell -a
"service docker restart"
ansible new_node -m shell -a
"service docker status"
ansible new_node -m shell -a
"cat /etc/docker/daemon.json"
...
...
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