Boost your DevOps skills with the ITGSS Certified DevOps Engineer Test. Use flashcards and multiple choice questions with hints and explanations. Be exam-ready!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What is a recommended practice for running containers in a Kubernetes environment?

  1. Run as a root user

  2. Run as a non-root user

  3. Run with unlimited resources

  4. Run without logging

The correct answer is: Run as a non-root user

Running containers as a non-root user is a recommended practice in a Kubernetes environment for several important reasons. First, this approach enhances the security of the application running in the container. When applications run as the root user, they have elevated privileges that could be exploited by attackers if they manage to compromise the container. By using a non-root user, the privileges are limited, which reduces the potential attack surface and mitigates the risks associated with privilege escalation. Second, adhering to the principle of least privilege is a key aspect of security best practices. By restricting the permissions that a container has, you minimize the potential impact of a security breach, as the non-root user cannot perform actions that require root access. This helps in maintaining a more secure Kubernetes environment. Lastly, running containers as a non-root user can help in complying with various regulatory frameworks and security guidelines, which often mandate that processes should not run with elevated privileges unless absolutely necessary. These security best practices are critical when deploying applications in cloud-native environments, as they contribute to overall system resilience and stability.