TheDocumentation Index
Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
InfisicalStaticSecret CRD syncs secrets from Infisical into your Kubernetes cluster as native Kubernetes Secrets or ConfigMaps.
It replaces the v1alpha1 InfisicalSecret CRD with a cleaner design: authentication and connection details are defined as separate reusable resources (InfisicalAuth and InfisicalConnection) instead of inline blocks.
Prerequisites
Before creating anInfisicalStaticSecret, you need:
- An InfisicalConnection resource configured with your Infisical host and TLS settings.
- An InfisicalAuth resource configured with your machine identity authentication method.
Example
infisical-static-secret.yaml
CRD properties
infisicalAuthRef
infisicalAuthRef
A reference to the
See the InfisicalAuth CRD documentation for details.
InfisicalAuth resource that defines how to authenticate with Infisical. The connection to the Infisical instance is resolved through the InfisicalAuth resource’s infisicalConnectionRef field.| Field | Required | Description |
|---|---|---|
name | Yes | The name of the InfisicalAuth resource. |
namespace | Yes | The namespace of the InfisicalAuth resource. |
syncOptions
syncOptions
Controls the synchronization behavior.
| Field | Required | Description |
|---|---|---|
refreshInterval | Yes | How often to resync (e.g. 60s, 5m, 1h). |
instantUpdates | No | When true, the operator receives real-time push updates from Infisical. Please note that this is an Enterprise feature. |
sources
sources
An array of secret sources to fetch from Infisical. All secrets from all sources are merged and made available to every target.When multiple sources produce a secret with the same key, the first occurrence wins — sources listed earlier in the array take precedence over later ones. Direct secrets always take precedence over imported secrets, regardless of source order.
| Field | Required | Description |
|---|---|---|
projectId | Yes | The Infisical project ID. |
environmentSlug | Yes | The environment slug (e.g. dev, staging, prod). |
secretPath | Yes | The path to the secrets. Root is /. |
tagSlugs | No | Filter secrets by tag slugs. |
recursive | No | Whether to recursively fetch secrets from sub-folders. Defaults to false. |
targets
targets
An array of Kubernetes Secrets or ConfigMaps to create/update with the fetched secrets.
| Field | Required | Description |
|---|---|---|
name | Yes | Name of the managed Kubernetes Secret or ConfigMap. |
namespace | Yes | Namespace of the managed Kubernetes Secret or ConfigMap. |
kind | Yes | The type of resource to create. Must be Secret or ConfigMap. |
secretType | No | Override the default Opaque secret type. Only applies when kind: Secret. When using a typed secret (e.g. kubernetes.io/tls, kubernetes.io/dockerconfigjson), you must use a template to produce the keys that Kubernetes requires for that type, otherwise the API server will reject the resource. |
creationPolicy | Yes | Owner sets a Kubernetes owner reference so the managed resource is automatically deleted by the garbage collector when the InfisicalStaticSecret is removed. Orphan leaves the managed resource in place. |
template | No | Optional templating configuration (see Templating below). |
metadata | No | Custom labels and annotations to set on the managed resource. When set, these values are used as-is and not merged with the InfisicalStaticSecret CRD metadata. |
Templating
Fetching secrets from Infisical as-is via the operator may not be enough. This is where templating functionality may be helpful. Using Go templates, you can format, combine, and create new key-value pairs from secrets fetched from Infisical before storing them as Kubernetes Secrets or ConfigMaps. When a template is set, only the keys defined intemplate.data are included in the output.
When no template is set, all fetched secrets are included as-is.
Each secret is available in the template context as .SECRET_KEY, which is an object with two accessors:
.Value: the secret value..SecretPath: the path of the secret in Infisical.
Key/value template map
Bulk string template with a loop
Available helper functions
The Infisical Secrets Operator exposes a wide range of helper functions to make it easier to work with secrets in Kubernetes.encodeBase64
encodeBase64
Encodes a string to a base64-encoded string (e.g. Template usage
hello world becomes aGVsbG8gd29ybGQ=).SignaturedecodeBase64ToBytes
decodeBase64ToBytes
Decodes a base64-encoded string back to its original value (e.g. Template usage
aGVsbG8gd29ybGQ= becomes hello world).Signaturepkcs12key
pkcs12key
Extracts all private keys from a PKCS#12 archive and returns them as PKCS#8 PEM-encoded blocks (Template usage
-----BEGIN PRIVATE KEY-----...).
The archive must not be password-protected — use pkcs12keyPass for password-protected archives.Signaturepkcs12keyPass
pkcs12keyPass
Same as Template usage
pkcs12key, but uses the provided password to decrypt the PKCS#12 archive.Signaturepkcs12cert
pkcs12cert
Extracts all certificates from a PKCS#12 archive and returns them as an ordered PEM chain (Template usage
-----BEGIN CERTIFICATE-----...).
Sort order: leaf → intermediate(s) → root. If disjunct or multiple leaf certs are provided, they are returned as-is.
The archive must not be password-protected — use pkcs12certPass for password-protected archives.Signaturepkcs12certPass
pkcs12certPass
Same as Template usage
pkcs12cert, but uses the provided password to decrypt the PKCS#12 archive.SignaturepemToPkcs12
pemToPkcs12
Takes a PEM-encoded certificate and private key and creates a base64-encoded PKCS#12 archive.
The output is not password-protected — use Template usage
pemToPkcs12Pass to set a password.SignaturepemToPkcs12Pass
pemToPkcs12Pass
Same as Template usage
pemToPkcs12, but encrypts the PKCS#12 archive with the provided password.SignaturefullPemToPkcs12
fullPemToPkcs12
Takes a full PEM-encoded certificate chain (leaf + intermediates + root) and a private key, and creates a base64-encoded PKCS#12 archive that includes the entire chain.
The output is not password-protected — use Template usage
fullPemToPkcs12Pass to set a password.SignaturefullPemToPkcs12Pass
fullPemToPkcs12Pass
Same as Template usage
fullPemToPkcs12, but encrypts the PKCS#12 archive with the provided password.SignaturefilterPEM
filterPEM
Filters PEM blocks by type from a bundle containing multiple PEM blocks (e.g. extract only Template usage
CERTIFICATE or PRIVATE KEY blocks).
Common PEM types: CERTIFICATE, PRIVATE KEY, PUBLIC KEY, RSA PRIVATE KEY.SignaturefilterCertChain
filterCertChain
Filters PEM certificates by their position in a certificate chain. The chain is automatically ordered before filtering.
Accepted types: Template usage
leaf (end-entity certificate), intermediate (all intermediate CA certificates), root (root CA certificate).
Returns an empty string if the requested type is not present in the chain.SignaturejwkPublicKeyPem
jwkPublicKeyPem
Takes a JSON-serialized JWK and returns a PEM block of type Template usage
PUBLIC KEY containing the public key.
Uses x509.MarshalPKIXPublicKey internally.SignaturejwkPrivateKeyPem
jwkPrivateKeyPem
Takes a JSON-serialized JWK and returns a PEM block of type Template usage
PRIVATE KEY containing the private key.
Uses x509.MarshalPKCS8PrivateKey internally.SignaturetoYaml
toYaml
Marshals a value to a YAML string. Returns an empty string on marshal error.SignatureTemplate usage
fromYaml
fromYaml
Parses a YAML string into a Template usage
map[string]any, useful for extracting individual fields from a YAML-formatted secret (e.g. (fromYaml .DB_CONFIG.Value).host returns the host field).SignatureSprig functions
The Infisical Secrets Operator integrates with the Sprig library to provide additional helper functions.We’ve removed
expandEnv and env from the supported functions for security reasons.Metadata propagation
The operator provides flexible options for managing labels and annotations on managed Kubernetes Secrets and ConfigMaps.Default behavior
Default behavior
By default, the operator merges labels and annotations from the This creates a managed Secret with the inherited metadata:
InfisicalStaticSecret resource into each managed Secret or ConfigMap that does not define target-level metadata.Conflict behavior:- Existing labels and annotations that were not previously managed by the operator are preserved.
- Labels and annotations from the
InfisicalStaticSecretresource take precedence when the same key already exists on the managed resource. - Labels and annotations previously propagated by the operator are removed if they are removed from the
InfisicalStaticSecretresource. - Kubernetes system annotations and Infisical operator tracking annotations are preserved.
Custom target metadata
Custom target metadata
When you specify This creates a managed Secret with only the target metadata:
metadata on a target, those labels and annotations are used exclusively for that managed resource:- Target
metadata.labelsreplaces the managed resource’s labels. - Target
metadata.annotationsreplaces user-defined annotations on the managed resource. - Kubernetes system annotations and the Infisical version annotation are preserved.
- Labels and annotations from the
InfisicalStaticSecretresource are not propagated to that target. - This lets you keep CRD-specific metadata separate from managed resource metadata.
Applying the CRD
Using the managed resource in your deployment
The managed Kubernetes Secret or ConfigMap works like any other native resource. You can reference it viaenvFrom, env, or volumes:
- Secret
- ConfigMap
envFrom
envFrom
env
env
volumes
volumes
Automatic redeployment
Pods that consume a managed Secret or ConfigMap don’t reload automatically when the underlying data changes. Without a restart, the workload may continue using stale values, especially when secrets are injected as environment variables. To trigger a rolling restart when the managed resource updates, add the following annotation to the Deployment, StatefulSet, or DaemonSet that consumes it:Deployment example
Deployment example
- Secret
- ConfigMap
DaemonSet example
DaemonSet example
- Secret
- ConfigMap
StatefulSet example
StatefulSet example
- Secret
- ConfigMap
When a managed Secret or ConfigMap is updated, the operator checks for any Deployments, DaemonSets, or StatefulSets that consume the updated resource and have the
secrets.infisical.com/auto-reload: "true" annotation. For each matching workload, the operator triggers a rolling restart so the pods pick up the latest values.Troubleshooting
You can check the status of yourInfisicalStaticSecret resource by inspecting its conditions:
secrets.infisical.com/LastReconcileStatus condition will have Status: "True", Reason: "OK", and Message: "Reconciliation successful".
If reconciliation fails, Status will be "False", Reason will be set to Error, and Message will contain details about what went wrong.
The ObservedGeneration field indicates which generation of the resource spec the operator has last processed. If ObservedGeneration is less than metadata.generation, the operator has not yet reconciled the latest changes to the resource.