Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加自定义Docker和Kubelet存储目录 #305

Merged
merged 2 commits into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions roles/docker/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ LOG_DRIVER: "json-file"
LOG_LEVEL: "warn"
LOG_MAX_SIZE: "10m"
LOG_MAX_FILE: 3

# docker容器存储目录
STORAGE_DIR: "/var/lib/docker"
3 changes: 2 additions & 1 deletion roles/docker/templates/daemon.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"log-opts": {
"max-size": "{{ LOG_MAX_SIZE }}",
"max-file": "{{ LOG_MAX_FILE }}"
}
},
"graph": "{{ STORAGE_DIR }}"
}
2 changes: 2 additions & 0 deletions roles/kube-node/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 默认使用kube-proxy的 'iptables' 模式,可选 'ipvs' 模式(experimental)
PROXY_MODE: "iptables"

# Kubelet 根目录
KUBELET_ROOT_DIR: "/var/lib/kubelet"
1 change: 1 addition & 0 deletions roles/kube-node/templates/kubelet.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ExecStart={{ bin_dir }}/kubelet \
--fail-swap-on=false \
--anonymous-auth=false \
--logtostderr=true \
--root-dir={{ KUBELET_ROOT_DIR }} \
--v=2
#kubelet cAdvisor 默认在所有接口监听 4194 端口的请求, 以下iptables限制内网访问
ExecStartPost=/sbin/iptables -A INPUT -s 10.0.0.0/8 -p tcp --dport 4194 -j ACCEPT
Expand Down