0
0
Kubernetesdevops~10 mins

Base64 encoding in Secrets in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to encode the string 'password' to base64.

Kubernetes
echo -n 'password' | [1]
Drag options to blanks, or click blank then click option'
Acat
Bbase64
Cgrep
Dawk
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands like cat or grep which do not encode data.
Forgetting the -n flag in echo which avoids adding a newline.
2fill in blank
medium

Complete the YAML snippet to define a Kubernetes Secret with base64 encoded data.

Kubernetes
apiVersion: v1
kind: Secret
metadata:
  name: mysecret
data:
  password: [1]
Drag options to blanks, or click blank then click option'
AcGFzc3dvcmQ=
Bpassword
Cpass123
DdGVzdA==
Attempts:
3 left
💡 Hint
Common Mistakes
Putting plain text instead of base64 encoded string.
Using incorrect base64 strings.
3fill in blank
hard

Fix the error in the command to decode a base64 encoded secret value.

Kubernetes
echo 'cGFzc3dvcmQ=' | [1]
Drag options to blanks, or click blank then click option'
Abase64 --encode
Bbase64 -e
Cbase64 -d
Dbase64 --help
Attempts:
3 left
💡 Hint
Common Mistakes
Using encoding flags instead of decoding.
Not using any flag, which defaults to encoding.
4fill in blank
hard

Fill both blanks to create a Kubernetes Secret YAML with a base64 encoded username and password.

Kubernetes
apiVersion: v1
kind: Secret
metadata:
  name: usersecret
data:
  username: [1]
  password: [2]
Drag options to blanks, or click blank then click option'
AdXNlcg==
Buser
CcGFzc3dvcmQ=
Dpassword
Attempts:
3 left
💡 Hint
Common Mistakes
Using plain text instead of base64 encoded strings.
Mixing up username and password values.
5fill in blank
hard

Fill all three blanks to create a Kubernetes Secret YAML with base64 encoded keys and values.

Kubernetes
apiVersion: v1
kind: Secret
metadata:
  name: appsecret
data:
  apiKey: [1]
  token: [2]
  env: [3]
Drag options to blanks, or click blank then click option'
AYXBpS2V5MTIz
BdG9rZW5WYWx1ZQ==
CcHJvZHVjdGlvbg==
Dapikey123
Attempts:
3 left
💡 Hint
Common Mistakes
Putting plain text values instead of encoded strings.
Using incorrect base64 encodings.