Secrets are used to store confidential information. Never store such information on the definition of the pod itself.
Use an existing
To reference a secret created outside of your deployment definition, use the following. Note that this does not create a new object, and will therefore not be included in the resulting manifest.
import * as kplus from 'cdk8s-plus-25'; const secret = kplus.Secret.fromSecretName('aws-creds');
To create a new secret with some data, use:
import * as kplus from 'cdk8s-plus-25'; import * as k from 'cdk8s'; const app = new k.App(); const chart = new k.Chart(app, 'Chart'); const secret = new kplus.Secret(chart, 'Secret'); secret.addStringData('password', 'some-encrypted-data');