name option is mandatory and expects a string defining the name of the profile.
replace option expects an object with the following (optional) fields:
imageswhich will replace the entire
imagessection of the devspace.yaml
deploymentswhich will replace the entire
deploymentssection of the devspace.yaml
devwhich will replace the entire
devsection of the devspace.yaml
dependencieswhich will replace the entire
dependenciessection of the devspace.yaml
hookswhich will replace the entire
hookssection of the devspace.yaml
Example: Using Config Replace For Profile
- The above example defines 1 profile:
- When using the profile
production, the config section
imageswould be entirely replaced and additionally, 1 patch would be applied.
- The resulting config used in-memory when the profile
productionis used would look like this:
Combine Replace & Patches
As shown in this example, it is possible to use
patch options in combination.
parent option is optional and expects the name of another profile which should be applied before this profile. The kind of profile inheritance that the
parent option provides can help to reduce redundancy when multiple profiles need to change the config in a similar way.
A parent profile is applied before the profile that defines the parent. A parent profile can have a parent of its own.
Example: Defining a Parent Profile
production profile is active, the
patches statements configured in
staging would be applied first because of the
parent: staging statement in line 16. After applying the
staging profile, DevSpace would additionally apply the currently active
production profile. In this example, the
production profile is based on the
staging profile and the only difference is that the
production profile adds another container to the
backend deployment which is using the image
devspace print -p [profile]
The following command is useful to verify that the profile modifies the config as intended:
The above command would print the config after applying all profile
replace statements as well as after replacing all config variables.