Activity log for bug #1679301

Date Who What changed Old value New value Message
2017-04-03 20:26:54 Andrew Bruce bug added bug
2017-04-03 20:27:34 Andrew Bruce description While deploying new bay to OpenStack Mitaka, found that some generated files were incorrect: ./magnum/drivers/common/templates/kubernetes/fragments/network-config-service.sh ./magnum/drivers/common/templates/kubernetes/fragments/write-network-config.sh ./magnum/drivers/common/templates/swarm/fragments/network-config-service.sh 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: <cut> cat > $FLANNEL_CONFIG_SERVICE <<EOF [Unit] After=etcd.service Requires=etcd.service # ABr: maintain state Before=flanneld.service [Service] Type=oneshot EnvironmentFile=/etc/sysconfig/flanneld ExecStart=$FLANNEL_CONFIG_BIN [Install] WantedBy=multi-user.target EOF </cut> That last setting will prevent flanneld from starting too early - settings will be properly populated to etcd! Thanks very much. While deploying new bay to OpenStack Mitaka, found that some generated files were incorrect: ./magnum/drivers/common/templates/kubernetes/fragments/network-config-service.sh ./magnum/drivers/common/templates/kubernetes/fragments/write-network-config.sh ./magnum/drivers/common/templates/swarm/fragments/network-config-service.sh 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 three 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: <cut> cat > $FLANNEL_CONFIG_SERVICE <<EOF [Unit] After=etcd.service Requires=etcd.service # ABr: maintain state Before=flanneld.service [Service] Type=oneshot EnvironmentFile=/etc/sysconfig/flanneld ExecStart=$FLANNEL_CONFIG_BIN [Install] WantedBy=multi-user.target EOF </cut> That last setting will prevent flanneld from starting too early - settings will be properly populated to etcd! Thanks very much.
2017-05-22 14:26:20 Spyros Trigazis nominated for series magnum/mitaka
2017-05-22 14:26:20 Spyros Trigazis bug task added magnum/mitaka
2017-05-24 15:55:36 Andrew Bruce magnum/mitaka: status New In Progress
2017-05-24 15:55:36 Andrew Bruce magnum/mitaka: assignee Andrew Bruce (andybrucenet)
2017-09-27 11:14:05 OpenStack Infra magnum: status New In Progress
2017-09-27 11:14:05 OpenStack Infra magnum: assignee Javier Castillo (javcasalc)
2017-10-26 15:33:36 OpenStack Infra magnum: status In Progress Fix Released