docker-archive / for-aws

92 stars 26 forks source link

Provide a way to customize daemon configurations #144

Open kinghuang opened 6 years ago

kinghuang commented 6 years ago

The Docker for AWS CloudFormation template generates daemon.json files for both managers and workers. But, there is no way to add additional daemon configurations without modifying the template.

Expected behavior

There should be a template parameter to insert additional content into the daemon.json file for managers and workers. For example, there could be ManagerDaemonConfigs and WorkerDaemonConfigs parameters that take literal JSON object members. The CF template can then add it to the generated daemon.json file, adding a leading , as appropriate.

CloudFormation Parameter:

ParameterKey=ManagerDaemonConfigs,ParameterValue='"metrics-addr": "0.0.0.0:9323"'

Resulting config:

{"experimental": true, "labels":["os=linux", "region=us-west-2", "availability_zone=us-west-2b", "instance_type=t2.micro", "node_type=manager" ]
, "metrics-addr": "0.0.0.0:9323"
 }

Note: This does not check for conflicts between the pre-defined configs and additional configs.

Actual behavior

There is no way insert additional content into daemon.json.

Information

Relates to #101, #40, and #23.

FrenchBen commented 6 years ago

@kinghuang it's true that you can't add additional daemon config post deployment, but you can do this prior to deploying your cluster. If you look at the latest template, there's already a piece of the userData that does this. Add your custom parameters there and you'll be all set.

kinghuang commented 6 years ago

@FrenchBen Yes, I'm aware of modifying the UserData sections to add configs, which is what I'm doing right now. But, my point is it would be better if there were template parameters to add configs, with support in the UserData script to insert the additional configs, if specified.

That's why I mentioned adding a leading ,, and the example result shows the actual output based on the current UserData script.