The problem is the usage of FLANNEL_ETCD / FLANNEL_ETCD_KEY after sourcing in /etc/sysconfig/flanneld. For Fedora Atomic 25, these variables are completely different.
Upon reviewing the latest code in the OpenStack Magnum repo, I see that both the Kubernetes fragments appear updated. However, the Swarm fragment still uses:
<cut>
if ! [ "$FLANNEL_ETCD" ] && [ "$FLANNEL_ETCD_KEY" ]; then
echo "ERROR: missing required configuration" >&2
exit 1
fi
echo "creating flanneld config in etcd"
while ! curl -sf -L $ETCD_CURL_OPTIONS \
$FLANNEL_ETCD/v2/keys${FLANNEL_ETCD_KEY}/config \
-X PUT --data-urlencode value@${FLANNEL_JSON}; do
echo "waiting for etcd"
sleep 1
done
</cut>
These need to be changed to FLANNEL_ETCD_ENDPOINTS / FLANNEL_ETCD_PREFIX as was done with Kubernetes.
While in there, I request two additional changes that still affect the Swarm / Kubernetes network-config-service.sh fragments:
1. Please source in current settings from /etc/sysconfig/flanneld
2. In the fragments, escape variable references. For example, how about:
<cut>
if ! [ "\$FLANNEL_ETCD_ENDPOINTS" ] && [ "\$FLANNEL_ETCD_PREFIX" ]; then
echo "ERROR: missing required configuration" >&2
exit 1
fi
echo "creating flanneld config in etcd"
while ! curl -sf -L \$FLANNEL_ETCD_ENDPOINTS/v2/keys\${FLANNEL_ETCD_PREFIX}/config \
-X PUT --data-urlencode value@${FLANNEL_JSON}; do
echo "waiting for etcd"
sleep 1
done
</cut>
3. For both the Kubernetes and the Swarm network-config-service.sh, can you put in a dependency when setting up /etc/systemd/system/flannel-config.service? Something like:
While deploying new bay to OpenStack Mitaka, found that some generated files were incorrect:
./magnum/ drivers/ common/ templates/ kubernetes/ fragments/ network- config- service. sh drivers/ common/ templates/ kubernetes/ fragments/ write-network- config. sh drivers/ common/ templates/ swarm/fragments /network- config- service. sh
./magnum/
./magnum/
The problem is the usage of FLANNEL_ETCD / FLANNEL_ETCD_KEY after sourcing in /etc/sysconfig/ flanneld. For Fedora Atomic 25, these variables are completely different.
Upon reviewing the latest code in the OpenStack Magnum repo, I see that both the Kubernetes fragments appear updated. However, the Swarm fragment still uses:
<cut>
if ! [ "$FLANNEL_ETCD" ] && [ "$FLANNEL_ETCD_KEY" ]; then
echo "ERROR: missing required configuration" >&2
exit 1
fi
echo "creating flanneld config in etcd" ETCD/v2/ keys${FLANNEL_ ETCD_KEY} /config \ {FLANNEL_ JSON}; do
while ! curl -sf -L $ETCD_CURL_OPTIONS \
$FLANNEL_
-X PUT --data-urlencode value@$
echo "waiting for etcd"
sleep 1
done
</cut>
These need to be changed to FLANNEL_ ETCD_ENDPOINTS / FLANNEL_ETCD_PREFIX as was done with Kubernetes.
While in there, I request two additional changes that still affect the Swarm / Kubernetes network- config- service. sh fragments:
1. Please source in current settings from /etc/sysconfig/ flanneld
2. In the fragments, escape variable references. For example, how about:
<cut> ETCD_ENDPOINTS" ] && [ "\$FLANNEL_ ETCD_PREFIX" ]; then
if ! [ "\$FLANNEL_
echo "ERROR: missing required configuration" >&2
exit 1
fi
echo "creating flanneld config in etcd" ETCD_ENDPOINTS/ v2/keys\ ${FLANNEL_ ETCD_PREFIX} /config \ {FLANNEL_ JSON}; do
while ! curl -sf -L \$FLANNEL_
-X PUT --data-urlencode value@$
echo "waiting for etcd"
sleep 1
done
</cut>
3. For both the Kubernetes and the Swarm network- config- service. sh, can you put in a dependency when setting up /etc/systemd/ system/ flannel- config. service? Something like:
<cut> CONFIG_ SERVICE <<EOF etcd.service flanneld. service
cat > $FLANNEL_
[Unit]
After=etcd.service
Requires=
# ABr: maintain state
Before=
[Service] =/etc/sysconfig /flanneld $FLANNEL_ CONFIG_ BIN
Type=oneshot
EnvironmentFile
ExecStart=
[Install] multi-user. target
WantedBy=
EOF
</cut>
That last setting will prevent flanneld from starting too early - settings will be properly populated to etcd!
Thanks very much.