Bird
0
0

Given this pod spec snippet mounting a Secret as a volume, what will be the content of the file /etc/secret-volume/password inside the container?

medium📝 Command Output Q4 of 15
Kubernetes - Secrets
Given this pod spec snippet mounting a Secret as a volume, what will be the content of the file /etc/secret-volume/password inside the container?
volumes:
  - name: secret-volume
    secret:
      secretName: mysecret
containers:
  - name: app
    image: nginx
    volumeMounts:
      - name: secret-volume
        mountPath: /etc/secret-volume
Assuming the Secret mysecret contains a key password with value mypassword123.
Apassword
Bmysecret
Cmypassword123
Dnginx
Step-by-Step Solution
Solution:
  1. Step 1: Understand Secret volume mounting behavior

    Each key in the Secret becomes a file in the mounted volume with the key as filename and value as file content.
  2. Step 2: Identify the file content for key 'password'

    The file /etc/secret-volume/password will contain the value 'mypassword123'.
  3. Final Answer:

    mypassword123 -> Option C
  4. Quick Check:

    Secret key content = file content [OK]
Quick Trick: Secret keys become filenames; values become file contents [OK]
Common Mistakes:
  • Confusing key names with values
  • Expecting Secret name as file content
  • Assuming container image name appears in file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes