kubectl secret from file code example
Example 1: kubectl edit secret
kubectl get secret mysecret -o json | jq '.data["foo"]="YmFy"' | kubectl apply -f -
Example 2: kubectl print secret value
kubectl get secret <my_secret_name> -o 'go-template={{index .data "<key_name>"}}' | base64 -d
ex:
kubectl get secret my-secret -o 'go-template={{index .data "username"}}' | base64 -d