k8sp / sextant

Fully automatic installation of CoreOS+Kubernetes clusters
Apache License 2.0
91 stars 29 forks source link

CoreOS升级后docker无法正确加载flannel生成的配置 #477

Open Yancey1989 opened 7 years ago

Yancey1989 commented 7 years ago

OS Enviroment:

04-00-ac-18-05-69 ~ # cat /etc/os-release
NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1235.4.0
VERSION_ID=1235.4.0
BUILD_ID=2017-01-04-0450
PRETTY_NAME="Container Linux by CoreOS 1235.4.0 (Ladybug)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

升级后docker.service中读取的环境Environmentfile的值由/run/flannel_docker_opts.env 变为/run/flannel/flannel_docker_opts.env, 导致docker无法加载flannel生成的文件。

Yancey1989 commented 7 years ago

解决方法: 修改flanneld.service中输出docker配置文件的路径由

# Update docker options
            ExecStartPost=/usr/bin/docker run --net=host --rm --volume=/run:/run \
              ${FLANNEL_IMG} \
              /opt/bin/mk-docker-opts.sh -d /run/flannel_docker_opts.env -i

改为

# Update docker options
            ExecStartPost=/usr/bin/docker run --net=host --rm --volume=/run:/run \
              ${FLANNEL_IMG} \
              /opt/bin/mk-docker-opts.sh -d /run/flannel/flannel_docker_opts.env -i