# How do you generate a TLS Secret with Kustomize?

Kustomize, Medium (Advanced), Generation. https://k8wiz.com/uquiz/how-do-you-generate-a-tls-secret-with-kustomize

- A. A configMapGenerator entry with secret: true that lists both the certificate and key files
- B. A secretGenerator entry with type: kubernetes.io/tls and the files tls.crt and tls.key
- C. A secretGenerator entry with tls: true and any two certificate files
- D. A patch that changes a generated ConfigMap's kind to Secret

**Answer:** A secretGenerator entry with type: kubernetes.io/tls and the files tls.crt and tls.key

**Explanation:** secretGenerator's type defaults to Opaque. With kubernetes.io/tls, the entry must have exactly two keys, tls.crt and tls.key, from files or literals. The Secret gets a hash suffix like any generated object.
