2.3. Mounts for default Secrets and Persistent Volume Claims (PVCs)
You can use annotations to configure mount paths and specify containers for Secrets and Persistent Volume Claims (PVCs) that are attached to the Operator default resources in your Red Hat Developer Hub deployment. This method is specific for default objects, for instance, the Backstage Deployment that the Operator manages.
By default, the mount path is /opt/app-root/src. To specify a different path, add the rhdh.redhat.com/mount-path annotation to your resource.
Procedure
To specify a PVC mount path, add the
rhdh.redhat.com/mount-pathannotation to your configuration file as shown in the following example:Example specifying the PVC mount path
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: <my_claim> # Specifies the PVC to mount annotations: # Specifies which mount path the PVC mounts to (in this case, /mount/path/from/annotation directory) rhdh.redhat.com/mount-path: /mount/path/from/annotationTo specify a Secret mount path, add the
rhdh.redhat.com/mount-pathannotation to your configuration file as shown in the following example:Example specifying where the Secret mounts
apiVersion: v1 kind: Secret metadata: name: <my_secret> # Specifies the Secret name annotations: rhdh.redhat.com/mount-path: /mount/path/from/annotation
2.3.2. Mounting Secrets and PVCs to specific containers 复制链接链接已复制到粘贴板!
By default, Secrets and PVCs mount only to the Red Hat Developer Hub backstage-backend container. You can add the rhdh.redhat.com/containers annotation to your configuration file to specify the containers to mount to.
Procedure
To mount Secrets to all containers, set the
rhdh.redhat.com/containersannotation to*in your configuration file:Example mounting to all containers
apiVersion: v1 kind: Secret metadata: name: <my_secret> annotations: rhdh.redhat.com/containers: *重要Set
rhdh.redhat.com/containersto*to mount it to all containers in the deployment.To mount to specific containers, separate the names with commas:
Example separating the list of containers
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: <my_claim> annotations: rhdh.redhat.com/containers: "init-dynamic-plugins,backstage-backend"注意This configuration mounts the
<my_claim>PVC to theinit-dynamic-pluginsandbackstage-backendcontainers.