diff --git a/example/hosts.allinone b/example/hosts.allinone index fe9d1d6..f233ebb 100644 --- a/example/hosts.allinone +++ b/example/hosts.allinone @@ -45,6 +45,12 @@ NODE_PORT_RANGE="20000-40000" # Cluster DNS Domain CLUSTER_DNS_DOMAIN="cluster.local." +# Docker data ROOT +# STORAGE_DIR="/var/lib/docker" + +# Docker insecure registry +# INSECURE_REG='["127.0.0.1/8"]' + # -------- Additional Variables (don't change the default value right now)--- # Binaries Directory bin_dir="/opt/kube/bin" diff --git a/example/hosts.multi-node b/example/hosts.multi-node index 18472cc..9afb075 100644 --- a/example/hosts.multi-node +++ b/example/hosts.multi-node @@ -49,6 +49,12 @@ NODE_PORT_RANGE="20000-40000" # Cluster DNS Domain CLUSTER_DNS_DOMAIN="cluster.local." +# Docker data ROOT +# STORAGE_DIR="/var/lib/docker" + +# Docker insecure registry +# INSECURE_REG='["127.0.0.1/8"]' + # -------- Additional Variables (don't change the default value right now) --- # Binaries Directory bin_dir="/opt/kube/bin" diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index 1593d99..6b3b163 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -16,3 +16,6 @@ ENABLE_MIRROR_REGISTRY: true # 设置 docker 仓库镜像 REG_MIRRORS: '["https://dockerhub.azk8s.cn", "https://docker.mirrors.ustc.edu.cn"]' + +# 信任的HTTP仓库 +INSECURE_REG: '["127.0.0.1/8"]' diff --git a/roles/docker/templates/daemon.json.j2 b/roles/docker/templates/daemon.json.j2 index 7036543..358ebbb 100644 --- a/roles/docker/templates/daemon.json.j2 +++ b/roles/docker/templates/daemon.json.j2 @@ -5,6 +5,7 @@ {% if ENABLE_REMOTE_API %} "hosts": ["tcp://0.0.0.0:2376", "unix:///var/run/docker.sock"], {% endif %} + "insecure-registries": {{ INSECURE_REG }}, "max-concurrent-downloads": 10, "log-driver": "{{ LOG_DRIVER }}", "log-level": "{{ LOG_LEVEL }}",