How do you create a secret named mysecret with password=secretpassword?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

How do you create a secret named mysecret with password=secretpassword?

Explanation:
Creating a secret from literal data is the action being tested. To store a password in a Secret, you pass the key-value pair via --from-literal. The command shown creates a Secret named mysecret and stores a data entry with the key 'password' and value 'secretpassword' inside it. This is the correct way to construct a Secret from inline data in one step. The other commands are for different purposes: editing a secret (modifying its content), deleting it, or describing it (displaying its details) — none of which creates the secret. Note: you could also specify the type explicitly with generic, e.g., oc create secret generic mysecret --from-literal password=secretpassword, which is functionally equivalent.

Creating a secret from literal data is the action being tested. To store a password in a Secret, you pass the key-value pair via --from-literal. The command shown creates a Secret named mysecret and stores a data entry with the key 'password' and value 'secretpassword' inside it. This is the correct way to construct a Secret from inline data in one step. The other commands are for different purposes: editing a secret (modifying its content), deleting it, or describing it (displaying its details) — none of which creates the secret. Note: you could also specify the type explicitly with generic, e.g., oc create secret generic mysecret --from-literal password=secretpassword, which is functionally equivalent.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy