The External Secrets Enterprise Edition 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-clifetches data from the- my-app-db-configExternalSecret.
- The application my-app-containerstarts 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 emptyDirvolume (namedsecretless-secretsby default) and mounts it to both the sidecar and your application container(s) at/secrets.
- esi-cliin the sidecar writes the fetched secrets to- /secrets/secrets.json.
- The sidecar continues running and can refresh secrets.jsonif theExternalSecretchanges (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 with- esi-cli.
- The federated-server-urlandfederated-storeannotations configureesi-clito talk to the federation server.
- inject-on-env: "API_TOKEN=remote-secret-name.api-key"tells- esi-clito fetch- api-keyfrom- remote-secret-name(via the federated store) and expose it as- API_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-varsandinject-on-env) AND a sidecar container (forfile-secrets).
- The init container will use esi-clito setPRIMARY_DB_HOSTandPRIMARY_DB_PORT.
- The sidecar will provide /secrets/secrets.jsonwith all data fromapp-comprehensive-secrets.
esi-cli documentation for details on its specific flags and behaviors when using passthrough annotations.