0
0
Kubernetesdevops~5 mins

Base64 encoding in Secrets in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Base64 encoding in Kubernetes Secrets?
Base64 encoding is a way to convert data into a text format using letters, numbers, and symbols. Kubernetes Secrets use Base64 to safely store sensitive data like passwords in YAML files.
Click to reveal answer
beginner
Why does Kubernetes require Secret data to be Base64 encoded?
Kubernetes requires Base64 encoding to ensure that binary or special characters in secret data are safely stored in YAML files, which only support text. It is not encryption but a simple text conversion.
Click to reveal answer
beginner
How do you encode a password 'mypassword' to Base64 on a Linux terminal?
Use the command: echo -n 'mypassword' | base64. The -n avoids adding a new line. This outputs the Base64 encoded string.
Click to reveal answer
beginner
How do you decode Base64 encoded data back to plain text?
Use the command: echo 'encoded_string' | base64 --decode. Replace encoded_string with your Base64 text to get the original data.
Click to reveal answer
intermediate
What is the difference between Base64 encoding and encryption in Kubernetes Secrets?
Base64 encoding only changes data format to text; it does not hide or protect data. Encryption actually scrambles data to keep it secret. Kubernetes Secrets use Base64 encoding by default but can be combined with encryption for security.
Click to reveal answer
Why is Base64 encoding used in Kubernetes Secrets?
ATo compress the secret data
BTo encrypt the secret data
CTo convert data into a text format safe for YAML files
DTo hash the secret data
Which command encodes the string 'hello' to Base64 on Linux?
Aecho -n 'hello' | base64
Becho 'hello' | base64 --decode
Cbase64 encode 'hello'
Dbase64 -d 'hello'
What does Base64 decoding do?
ACompresses the data
BEncrypts the data
CHashes the data
DConverts encoded text back to original data
Is Base64 encoding a secure way to protect secrets?
ANo, it only changes data format
BNo, it hashes the data
CYes, it compresses the data
DYes, it encrypts the data
Where do you place Base64 encoded data in a Kubernetes Secret YAML?
AUnder the <code>metadata</code> field
BUnder the <code>data</code> field
CUnder the <code>spec</code> field
DUnder the <code>status</code> field
Explain why Kubernetes Secrets require Base64 encoding and how to encode and decode secret data.
Think about how text files handle special characters.
You got /4 concepts.
    Describe the difference between Base64 encoding and encryption in the context of Kubernetes Secrets.
    One is about format, the other about security.
    You got /4 concepts.