Docker Community Forums

Share and learn in the Docker community.

Using existing config file during installation


(Eric Millinder) #1

I want to specify an existing config file during ucp installation but cannot see from the documentation how to do this.

I’m following the “ucp-configuration-file” guide to generate the config file. In the guide, it states that I can “Install one swarm and use the UCP web UI to configure it as desired, extract the configuration file, edit it as needed, and use the edited config file to make copies to multiple other swarms.”

The documentation in the ucp/install guide describes “–existing-config” as “Use an existing UCP config during this installation. The install fails if a config is not found.”

Where is the (phase 2) installer looking for this configuration? I was hoping that the installer would at least give a hint. Nope. All it reports is “Could not find any UCP configs.”

I’ve tried

  • mounting the config to /etc/ucp/ucp.toml
  • mounting the config to /config/ucp.toml (like the license file can be done)
  • specifying --existing-config /path/to/ucp.toml
  • catting the contents as --existing-config $(cat /path/to/ucp.toml)

What am I doing wrong?


(yannis) #2

did you find an answer?


(Eric Millinder) #3

The answer was that using an existing configuration file during a fresh installation is not supported. I still do not understand the use case that --existing-config supports. Maybe it could be useful if spinning up multiple ucp clusters? I’m definitely not trying to do that though.

I’m currently doing the ucp install then dumping the configuration to disk, merging it with my saved settings and then updating the ucp config using the steps described in https://docs.docker.com/ee/ucp/admin/configure/ucp-configuration-file/#inspect-and-modify-existing-configuration.

I suppose that merging the configs instead of directly overwriting them is helpful when new configuration attributes are added. Like when all the kube settings were added in 3.0.0.

I was pointed towards using the api to set up ldap.
https://success.docker.com/article/register-ldap-from-api. That might be something to look into. It just seemed tedious to do with Ansible.


(Christophe Lehy) #4

@ericmillinder And what (which tool) do you use to merge config files. Don;t want to do that manually. My use case is that I want to specify custom flags to kubelet (need to install ucp first, then extract the current config file, add my flags, then import new config). Anyone knows a tool that will be able to merge toml files from the command line ?