0
0
Kubernetesdevops~10 mins

Using Secrets as mounted volumes in Kubernetes - Interactive Code Practice

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

Complete the code to specify the volume type as a secret in the pod spec.

Kubernetes
volumes:
  - name: secret-volume
    [1]:
      secretName: mysecret
Drag options to blanks, or click blank then click option'
AconfigMap
Bsecret
CemptyDir
DpersistentVolumeClaim
Attempts:
3 left
💡 Hint
Common Mistakes
Using configMap instead of secret for secret volumes.
Using emptyDir which is for temporary storage.
2fill in blank
medium

Complete the container volumeMounts to mount the secret volume at the correct path.

Kubernetes
containers:
- name: app
  image: myapp
  volumeMounts:
  - name: secret-volume
    mountPath: [1]
Drag options to blanks, or click blank then click option'
A/etc/secret-volume
B/etc/config
C/etc/secret
D/var/secrets
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated paths like /etc/config which is for configMaps.
Using paths that do not match the volume name.
3fill in blank
hard

Fix the error in the volumeMounts section to correctly mount the secret volume.

Kubernetes
containers:
- name: app
  image: myapp
  volumeMounts:
  - name: [1]
    mountPath: /etc/secret
Drag options to blanks, or click blank then click option'
Asecret-volume
Bdata-volume
Cconfig-volume
Dcache-volume
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different volume name than defined in volumes.
Typos in the volumeMount name.
4fill in blank
hard

Fill both blanks to create a pod spec that mounts a secret named 'db-secret' at '/etc/db'.

Kubernetes
volumes:
- name: [1]
  secret:
    secretName: [2]
Drag options to blanks, or click blank then click option'
Adb-secret-volume
Bdb-secret
Cmy-secret
Dsecret-volume
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up volume name and secretName.
Using incorrect secret names.
5fill in blank
hard

Fill all three blanks to complete the container spec that mounts the secret volume 'db-secret-volume' at '/etc/db'.

Kubernetes
containers:
- name: app
  image: myapp
  volumeMounts:
  - name: [1]
    mountPath: [2]
    readOnly: [3]
Drag options to blanks, or click blank then click option'
Adb-secret-volume
B/etc/db
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Setting readOnly to false which is insecure.
Using wrong mountPath or volume name.