https://pulumi.com logo
Title
s

some-twilight-56575

07/07/2021, 3:25 PM
I am attempting to use the pulumi_tls module to populate a k8s secret how do I Base64 encode the output of the tls module for use in secrets?
b

billowy-army-68599

07/07/2021, 3:34 PM
you can either use your standard base 64 encoding package from your language, or you can pass it as
stringData
to the secret object and Kubernetes will base64 encode it for you: https://www.pulumi.com/docs/reference/pkg/kubernetes/core/v1/secret/#stringdata_nodejs
s

some-twilight-56575

07/07/2021, 4:01 PM
thanks I can create the secret the challange I have is the output of the tls module is a PEM string and I need base64 encoded for the data argument here (I am using python)
b

billowy-army-68599

07/07/2021, 4:12 PM
right, but if you pass the PEM string to the secret with
stringData
it'll base64 encode it
can you share the code you have? I can show you how it'll work