# Create a secret for imagePullSecrets on K8S

**URL:** <https://community.doppler.com/t/create-a-secret-for-imagepullsecrets-on-k8s/1335>\
**Category:** Need Help\
**Created:** [September 17, 2023, 6:17pm UTC](https://community.doppler.com/t/create-a-secret-for-imagepullsecrets-on-k8s/1335 "2023-09-17T18:17:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmcgeobroker](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/dmcgeobroker/32/908_2.png) [@dmcgeobroker](https://community.doppler.com/u/dmcgeobroker)\
**Post date:** [September 17, 2023, 6:17pm UTC](https://community.doppler.com/t/create-a-secret-for-imagepullsecrets-on-k8s/1335/1 "2023-09-17T18:17:21Z")

</div>

I need to create a secret on Kubernetes to store the dockerconfigjson  
Here is what I tried to do

```auto
apiVersion: secrets.doppler.com/v1alpha1
kind: DopplerSecret
metadata:
  name: prod-dockerhub
  namespace: doppler-operator-system
spec:
  tokenSecret:
    name: doppler-docker-secret
  managedSecret:
    name: regcred
    namespace: my-namespace
    type: kubernetes.io/dockerconfigjson

```

The problem is that I need to create a secret the the key = .dockerconfigjson  
and doppler won’t let me create a secret starting with a dot and with lowercase

This is the error I get when I apply the manifest

```auto
kubectl describe DopplerSecret -A

Secret update failed: Failed to create Kubernetes secret: Secret "regcred" is invalid: data[.dockerconfigjson]: Required value

```

 ![Screenshot from 2023-09-17 15-16-57](https://us1.discourse-cdn.com/flex016/uploads/doppler/original/1X/01ce88f91964c35728e13d3754944fd60488a5a1.png)

---

<div class="post-metadata">

**Author:** ![watsonian](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/watsonian/32/267_2.png) [@watsonian](https://community.doppler.com/u/watsonian)\
**Post date:** [September 19, 2023, 5:33pm UTC](https://community.doppler.com/t/create-a-secret-for-imagepullsecrets-on-k8s/1335/2 "2023-09-19T17:33:10Z")

</div>

Hi @dmcgeobroker!

Welcome to the Doppler Community!

If I’m following you right, you have a secret in Doppler that you want to be mapped into k8s with a different name (e.g., `DOCKERCONFIGJSON` to `.dockerconfigjson`). Is that right?

If so, then you should actually be able to do that using a newer feature we added to the operator:

> <https://github.com/DopplerHQ/kubernetes-operator/blob/main/docs/custom_types_and_processors.md>

The TL;DR is that you’d setup a processor like this:

```auto
apiVersion: secrets.doppler.com/v1alpha1
kind: DopplerSecret
metadata:
  name: prod-dockerhub
  namespace: doppler-operator-system
spec:
  tokenSecret:
    name: doppler-docker-secret
  managedSecret:
    name: regcred
    namespace: my-namespace
    type: kubernetes.io/dockerconfigjson
  processors:
    DOCKERCONFIGJSON:
      type: plain
      asName: .dockerconfigjson

```

This would result in a secret named `regcred` with one entry named `.dockerconfigjson` with the contents you expect. Give it a shot and let me know if that’ll accomplish what you’re after!

Regards,  
-Joel

---

<div class="post-metadata">

**Author:** ![julian.sotoca](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@julian.sotoca](https://community.doppler.com/u/julian.sotoca)\
**Post date:** [October 26, 2023, 5:58pm UTC](https://community.doppler.com/t/create-a-secret-for-imagepullsecrets-on-k8s/1335/3 "2023-10-26T17:58:19Z")

</div>

I had the same problem and your solution works great!
