Convert a `.env` file into a Kubernetes Secret manifest without committing plaintext.
BeginnerScenarioScenarios: text processing and scheduling decisions
Answer
Situation read → kubectl can build the manifest; encryption must happen before it reaches Git.
What I'd do →
kubectl create secret generic api-env --from-env-file=.env -n prod --dry-run=client -o yaml > secret.yaml
kubeseal --format yaml < secret.yaml > sealed-secret.yaml && rm -f secret.yaml # Sealed Secrets
# or: sops --encrypt --in-place secret.yaml
--from-env-filehandlesKEY=valuelines and base64-encodes values.- Commit only the sealed or SOPS-encrypted file.
Why → Kubernetes Secrets are only base64, not encryption; committing them is committing plaintext.
Interview tip → Mention External Secrets Operator as the alternative that keeps secrets in AWS Secrets Manager or Vault.
More on Scenarios: text processing and scheduling decisions
Users report errors in the last hour. From the Nginx access log, find which endpoints produce the most 5xx responses.BeginnerA MySQL slow log is 3 GB. You need the 10 slowest query patterns. What do you do?IntermediateTwo servers that should be identical behave differently. Compare their installed packages.BeginnerFind which pods were OOMKilled in a namespace, with their container names and restart counts.IntermediateProduce a CSV of running EC2 instances that are missing an `Owner` tag.IntermediateYou have access logs from five web servers and need one timeline sorted by time. How?Intermediate