The External Secrets Enterprise is product suite is a premium product.
It requires a specific subscription. Contact us for more information.
Example 1: Basic Environment Variable Injection
Inject all key-value pairs from themy-app-db-config
ExternalSecret as environment variables into the my-app-container
.
- The webhook sees
env-vars: "true"
. - It injects an init container running
esi-cli --mode=init
. esi-cli
fetches data from themy-app-db-config
ExternalSecret.- The application
my-app-container
starts with these secrets as environment variables.
Example 2: Basic File-Based Secret Injection
Inject all key-value pairs from themy-app-tls-certs
ExternalSecret into the /secrets/secrets.json
file, accessible by my-secure-app-container
.
- The webhook sees
file-secrets: "true"
. - It injects a sidecar container running
esi-cli --mode=daemon
. - It also creates an
emptyDir
volume (namedsecretless-secrets
by default) and mounts it to both the sidecar and your application container(s) at/secrets
. esi-cli
in the sidecar writes the fetched secrets to/secrets/secrets.json
.- The sidecar continues running and can refresh
secrets.json
if theExternalSecret
changes (application needs to support reloading).
Example 3: Environment Variables with esi-cli
Federation
Fetch a specific secret (API_TOKEN
) using esi-cli
’s federation capabilities from a federated ESI server and inject it as an environment variable.
The
secretless.externalsecrets.com/externalsecret
annotation is still technically required by the webhook to trigger its logic, even if the primary secret source is federated. You can point it to a minimal or placeholder ExternalSecret
in the pod’s namespace.env-vars: "true"
enables the init container withesi-cli
.- The
federated-server-url
andfederated-store
annotations configureesi-cli
to talk to the federation server. inject-on-env: "API_TOKEN=remote-secret-name.api-key"
tellsesi-cli
to fetchapi-key
fromremote-secret-name
(via the federated store) and expose it asAPI_TOKEN
.
Example 4: Both Environment and File Injection
While less common, you might want some secrets as environment variables and the full set as a file.- The webhook will add an init container (for
env-vars
andinject-on-env
) AND a sidecar container (forfile-secrets
). - The init container will use
esi-cli
to setPRIMARY_DB_HOST
andPRIMARY_DB_PORT
. - The sidecar will provide
/secrets/secrets.json
with all data fromapp-comprehensive-secrets
.
esi-cli
documentation for details on its specific flags and behaviors when using passthrough annotations.