An opaque Secret is a generic Kubernetes Secret for sensitive values that have no specialized built-in interpretation. It is useful for application settings such as status messages or user credentials that should not reside in a ConfigMap. section 8.3.2
Create an opaque Secret
Create a generic Secret directly with kubectl: kubectl create secret generic kiada-secret-config --from-literal status-message="This status message is set in the kiada-secret-config Secret". Generic Secrets are limited to approximately 1 MB. section 8.3.2
$ kubectl create secret generic my-credentials \ #1 --from-literal user=my-username \ #2 --from-literal pass=my-password \ #2 --dry-run=client -o yaml #3 apiVersion: v1 data: pass: bXktcGFzc3dvcmQ= #4 user: bXktdXNlcm5hbWU= #4 kind: Secret metadata: creationTimestamp: null name: my-credentials
Generate a YAML manifest for credentials with kubectl without manually entering Base64-encoded values. section 8.3.2
You can also define an opaque Secret as a YAML API object. Use stringData for plain-text values such as user and pass; this field is write-only and sets Secret entries. section 8.3.2
