Add /etc/environment to flannel/etcd/kubelet

Everything is containerized in rkt. If behind proxy, flannel, etcd
and kubelet will failed to rkt fetch images and cluster creation
will failed.

Closes-Bug: #1689618
Change-Id: Ia12deeb659483980d2a20e4cba5d449167b600d0
This commit is contained in:
ArchiFleKs 2017-04-24 15:41:04 +02:00 committed by yatin
parent e2d6f249aa
commit b5531ddb21
5 changed files with 17 additions and 0 deletions

View File

@ -34,6 +34,7 @@ write_files:
fi fi
cat > $DROP_IN_FILE <<EOF cat > $DROP_IN_FILE <<EOF
[Service] [Service]
EnvironmentFile=/etc/environment
Environment=ETCD_NAME=$KUBE_NODE_IP Environment=ETCD_NAME=$KUBE_NODE_IP
Environment=ETCD_DATA_DIR=/var/lib/etcd/default.etcd Environment=ETCD_DATA_DIR=/var/lib/etcd/default.etcd
Environment=ETCD_LISTEN_CLIENT_URLS=$protocol://$KUBE_NODE_IP:2379,http://127.0.0.1:2379 Environment=ETCD_LISTEN_CLIENT_URLS=$protocol://$KUBE_NODE_IP:2379,http://127.0.0.1:2379

View File

@ -37,6 +37,7 @@ write_files:
CONF_FILE=/etc/systemd/system/kubelet.service CONF_FILE=/etc/systemd/system/kubelet.service
cat > $CONF_FILE <<EOF cat > $CONF_FILE <<EOF
[Service] [Service]
EnvironmentFile=/etc/environment
Environment=KUBELET_IMAGE_TAG=${KUBE_VERSION} Environment=KUBELET_IMAGE_TAG=${KUBE_VERSION}
Environment=KUBELET_IMAGE_REPO=${HYPERKUBE_IMAGE_REPO} Environment=KUBELET_IMAGE_REPO=${HYPERKUBE_IMAGE_REPO}
Environment="RKT_RUN_ARGS=--uuid-file-save=${uuid_file} \ Environment="RKT_RUN_ARGS=--uuid-file-save=${uuid_file} \

View File

@ -49,6 +49,7 @@ write_files:
CONF_FILE=/etc/systemd/system/kubelet.service CONF_FILE=/etc/systemd/system/kubelet.service
cat > $CONF_FILE <<EOF cat > $CONF_FILE <<EOF
[Service] [Service]
EnvironmentFile=/etc/environment
Environment=KUBELET_VERSION=${KUBE_VERSION} Environment=KUBELET_VERSION=${KUBE_VERSION}
Environment=KUBELET_ACI=${HYPERKUBE_IMAGE_REPO} Environment=KUBELET_ACI=${HYPERKUBE_IMAGE_REPO}
Environment="RKT_OPTS=--uuid-file-save=${uuid_file} \ Environment="RKT_OPTS=--uuid-file-save=${uuid_file} \

View File

@ -60,6 +60,13 @@ write_files:
ExecStartPre=/usr/bin/ln -sf /etc/flannel/options.env /run/flannel/options.env ExecStartPre=/usr/bin/ln -sf /etc/flannel/options.env /run/flannel/options.env
EOF EOF
DROP_IN_FILE=/etc/systemd/system/flanneld.service.d/50-Environment.conf
mkdir -p $(dirname $DROP_IN_FILE)
cat > $DROP_IN_FILE <<EOF
[Service]
EnvironmentFile=/etc/environment
EOF
DOCKER_FLANNEL_CONF=/etc/systemd/system/docker.service.d/40-flannel.conf DOCKER_FLANNEL_CONF=/etc/systemd/system/docker.service.d/40-flannel.conf
mkdir -p $(dirname $DOCKER_FLANNEL_CONF) mkdir -p $(dirname $DOCKER_FLANNEL_CONF)
cat > $DOCKER_FLANNEL_CONF <<EOF cat > $DOCKER_FLANNEL_CONF <<EOF

View File

@ -44,6 +44,13 @@ write_files:
ExecStartPre=/usr/bin/ln -sf /etc/flannel/options.env /run/flannel/options.env ExecStartPre=/usr/bin/ln -sf /etc/flannel/options.env /run/flannel/options.env
EOF EOF
DROP_IN_FILE=/etc/systemd/system/flanneld.service.d/50-Environment.conf
mkdir -p $(dirname $DROP_IN_FILE)
cat > $DROP_IN_FILE <<EOF
[Service]
EnvironmentFile=/etc/environment
EOF
DOCKER_FLANNEL_CONF=/etc/systemd/system/docker.service.d/40-flannel.conf DOCKER_FLANNEL_CONF=/etc/systemd/system/docker.service.d/40-flannel.conf
mkdir -p $(dirname $DOCKER_FLANNEL_CONF) mkdir -p $(dirname $DOCKER_FLANNEL_CONF)
cat > $DOCKER_FLANNEL_CONF <<EOF cat > $DOCKER_FLANNEL_CONF <<EOF