Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Last active July 13, 2020 20:57
Show Gist options
  • Save rms1000watt/6aa247e1f25fb6952ba3b1c3fa2d3be1 to your computer and use it in GitHub Desktop.
Save rms1000watt/6aa247e1f25fb6952ba3b1c3fa2d3be1 to your computer and use it in GitHub Desktop.
Get & Set Kubernetes Secret Value
kubectl get secret app1 -o jsonpath="{.data.MYSQL_CONN}" | base64 --decode
cs=$(echo -n "mysql://user:pass@host:port/db" | base64)
kubectl patch secret app1 -p='{"data":{"MSQL_CONN": "'"${cs}"'"}}' -v=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment