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.
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:
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.
- Save the existing environment variables to a file:
dcos marathon app show test-app | jq .env >env_vars.json
The file will contain the JSON for the env
field:
{ "SCHEDULER_DRIVER_PORT": "25501", }
- Edit the
env_vars.json
file. Make the JSON a valid object by enclosing the file contents with{ "env" :}
and add your update:
{ "env" : { "APISERVER_PORT" : "25502", "SCHEDULER_DRIVER_PORT" : "25501" } }
- Specify this CLI command with the JSON file specified:
dcos marathon app update test-app < env_vars.json
- View the results of your update:
dcos marathon app show test-app | jq '.env'