Update a Config
Updating a configuration allows you to change the settings of an existing configuration. This can be useful if you want to modify the configuration of a deployment without creating a new configuration.
Updating a configuration that is used in a deployment will affect all deployments that use this configuration. This is a powerful tool as it allows you to update all running servers with a new image or configuration with one command.
Usage
odin fleet configs update [--name=IMAGE_NAME] [--command=COMMAND] [--args=ARGS] [--binary-id=
BINARY_ID]
[--restart-policy=RESTART_POLICY] [--memory=MEMORY] [--cpu=CPU] [--payload=JSON_PAYLOAD] [--dry-run]
Flags
The command will only update the fields that are provided. If you want to update multiple fields, you can provide them
all in one command. You can also provide a JSON payload to update the configuration using the usual --payload flag.
This command also support the --dry-run flag to see the JSON payload that would be sent to the API without actually
updating the configuration.
--name=<string>:
The name of the configuration.--command=<string>:
The command that should be executed when the server starts. It overwrites the command that is defined in the image.--args=<string>:
The arguments that should be passed to the command when the server starts. It overwrites the arguments that are defined in the image.--binary-id=<number>:
The ID of the binary that should be used for the server. By changing the binary, you can update all running servers of deployments linked to this configuration file.--restart-policy=<string>:
The restart policy of the server. This can bealways,on-failure, orany--memory=<number>:
The amount of memory that should be allocated to the server in GB.--cpu=<number>:
The amount of CPU that should be allocated to the server in cores.
Examples
Update the memory requirement of a configuration:
You can also update multiple fields at once:
A usual use case is to update the underlying image of a configuration. This can be done by changing the binary ID of the configuration. In this more complex example, we create a new image, wait until the image is ready to be deployed and then update the configuration to use the new image which will restart all servers with the new image.
It can be used in CI/CD pipelines to update the image of a configuration and restart all servers with the new image.
Global Flags
The following flags can be used with any ODIN CLI command:
-
--api-key=<string>The API key to use for authentication. If omitted, the CLI will use the api-key stored in the configuration file on your system. Use odin login to store the API key for subsequent commands. -
--app-id=<string>The ID of the app to use for the command. If omitted, the CLI will use the currently selected app. Use odin apps select to select an app interactively. -
--format=<string>The output format to use for the command. Supported formats arejson,value,flattenedandtable. If omitted, the CLI will use the default format specified in the configuration file. Learn more about output formatting. -
--forceForces the command to execute without prompting for confirmation. Use with caution. -
--quietSuppresses all informational output except for errors. Useful for scripting and automation.