DopplerHQ / kubernetes-operator

Apache License 2.0
44 stars 18 forks source link

[Kubernetes] imagePullSecrets: unable to deploy #56

Closed jhoelzel closed 8 months ago

jhoelzel commented 8 months ago

Thanks again for a nice solution to our problems ;)

When deploying custom images to Kubernetes from a private image repository, an acces configuration is required. Link to Docs

This secret is defined by a key called " .dockerconfigjson ". You can probably see where im going with this:

There is currently no way to deploy it with the kubernetes operator. https://docs.doppler.com/docs/kubernetes-operator

We really would appreciate a solution to this as the only secret "not dopplered" are our image pull secrets =) The best solution is probably a Name Transformer.

Thank you!

nmanoogian commented 8 months ago

Hi @jhoelzel! Thanks for reaching out!

I think you might be able to use custom types and processors to achieve this. It might look something like:

apiVersion: secrets.doppler.com/v1alpha1
kind: DopplerSecret
metadata:
  name: my-dopplersecret
  namespace: doppler-operator-system
spec:
  tokenSecret:
    name: doppler-token-secret
  managedSecret:
    name: doppler-config-secret
    namespace: default
    type: kubernetes.io/dockerconfigjson
  processors:
    DOCKER_CONFIG_JSON: # This is the name of the secret in Doppler to use for the `.dockerconfigjson` contents
      asName: .dockerconfigjson

Can you give this a go and let me know if it works for you?

jhoelzel commented 8 months ago

This has worked brilliantly for me thank you!