Add individual files without replacing directories
Add individual files from an OpenShift Secret or a ConfigMap to a target directory without replacing existing contents. Use a subPath mount when the target directory already contains files that must be preserved.
Before you begin
- You have an active
ocsession with administrative permissions to the OpenShift cluster. See Getting started with the CLI. - You have a running instance of Red Hat OpenShift Dev Spaces.
Procedure
Results
- Verify that the file is mounted in the target container:
oc exec -n openshift-devspaces deploy/<DEPLOYMENT_NAME> -- ls <TARGET_PATH>/<FILE_NAME>Each data item name in the object corresponds to a file name at the mount path. For example, a data item named
ca.crtwith a mount path of/dataresults in a file at/data/ca.crt.Important If you update the Secret or ConfigMap data, re-create the object entirely to make the changes visible in the OpenShift Dev Spaces container.