Updating a User-Created Service

Updating the configuration of a deployed app

You can easily view and update the configuration of a deployed app by using the dcos marathon CLI commands.

The process for updating packages from the UI is different. For more information, see the documentation.

Update all Environment Variables

Use the dcos marathon app update command from the DC/OS CLI to update any aspect of your service’s JSON service definition. For instance, follow the instructions below to update the environment variable (env field) of the service definition.

  1. dcos marathon app update test-app env='{"APISERVER_PORT":"25502"}'

This will replace the entire env field with the new value specified. Run the command below to see the result of your update:

  1. dcos marathon app show test-app | jq '.env'

Using a JSON File

The env field can also be updated by specifying a JSON file in a command argument.

  1. Save the existing environment variables to a file:
  1. dcos marathon app show test-app | jq .env >env_vars.json

The file will contain the JSON for the env field:

  1. { "SCHEDULER_DRIVER_PORT": "25501", }
  1. Edit the env_vars.json file. Make the JSON a valid object by enclosing the file contents with { "env" :} and add your update:
  1. { "env" : { "APISERVER_PORT" : "25502", "SCHEDULER_DRIVER_PORT" : "25501" } }
  1. Specify this CLI command with the JSON file specified:
  1. dcos marathon app update test-app < env_vars.json
  1. View the results of your update:
  1. dcos marathon app show test-app | jq '.env'