The External Secrets Enterprise is product suite is a premium product.
It requires a specific subscription. Contact us for more information.
metadata
section of your Pods. These annotations instruct the webhook on how and what secrets to inject.
All ESI Pod Webhook annotations share the prefix
secretless.externalsecrets.com/
.Core Annotations
These are the fundamental annotations to control basic secret injection.externalsecret
- Annotation:
secretless.externalsecrets.com/externalsecret: "<your-externalsecret-name>"
- Required: Yes, for any injection to occur.
- Description: Specifies the name of the
ExternalSecret
resource from which to fetch secrets. ThisExternalSecret
must exist in the same namespace as the Pod being annotated. - Example:
env-vars
- Annotation:
secretless.externalsecrets.com/env-vars: "true" | "false"
- Default:
"false"
(if not specified) - Description: Enables or disables the injection of secrets as environment variables.
- If set to
"true"
, the webhook injects an init container into the Pod. This init container runsesi-cli --mode=init
, which fetches secrets from the specifiedExternalSecret
, exports them as environment variables, and then executes your application container’s original command. - Secret keys are typically converted to uppercase environment variable names, with non-alphanumeric characters replaced by underscores (e.g.,
my-db-password
becomesMY_DB_PASSWORD
). Refer to theesi-cli
documentation for precise conversion rules.
- If set to
- Example:
file-secrets
- Annotation:
secretless.externalsecrets.com/file-secrets: "true" | "false"
- Default:
"false"
(if not specified) - Description: Enables or disables the injection of secrets as files.
- If set to
"true"
, the webhook injects a sidecar container into the Pod. This sidecar runsesi-cli --mode=daemon
. esi-cli
fetches secrets from theExternalSecret
and writes them to a single file:/secrets/secrets.json
(in JSON format). This file is located in an in-memory volume shared with your application container(s).- Your application container(s) will have this volume automatically mounted at
/secrets
. - The path and format (
/secrets/secrets.json
) are currently fixed and not customizable via annotations. - The sidecar’s daemon mode allows for potential background refreshing of this file if the
ExternalSecret
changes. Your application would need to be capable of reloading configuration from this file if it needs to pick up changes dynamically.
- If set to
- Example:
You can enable both
env-vars
and file-secrets
simultaneously if needed, though this is less common. If both are true, an init container will inject environment variables, AND a sidecar will provide /secrets/secrets.json
.skip
- Annotation:
secretless.externalsecrets.com/skip: "true" | "false"
- Default:
"false"
(if not specified) - Description: If set to
"true"
, the ESI Pod Webhook will ignore this Pod entirely, and no inspection or injection will occur. This is useful for:- Explicitly disabling injection on specific Pods.
- System Pods or critical infrastructure Pods where webhook intervention is undesired.
- The ESI Pod Webhook’s own deployment (it’s typically annotated with
skip: "true"
by default).
- Example:
Auxiliary Annotations
These annotations provide additional control or support for the injection process.image-pull-secrets
- Annotation:
secretless.externalsecrets.com/image-pull-secrets: "<your-image-pull-secret-name>"
- Optional: Yes
- Description: Specifies the name of an existing Kubernetes
Secret
of typekubernetes.io/dockerconfigjson
(an image pull secret) to be added to the Pod’sspec.imagePullSecrets
array. This is useful if theesi-cli
init or sidecar container images (which are configured globally for the webhook deployment) are hosted in a private container registry that requires authentication. - Example:
Advanced: esi-cli
Passthrough Annotations
These annotations allow you to pass specific command-line arguments directly to the esi-cli
tool when it’s run by the init container (i.e., for environment variable injection). They provide finer-grained control over esi-cli
’s behavior, especially for features like federation.
Important: The following passthrough annotations are only effective when
secretless.externalsecrets.com/env-vars: "true"
is also specified. They are not used by the sidecar container in file-secrets
mode.federated-server-url
- Annotation:
secretless.externalsecrets.com/federated-server-url: "<url_of_federation_server>"
- Maps to
esi-cli
flag:--federated-server-url
- Description: Specifies the URL of an ESI Federation server from which to fetch secrets.
- Requires:
env-vars: "true"
.
inject-on-env
(Passthrough for esi-cli
)
- Annotation:
secretless.externalsecrets.com/inject-on-env: "<env_map_string_for_esi_cli>"
- Maps to
esi-cli
flag:--inject-on-env
- Description: Provides a specific mapping string for
esi-cli
to control how secrets are named or selected when injected as environment variables. The format of<env_map_string_for_esi_cli>
is determined byesi-cli
’s own parsing rules (e.g.,ENV_VAR_NAME=secretKey,OTHER_VAR=anotherKey
).Whilesecretless.externalsecrets.com/env-vars: "true"
enables general environment variable injection (all keys from theExternalSecret
’s data), this annotation allows for more precise control viaesi-cli
’s--inject-on-env
flag, potentially overriding or refining the default behavior. - Requires:
env-vars: "true"
.
federated-generator
- Annotation:
secretless.externalsecrets.com/federated-generator: "<generator_config_string_for_esi_cli>"
- Maps to
esi-cli
flag:--federated-generators
- Description: Specifies generator configurations for
esi-cli
when fetching secrets from a federated ESI server. - Requires:
env-vars: "true"
and likelyfederated-server-url
.
federated-store
- Annotation:
secretless.externalsecrets.com/federated-store: "<store_config_string_for_esi_cli>"
- Maps to
esi-cli
flag:--federated-store
- Description: Specifies store configurations for
esi-cli
when fetching secrets from a federated ESI server. - Requires:
env-vars: "true"
and likelyfederated-server-url
.
For detailed information on the expected values, formats, and behavior of the
esi-cli
flags (--federated-server-url
, --inject-on-env
, --federated-generators
, --federated-store
), please consult the ESI-CLI documentation.Webhook Global Configuration (Deployment Arguments)
While not pod annotations, the ESI Pod WebhookDeployment
itself accepts arguments that globally configure the behavior of injected containers. These are set once when deploying the webhook:
--tls-cert=<path>
: Path to the webhook’s TLS certificate file (default:/etc/webhook/certs/tls.crt
).--tls-key=<path>
: Path to the webhook’s TLS private key file (default:/etc/webhook/certs/tls.key
).--port=<port>
: Port for the webhook server (default:8443
).--init-image=<image_uri>
: The container image to use for the init container (e.g.,your-registry/esi-cli:latest
).--sidecar-image=<image_uri>
: The container image to use for the sidecar container (e.g.,your-registry/esi-cli:latest
).--image-pull-policy=<policy>
: Image pull policy (e.g.,IfNotPresent
,Always
) for injected containers.
Next Steps
- See Usage Examples for practical applications of these annotations.
- If you encounter issues, refer to the Troubleshooting guide.