I am trying to do the same thing with .jks and .p12 secrets Can we integrate kubernetes .pem and .yaml based secrets to doppler?
Since if i follow the same process which i done for .PEM then the files are not converting to .jks or .p12 since i am placing base64 encoded data but it is not converting to .jks or .p12 lets say this is my secret.yaml file
so i copied .p12 data to doppler ideally when i install the cert through yaml file this is the output which i am expecting if i integrate .p12 or .jks files integrate with doppler
If I’m understanding correctly, you’re wanting to store the .p12 data in Doppler and supply it as a Kubernetes secret so it can be mounted as a file in a container?
If so, the process is something like the following.
Step 1. Base64 encode .p12 file and store in Doppler:
doppler secrets set ELASTIC_CERTS_P12="$(base64 -i elastic-certificates.p12)"
Step 2. Fetch the secret from Doppler to create the Kubernetes secret :
Thank you @ryan-blunden for the quick response but the issue i am facing is how i can get the data from a .p12 file i mean when i open a .p12 file it is in encrypted way when i copy the content and add as a key in doppler and install it then the pods are not starting since the data which is coming from doppler is not the .p12 data which containers are expecting so i am not sure how can can view and copy .p12 file data and integrate with doppler
initially i tried with operator but it didn’t worked so as you suggested from above i tried manually and while when i create the secret manually this is the error i am facing
Error from server (BadRequest): error when creating “xxx.yaml”: Secret in version “v1” cannot be handled as a Secret: v1.Secret.ObjectMeta: v1.ObjectMeta.TypeMeta: Kind: Data: decode base64: illegal base64 data at input byte 0, error found in #10 byte of …| --plain)"},“kind”:"|…, bigger context …|oppler secrets get ELASTIC_CERTS_P12 --plain)"},“kind”:“Secret”,“metadata”:{“name”:"elastic-cert|…
You’re getting that error because Kubernetes is trying to parse the text $(doppler secrets get ELASTIC_CERTS_P12 --plain) as the actual secret value.
My example used a bash command to dynamically create the YAML file which is why it was able to insert the secret value into the YAML.
If you wanted the flow of saving the YAML file, then applying to Kubernetes, it would look like this:
I’ve added an engineering task to the backlog for how we can potentially support already base64 encoded secrets for the Operator and will reach out once I know more.