Ce contenu n'est pas disponible dans la langue sélectionnée.

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

  1. To specify a PVC mount path, add the rhdh.redhat.com/mount-path annotation 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/annotation
    Copy to Clipboard Toggle word wrap

    where:

    rhdh.redhat.com/mount-path
    Specifies which mount path the PVC mounts to (in this case, /mount/path/from/annotation directory).
    <my_claim>
    Specifies the PVC to mount.
  2. To specify a Secret mount path, add the rhdh.redhat.com/mount-path annotation 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/annotation
    Copy to Clipboard Toggle word wrap

    where:

    <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

  1. To mount Secrets to all containers, set the rhdh.redhat.com/containers annotation to * in your configuration file:

    Example mounting to all containers

    apiVersion: v1
    kind: Secret
    metadata:
      name: <my_secret>
      annotations:
        rhdh.redhat.com/containers: *
    Copy to Clipboard Toggle word wrap

    Important

    Set rhdh.redhat.com/containers to * to mount it to all containers in the deployment.

  2. 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"
    Copy to Clipboard Toggle word wrap

    Note

    This configuration mounts the <my_claim> PVC to the init-dynamic-plugins and backstage-backend containers.

Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat