kubectl get secret <secret> \
-o json \
| jq --raw-output '. | .data."<trust-store>.jks"' \
| base64 -D > <trust-store>.jks
Bash
kubectl patch secret <secret> \
--type=json \
-p='[{"op": "replace", "path": "/data/<truststore>", "value": "'$(base64 <file>)'"}]'
Fish
kubectl patch secret <secret> \
--type=json \
-p='[{"op": "replace", "path": "/data/<truststore>", "value": "'(base64 <file>)'"}]'