# Require deterministic name

**URL:** <https://forums.percona.com/t/require-deterministic-name/31332>\
**Category:** MongoDB\
**Created:** [July 1, 2024, 12:07pm UTC](https://forums.percona.com/t/require-deterministic-name/31332 "2024-07-01T12:07:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kay\_Khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kay_khan/32/17023_2.png) [@Kay\_Khan](https://forums.percona.com/u/Kay_Khan)\
**Post date:** [July 1, 2024, 12:07pm UTC](https://forums.percona.com/t/require-deterministic-name/31332/1 "2024-07-01T12:07:01Z")

</div>

Hi

I understand that if i deploy a percona mongodb server with a name “psmdb-default-internal”. It would appear that the pod name and secret name created would be `psmdb-default-interna` where the `l` is cut off.

```auto
psmdb-default-interna-rs0-0
psmdb-default-interna-secrets

```

If i set the name to be `psmdb-default`. The pod name and secret will have extra chars appended to them “psmdb-d”.

```auto
psmdb-default-psmdb-d-rs0-0
psmdb-default-psmdb-d-secrets

```

It sugguests that there is a minimum and maximum number of characters that it is looking for. do we know what this is?

This is frustrating because when i try modularize the deployment of psmdb allowing others to define a “name” i need to be able to deterministically reference the secret that is created.

```auto
        sidecars:
          - image: percona/mongodb_exporter:0.40
            name: metrics 
            env:
            - name: EXPORTER_USER
              valueFrom:
                secretKeyRef:
                  name: ${local.db_name}-secrets
                  key: MONGODB_CLUSTER_MONITOR_USER
            - name: EXPORTER_PASS
              valueFrom:
                secretKeyRef:
                  name: ${local.db_name}-secrets
                  key: MONGODB_CLUSTER_MONITOR_PASSWORD

```

${local.db\_name}-secrets // This will never be correct in both cases.

```auto
Error: secret "psmdb-default-secrets" not found

```

Now i can see in the helm chart there is a nameOverride and a fullnameOverride

> <https://github.com/percona/percona-helm-charts/blob/main/charts/psmdb-db/values.yaml#L18-L19>

I’ve not tired these yet as ive not been able to find the documentation on what they do. Could they help with this situation?

---

<div class="post-metadata">

**Author:** ![Kay\_Khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kay_khan/32/17023_2.png) [@Kay\_Khan](https://forums.percona.com/u/Kay_Khan)\
**Post date:** [July 2, 2024, 9:33am UTC](https://forums.percona.com/t/require-deterministic-name/31332/2 "2024-07-02T09:33:27Z")

</div>

I managed to resolve this with `nameOverride`
