Configuring Services

Using the DC/OS CLI to configure services

This topic describes how to use the CLI to configure services. You can also customize services by using the Services tab in the DC/OS UI.

  1. View the available configuration options for the service with the dcos package describe --config <package-name> command.

    1. dcos package describe --config marathon

    The output should look like:

    1. {
    2. ...
    3. "service": {
    4. "additionalProperties": false,
    5. "description": "Marathon app configuration properties.",
    6. "properties": {
    7. "cpus": {
    8. "default": 2,
    9. "description": "CPU shares to allocate to each Marathon instance.",
    10. "minimum": 0,
    11. "type": "number"
    12. },
    13. ...
    14. "instances": {
    15. "default": 1,
    16. "description": "Number of Marathon instances to run.",
    17. "minimum": 0,
    18. "type": "integer"
    19. },
    20. "mem": {
    21. "default": 1536,
    22. "description": "Memory (MB) to allocate to each Marathon instance.",
    23. "minimum": 512,
    24. "type": "number"
    25. }
    26. },
    27. ...
    28. }
    29. }
  2. Create a JSON configuration file. You can choose any name, but you might want to choose a pattern like <package-name>-config.json. For example, marathon-config.json.

    1. nano marathon-config.json
  3. Use the properties objects to build your JSON options file. For example, to change the number of Marathon CPU shares to 3 and memory allocation to 2048:

    1. {
    2. "service": {
    3. "cpus": 3.0, "mem": 2048.0
    4. }
    5. }
  4. From the DC/OS CLI, install the DC/OS service with the custom options file specified:

    1. dcos package install --options=marathon-config.json marathon

For more information, see the dcos package command reference documentation.