}}

Install and Customize

Stable Updated: November 10, 2016

While a native Marathon instance comes installed as a part of DC/OS, you can also create Marathon instances on top of the native Marathon to make separate environments for different groups of users.

Prerequisite

Install a Single Additional Marathon instance

Default Installation

  • Enter this command from the DC/OS CLI:
    $ dcos package install marathon
    
  • Alternatively, you can install the additional Marathon instance from the Universe tab of the DC/OS web interface.

By default the DC/OS service name is marathon-user.

Custom Installation

  1. You can configure a custom installation by installing Marathon with a JSON options file. For example, if you want to specify a different name for your Marathon instance, create an options file that includes this entry, where <name> is the unique Marathon instance name:
    {"service": {"name": "marathon-<name>" }}
    
  2. Then, install Marathon with your options file specified:
    $ dcos package install marathon --options="<myconfig>.json"
    

    Tip: You can also specify a different name for your Marathon instance from the DC/OS web interface. Choose Advanced Installation when you install the package from Universe and change the Name field to your desired Marathon instance name.

Configure Group Access to the Marathon Instance

  1. Once you’ve installed Marathon, go to the DC/OS web interface. Click the System tab, select Organization, and then New Group.

  2. Choose a name for your group, then click Create.

  3. Click the name of your new group, and click Add Permission. Then, toggle to Insert Permission String. More information about permissions in DC/OS.

  4. Add the following rules to grant users in the group full access to the given Marathon instance. Consult the Marathon permissions reference for information on how to configure more fine-grained permissions.

    Permission Action
    dcos:adminrouter:service:<name-of-additional-marathon-instance:> full
    dcos:service:marathon:marathon:/:<name-of-group:> full
    dcos:service:marathon:marathon:leader/ full

    Click Add Permission, then Close.

  5. To test your configuration, add a user to the group you just created. Log out of DC/OS, then go to <dcos-url>/service/<name-of-additional-marathon-instance>. You should see the Marathon user interface.

Install Multiple Additional Marathon Instances

  1. Create a custom JSON configuration file that includes this entry, where <name> is the unique Marathon instance name:

    {"service": {"name": "marathon-<name>" }}
    

    Note: You must create a separate JSON configuration file for each Marathon instance.

  2. From the DC/OS CLI, enter this command:

    $ dcos package install --options=<config-file>.json marathon
    

    Tip: You can install multiple Marathon instances from the Universe tab of the DC/OS web interface. Choose Advanced Installation, then specify a unique name for each of your Marathon instances.

  3. Next, configure which user groups can use which Marathon instances. In this example, we’ll configure one group per Marathon instance. In the DC/OS web interface, click the System tab, select Organization, and then New Group.

  4. Choose a name for your group, then click Create.

  5. Click the name of your new group, and click Add Permission. Then, toggle to Insert Permission String. More information about permissions in DC/OS.

  6. Add the following rules to grant users in the group full access to the given Marathon instance. Consult the Marathon permissions reference for information on how to configure more fine-grained permissions.

    Permission Action
    dcos:adminrouter:service:<name-of-first-additional-marathon-instance:> full
    dcos:service:marathon:marathon:/<name-of-group:> full
    dcos:service:marathon:marathon:leader/ full

    Click Add Permission, then Close.

  7. Follow the instructions above for each of the Marathon instances you have created.

  8. To test your configuration, add a user to each of the groups you just created. Log out of DC/OS, then go to <dcos-url>/service/<name-of-additional-marathon-instance>. You should see the Marathon user interface. Test for each of your Marathon instances.

Administer Additional Marathon Instances via the DC/OS CLI

Optionally, you can modify the DC/OS CLI configuration to point to the marathon-alice instance. This allows you to administer your Marathon instance by using the DC/OS CLI.

  1. From the DC/OS CLI, set the marathon.url property to point to the marathon-alice instance, where <hostname> is the Marathon web interface hostname:
    $ dcos config set marathon.url https://<dcos-url>/service/marathon-alice/
    
  2. Verify that the the marathon.url is set. The marathon.url takes precedence over the native Marathon in DC/OS.
    $ dcos config show
    dcos config show
    core.dcos_acs_token=********
    core.dcos_url=<dcos-url>
    core.ssl_verify=false
    marathon.url=<dcos-url>/service/mymarathon
    

    Tip: You can switch back to the native Marathon instance by specifying dcos config unset marathon.url.

For more information: