Kubernetes - SecretsWhich YAML snippet correctly defines a Kubernetes Secret using the stringData field with plain text?AapiVersion: v1\nkind: Secret\ndata:\n password: cGFzc3dvcmQ=\ntype: OpaqueBapiVersion: v1\nkind: Secret\ndata:\n password: password\ntype: OpaqueCapiVersion: v1\nkind: Secret\nstringData:\n password: cGFzc3dvcmQ=\ntype: OpaqueDapiVersion: v1\nkind: Secret\nstringData:\n password: password\ntype: OpaqueCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand Secret data fieldsSecrets can use 'data' (base64 encoded) or 'stringData' (plain text) fields.Step 2: Identify correct syntax for unencrypted Secret'stringData' allows plain text input which Kubernetes encodes automatically.Final Answer:YAML with stringData and plain text password -> Option DQuick Check:Unencrypted Secret YAML uses stringData with plain text [OK]Quick Trick: Use stringData for plain text Secret input [OK]Common Mistakes:Putting plain text in 'data' field without base64Confusing base64 encoded and plain text fieldsUsing wrong apiVersion or kind
Master "Secrets" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes ConfigMaps - Creating ConfigMaps from files - Quiz 8hard Health Checks and Probes - Liveness probe concept - Quiz 1easy Health Checks and Probes - HTTP probe configuration - Quiz 13medium Health Checks and Probes - Readiness probe concept - Quiz 6medium Ingress - Ingress controllers (Nginx, Traefik) - Quiz 9hard Networking - Pod-to-Pod communication - Quiz 1easy Resource Management - CPU requests and limits - Quiz 2easy Resource Management - Horizontal Pod Autoscaler - Quiz 6medium Resource Management - CPU requests and limits - Quiz 12easy Secrets - External secret management integration - Quiz 12easy