https://pulumi.com logo
#general
Title
# general
f

full-dress-10026

07/25/2019, 12:00 AM
I am trying to create a Secret using Pulumi k8s:
Copy code
new k8s.core.v1.Secret("foo-test", {
    metadata: {
        name: "foo-test"
    },
    data: {
        key: "asd123"
    },
    type: "Opaque"
}, {provider: k8sProvider});
and have been getting
Copy code
error: Plan apply failed: 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 4, error found in #10 byte of ...|":"asd123"},"kind":"|..., bigger context ...|{"apiVersion":"v1","data":{"key":"asd123"},"kind":"Secret","metadata":{"labels":{"app.kuber|...
I can create the secret from the CLI just fine.
m

microscopic-florist-22719

07/25/2019, 12:00 AM
cc @gorgeous-egg-16927
c

creamy-potato-29402

07/25/2019, 7:19 AM
@full-dress-10026 that data does not appear to encode printable characters, and that error means that the API server rejected the secret as a result.
If that’s the string you want, you have to base64 encode it.
If you’re running on some kind of unix, try:
Copy code
echo -n 'asd123' | base64
not sure what oyu mean when you say you can create it from the CLI though.
f

full-dress-10026

07/25/2019, 3:24 PM
That answered my question. Thanks!
7 Views