Last active
July 22, 2020 06:14
-
-
Save MarounMaroun/8e03f29a3c866c7aa8d1c818f10d358f to your computer and use it in GitHub Desktop.
Updating K8s secret
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -rp "What is the new access_key: " access_key | |
read -rp "What is the new secret_key: " secret_key | |
enc_access=$(echo "$access_key" | base64) | |
enc_secret=$(echo "$secret_key" | base64) | |
echo "encrypted access key: $enc_access" | |
echo "encrypted secret key: $enc_secret" | |
kubectl get secret aws-s3-key -o json | jq --arg enc_access "$enc_access" '.data["access_key"]=$enc_access' | kubectl apply -f - | |
kubectl get secret aws-s3-key -o json | jq --arg enc_secret "$enc_secret" '.data["secret_key"]=$enc_secret' | kubectl apply -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment