I created a key/value secret in openshift. I want to retrieve the value of that key/value pair.
i tried using
oc describe secret ashish -n my-project
but it gave the value as shown below but i dont the value for my key it just shows 7bytes.
Name: ashish
Namespace: my-project
Labels: <none>
Annotations: <none>
Type: Opaque
Data
====
ashish: 7 bytes
You can get key and value using "oc get secret/SECRETNAME -o yaml" simply, but you should decode the value by base64. After you retrieve the key using "oc get -o yaml", the value can decode simply as follows.
oc get secret ashish -n my-project \
-o go-template --template="{{.data.KEY|base64decode}}"
VALUE
For example,
oc get secret ashish -n my-project \
-o go-template --template="{{.data.ashish|base64decode}}"
...value...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With