Complete the code to create a Kubernetes Secret with a password.
kubectl create secret generic mysecret --from-literal=password=[1]
The command creates a secret named mysecret with the password password123.
Complete the code to view the Secret data in base64 encoding.
kubectl get secret mysecret -o [1]This command shows the base64 encoded password stored in the secret.
Fix the error in the command to decode the Secret password.
echo [1] | base64 --decodeThis command extracts the base64 encoded password and decodes it to plain text.
Fill both blanks to create a Secret from a file and list all Secrets.
kubectl create secret generic mysecret --from-file=[1] && kubectl [2] secrets
The first command creates a secret from the file config.txt. The second command lists all secrets.
Fill all three blanks to patch a Secret with a new key and value.
kubectl patch secret mysecret -p '{{"data":{{"[1]": "[2]"}}}}' && kubectl get secret mysecret -o [3]
This command adds a new key apiKey with base64 encoded value YXBpa2V5MTIz to the secret, then shows the secret in JSON format.