이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 9. Configuring default mounts for Secrets and PVCs
You can configure Persistent Volume Claims (PVCs) and Secrets mount in your Red Hat Developer Hub deployment. Use annotations to define the custom mount paths and specify the containers to mount them to.
9.1. Configuring mount paths for Secrets and PVCs 링크 복사링크가 클립보드에 복사되었습니다!
By default, the mount path is the working directory of the Developer Hub container. If you do not define the mount path, it defaults to /opt/app-root/src.
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 where the PVC mounts
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: <my_claim> annotations: rhdh.redhat.com/mount-path: /mount/path/from/annotationwhere:
rhdh.redhat.com/mount-path-
Specifies which mount path the PVC mounts to (in this case,
/mount/path/from/annotationdirectory). - <my_claim>
- Specifies the PVC to mount.
To 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> annotations: rhdh.redhat.com/mount-path: /mount/path/from/annotationwhere:
- <my_secret>
- Specifies the Secret name.
9.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: *ImportantSet
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"NoteThis configuration mounts the
<my_claim>PVC to theinit-dynamic-pluginsandbackstage-backendcontainers.