ConfigMap to Substitute values

Hi friends

Is there a way for me to reference a config map in mongodb percona server helm values.yaml

My usecase is that i need to substitute ${db_name} with a value found in a config map

finalizers:
  - delete-psmdb-pods-in-order
  - delete-psmdb-pvc
nameOverride: ${db_name}
unsafeFlags:
  replsetSize: true
upgradeOptions:
  apply: disabled
image:
  repository: percona/percona-server-mongodb
  tag: 7.0.11-6-multi
replsets:
  rs0:
    name: rs0
    size: 1
    tolerations:
      - key: "karpenter/mongodb"
        operator: "Exists"
        effect: "NoSchedule"
    nodeSelector:
      karpenter-node-pool: mongodb
    configuration: |
      net:
        ipv6: true
    expose:
      enabled: true
      exposeType: LoadBalancer
      serviceAnnotations:
        service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: preserve_client_ip.enabled=false
        service.beta.kubernetes.io/aws-load-balancer-attributes: access_logs.s3.enabled=true,access_logs.s3.bucket=geeiq-test-lb-access-logs,access_logs.s3.prefix=${access_log_prefix}
        service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
        service.beta.kubernetes.io/aws-load-balancer-scheme: internal
        service.beta.kubernetes.io/aws-load-balancer-ip-address-type: dualstack
    volumeSpec:
      pvc:
        storageClassName: mongodb
        resources:
          requests:
            storage: 250Gi
    sidecars:
      - image: percona/mongodb_exporter:0.40
        name: metrics
        env:
          - name: EXPORTER_USER
            valueFrom:
              secretKeyRef:
                name: ${db_name}-secrets
                key: MONGODB_CLUSTER_MONITOR_USER
          - name: EXPORTER_PASS
            valueFrom:
              secretKeyRef:
                name: ${db_name}-secrets
                key: MONGODB_CLUSTER_MONITOR_PASSWORD
          - name: POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
          - name: MONGODB_URI
            value: "mongodb://$(EXPORTER_USER):$(EXPORTER_PASS)@[$(POD_IP)]:27017"
        args:
          [
            "--discovering-mode",
            "--compatible-mode",
            "--collect-all",
            "--mongodb.uri=$(MONGODB_URI)",
          ]
backup:
  enabled: false
sharding:
  enabled: false

For example:

Allowes me

  envValueFrom:
    DATABASE_REPLICA_HOST:
      secretKeyRef:
        name: prod-rds
        key: REPLICA_HOST


# allows me to use this below

      - name: MySQL 
        type: mysql 
        url: $DATABASE_REPLICA_HOST

I think lookup function can help with that.

To be more detailed - our default helm chart will not allow you to do that, but you can fine tune our helm chart and rely on a lookup function.

We might think on how this can be implemented to support various use cases and be useful for a broader community, but for now you may try a fine tuning approach.