Kubernetes - SecretsWhich of the following is the correct way to create a Secret from literal values in Kubernetes?Akubectl create configmap mysecret --from-literal=password=12345Bkubectl secret create mysecret --literal=password=12345Ckubectl create secret generic mysecret --from-literal=password=12345Dkubectl create secret mysecret --from-file=password=12345Check Answer
Step-by-Step SolutionSolution:Step 1: Recall the correct kubectl syntax for SecretsThe command to create a generic Secret from literal values is 'kubectl create secret generic'.Step 2: Verify the optionskubectl create secret generic mysecret --from-literal=password=12345 uses the correct syntax. kubectl secret create mysecret --literal=password=12345 uses wrong command structure. kubectl create configmap mysecret --from-literal=password=12345 creates a ConfigMap, not a Secret. kubectl create secret mysecret --from-file=password=12345 uses incorrect flag for literal.Final Answer:kubectl create secret generic mysecret --from-literal=password=12345 -> Option CQuick Check:Correct Secret creation syntax = A [OK]Quick Trick: Use 'kubectl create secret generic' for literals [OK]Common Mistakes:Using 'kubectl secret create' which is invalidConfusing ConfigMap creation with SecretUsing --from-file instead of --from-literal for literals
Master "Secrets" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes ConfigMaps - Why configuration separation matters - Quiz 14medium ConfigMaps - Updating ConfigMaps and propagation - Quiz 5medium Health Checks and Probes - Probe failure and container restart behavior - Quiz 10hard Health Checks and Probes - Startup probe concept - Quiz 8hard Ingress - Ingress resource definition - Quiz 2easy Ingress - Path-based routing - Quiz 11easy Ingress - Why Ingress manages external access - Quiz 7medium Persistent Storage - Volumes vs Persistent Volumes - Quiz 15hard Secrets - External secret management integration - Quiz 11easy Secrets - Secret types (Opaque, docker-registry, TLS) - Quiz 5medium