Docker daemon not getting options from flannel_docker_opts.env #1659
Comments
Is |
@crawford Is there anything special for enabling it? All I have is this piece in the - name: docker.service
command: start
drop-ins:
- name: 50-require-flannel.conf
content: |
[Unit]
Requires=flanneld.service
After=flanneld.service Also, the same |
Enabling the service allows systemd to manage the startup (which usually results in that service starting before coreos-cloudinit). You can check to see if it's enabled with |
@crawford Here is the output
|
Okay, that looks fine. I tried reproducing the issue with the config you provided and was unable to do so. I watched as systemd waited for Can you attach the output of |
@crawford Thanks. Here is the output:
Just out of curiosity, did you test on Alpha 1221 version? |
I was actually able to reproduce the failure. |
To work around the issue, you can use the following config (I made flannel-docker-opts.service a oneshot): #cloud-config
coreos:
units:
- name: etcd2.service
command: start
- name: flannel-docker-opts.service
drop-ins:
- name: oneshot.conf
content: |
[Service]
Type=oneshot
Restart=no
- name: flanneld.service
command: start
drop-ins:
- name: 50-network-config.conf
content: |
[Service]
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.100.0.0/16" }'
- name: docker.service
command: start
drop-ins:
- name: 50-require-flannel.conf
content: |
[Unit]
Requires=flanneld.service
After=flanneld.service |
@crawford Yup that worked. Would you mind explaining the |
|
@crawford Great. Thanks! |
@crawford Can you please consider re-opening this? I'm still able to re-produce this bug in Beta 1235.1.0. Please see this gist.
|
@zihaoyu docker needs to wait for |
|
Oh, I forgot you were using coreos-cloudinit. I don't have a good solution for you. Your two options are either switch to Ignition (preferred) or restructure your cloud-config to ensure the options are created. Something like this: #cloud-config
coreos:
units:
- name: etcd2.service
command: start
- name: flanneld.service
command: start
drop-ins:
- name: 50-network-config.conf
content: |
[Service]
ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{ "Network": "10.100.0.0/16" }'
- name: flannel-docker-opts.service
command: start
- name: docker.service
command: start
drop-ins:
- name: 50-require-flannel.conf
content: |
[Unit]
Requires=flanneld.service
After=flanneld.service |
@crawford OK I will check out Ignition. |
Issue Report
Bug
CoreOS Version
Environment
CoreOS on AWS.
Expected Behavior
Docker daemon gets the
--bip
and other command line options that are generated by flanneld and are available in/run/flannel/flannel_docker_opts.env
.Actual Behavior
Docker daemon starts without
--bip
and other command line flags. Below is mycloud-config
YAML passed asuser-data
:And I can see the generated
flannel_docker_opts.env
:However, docker daemon starts without these flags:
Interestingly, if I restart
docker.service
, Docker daemon is able to pick up the flags:I wonder if there is a problem in the order in which services are started by systemd? I looked through the unit files of
flanneld.service
,flannel-docker-opts.service
, anddocker.service
, they all seem to be in correct order:flanneld
->flannel-docker-opts
->docker
.Reproduction Steps
user-data
.Other Information
CoreOS Stable and Beta AMIs work correctly at the moment. Alpha is broken. I noticed that Alpha ships with Docker 1.12, wondering if that's the problem.
The text was updated successfully, but these errors were encountered: