This quiz explores key steps and best practices for deploying a private Docker Registry using Kubernetes, including certificate management, persistent storage, and deployment configuration. Perfect for those looking to understand image storage and secure access in a cloud-native setup.
What is the main reason for creating a self-signed certificate when deploying a private Docker Registry on Kubernetes?
Explanation: A self-signed certificate is generated to enable encrypted HTTPS communication, ensuring that data exchanged with the registry is secure. Improving container startup speed and increasing image storage capacity are unrelated to certificates. Automating registry updates is also not a function of creating certificates.
Which Kubernetes resource is best used to safely store TLS certificates and keys for the Docker Registry?
Explanation: Kubernetes Secrets are designed to store sensitive data, such as TLS keys and certificates, securely. ConfigMaps are for non-sensitive configuration data, PersistentVolumes are for storage, and ServiceAccounts relate to permissions rather than secret storage.
Why is it important to attach a PersistentVolumeClaim to the Docker Registry deployment in Kubernetes?
Explanation: A PersistentVolumeClaim ensures that stored images are not lost if the registry pod is restarted or rescheduled to another node. It does not affect SSL encryption, scaling CPU resources, or running the same pod instance on multiple nodes simultaneously.
When deploying the Docker Registry container in Kubernetes, what is the main reason to mount the directory containing certificates as read-only?
Explanation: Mounting certificate directories as read-only secures them by preventing accidental or malicious modification during runtime. This mounting does not impact image pull speeds, network usage, or facilitate automatic updates of certificate files.
Which environment variables must be set in the Docker Registry container to specify the locations of the TLS certificate and key?
Explanation: These two environment variables point the Docker Registry to the relevant certificate and key file paths for secure communication. The other options are not recognized by the official registry image for this specific configuration.