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 af66bffb
authored
Jun 30, 2020
by
wangtingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复1-init脚本找不到问题
1 parent
bb0a3813
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
script/k8s/add_node.sh
script/k8s/deploy-gpu-k8s.sh
script/k8s/add_node.sh
View file @
af66bff
...
...
@@ -12,7 +12,7 @@ do
sshpass -p
$password
ssh-copy-id -i ~/.ssh/id_rsa.pub -p
$port
-o
StrictHostKeyChecking
=
no root@
$ip
done
########################################
ansible new_node -m script -a
"/root/k8s/script/k8s/1-init.sh"
ansible new_node -m script -a
"/root/k8s/script/k8s/
backup/
1-init.sh"
ansible new_node -m shell -a
"mkdir /opt/kubernetes/{cfg,bin,ssl,log} -pv"
scp /opt/kubernetes/ssl/ca
*
$new_node
:/opt/kubernetes/ssl/
#########################################flannel########################################
...
...
script/k8s/deploy-gpu-k8s.sh
View file @
af66bff
...
...
@@ -195,9 +195,9 @@ ansible master -m copy -a "src=/opt/kubernetes/cfg/flanneld dest=/opt/kubernetes
cp /root/k8s/service/flanneld.service /lib/systemd/system/
ansible master -m copy -a
"src=/lib/systemd/system/flanneld.service dest=/lib/systemd/system/ mode=755"
ansible master -m shell -a
"systemctl daemon-reload && service flanneld restart && service flanneld status && systemctl enable flanneld.service"
ansible master -m copy -a
"src=/root/k8s/service/docker.service dest=/lib/systemd/system/docker.service mode=755"
#
ansible master -m copy -a "src=/root/k8s/service/docker.service dest=/lib/systemd/system/docker.service mode=755"
####################################安装nvidia-docker2#####################################
apt install nvidia-docker2 --allow-insecure-repositories
apt install nvidia-docker2 --allow-insecure-repositories
-y
###############################安装docker###############################################
echo
"当前harbor仓库地址为
$harbor_host
,"
sed -i s/harbor_host/
$harbor_host
/g /root/k8s/config/daemon.json_gpu
...
...
@@ -206,6 +206,7 @@ ansible master -m shell -a "apt update --allow-insecure-repositories"
ansible master -m shell -a
"apt install docker-ce -y --allow-unauthenticated"
echo
"分发已修改的daemon.json文件"
ansible master -m copy -a
"src=/root/k8s/config/daemon.json_gpu dest=/etc/docker/daemon.json"
ansible master -m copy -a
"src=/root/k8s/service/docker.service dest=/lib/systemd/system/docker.service mode=755"
ansible master -m shell -a
"service docker restart"
ansible master -m shell -a
"service docker status"
ansible master -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