I have a json file with some keys like this:
{
"a":"someval"
"b":"someval"
.. more keys
}
How do I add these keys to a secret in kubernetes?
When I try $ kubectl create secret generic mysecret --from-file=file.json it returns a secret containing the file, but I want to map the contents of the file to the secret, not add the file as a secret.
Output:
$ kubectl get secret mysecret -o yaml
apiVersion: v1
data:
file.json: #base64 encoded stuff here.
kind: Secret
Wanted output:
$ kubectl get secret mysecret -o yaml
apiVersion: v1
data:
a: someval
b: someval
kind: Secret
What am I doing wrong?