Kubernetes MCQs – Configuration Management

21.) Which tool encrypts Kubernetes Secrets natively?

A) kubeseal
B) SealedSecrets
C) Kubernetes EncryptionConfig
D) All of the above

Answer: Option D

Explanation: All these tools help encrypt and manage secrets in a secure way.

22.) What does –from-env-file option do while creating a ConfigMap?

A) Sets volume mount path
B) Injects shell variables
C) Creates keys from environment variable files
D) Encrypts values

Answer: Option C

Explanation: It populates a ConfigMap using an environment-style file.

23.) QueWhich section defines how a Secret is mounted in a pod?stion

A) volumeMounts
B) env
C) configSpec
D) secretSpec

Answer: Option A

Explanation: The volumeMounts section defines how a Secret is exposed inside the container.

24.) Which resource allows separation of configuration and code in Kubernetes?

A) Deployment
B) ConfigMap
C) StatefulSet
D) Service

Answer: Option B

Explanation: ConfigMaps enable separation of environment-specific configurations from code.

25.) What happens if you mount a Secret as a volume?

A) It appears as a file in the pod
B) It’s stored in /etc/secrets
C) It’s converted to environment variables
D) It creates a backup

Answer: Option A

Explanation: Secrets mounted as volumes appear as files containing secret values.

26.) What happens if you try to decode a Secret and get gibberish?

A) It’s encrypted
B) It’s compressed
C) It’s invalid base64
D) It’s YAML

Answer: Option C

Explanation: Secrets must be valid Base64; otherwise, decoding fails.

27.) What field is required when creating a Secret in YAML?

A) secrets
B) data
C) env
D) params

Answer: Option B

Explanation: The data field holds encoded key-value pairs.

28.) Can a ConfigMap be used across multiple pods?

A) No
B) Only in same deployment
C) Only in stateful apps
D) Yes

Answer: Option D

Explanation: ConfigMaps are reusable across multiple pods in the same namespace.

29.) What base type is used to create Secrets in YAML?

A) v1/Secret
B) v1/config
C) SecretType
D) apiVersion/v1

Answer: Option A

Explanation: Secret YAML definitions start with kind: Secret and apiVersion: v1.

30.) Which field specifies Secret type in YAML?

A) dataType
B) secretType
C) type
D) mode

Answer: Option C

Explanation: The type field defines the type of Secret such as Opaque, dockerconfigjson, etc.

Kubernetes MCQs, Configuration Management

Leave a Reply

Your email address will not be published. Required fields are marked *