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.
Examples
Each example below contains every resource you need to apply: the credentialSecret, InfisicalConnection, InfisicalAuth, and InfisicalStaticSecret.
Copy the one that matches your environment, replace the placeholder values, and kubectl apply -f it.
For more details on each resource, see the InfisicalConnection and InfisicalAuth documentation or access our samples.
Kubernetes Auth (Recommended)
Kubernetes Auth (Recommended)
Universal Auth
Universal Auth
AWS IAM Auth
AWS IAM Auth
Azure Auth
Azure Auth
GCP ID Token Auth
GCP ID Token Auth
GCP IAM Auth
GCP IAM Auth
serviceAccountKeyFilePath must point to a file that exists inside the operator pod. You will need to create a Kubernetes Secret with your GCP service account key and mount it as a volume in the operator Deployment (or via Helm values). See the GCP IAM Auth guide for details.LDAP Auth
LDAP Auth
CRD properties
infisicalAuthRef
infisicalAuthRef
InfisicalAuth resource that defines how to authenticate with Infisical. The connection to the Infisical instance is resolved through the InfisicalAuth resource’s infisicalConnectionRef field.syncOptions
syncOptions
sources
sources
secretFrom template function to select it by its full path.projectId or projectSlug. If none or both are set, the CRD validation will fail.targets
targets
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
hello world becomes aGVsbG8gd29ybGQ=).SignaturedecodeBase64ToBytes
decodeBase64ToBytes
aGVsbG8gd29ybGQ= becomes hello world).Signaturepkcs12key
pkcs12key
-----BEGIN PRIVATE KEY-----...).
The archive must not be password-protected — use pkcs12keyPass for password-protected archives.Signaturepkcs12keyPass
pkcs12keyPass
pkcs12key, but uses the provided password to decrypt the PKCS#12 archive.Signaturepkcs12cert
pkcs12cert
-----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
pkcs12cert, but uses the provided password to decrypt the PKCS#12 archive.SignaturepemToPkcs12
pemToPkcs12
pemToPkcs12Pass to set a password.SignaturepemToPkcs12Pass
pemToPkcs12Pass
pemToPkcs12, but encrypts the PKCS#12 archive with the provided password.SignaturefullPemToPkcs12
fullPemToPkcs12
fullPemToPkcs12Pass to set a password.SignaturefullPemToPkcs12Pass
fullPemToPkcs12Pass
fullPemToPkcs12, but encrypts the PKCS#12 archive with the provided password.SignaturefilterPEM
filterPEM
CERTIFICATE or PRIVATE KEY blocks).
Common PEM types: CERTIFICATE, PRIVATE KEY, PUBLIC KEY, RSA PRIVATE KEY.SignaturefilterCertChain
filterCertChain
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
PUBLIC KEY containing the public key.
Uses x509.MarshalPKIXPublicKey internally.SignaturejwkPrivateKeyPem
jwkPrivateKeyPem
PRIVATE KEY containing the private key.
Uses x509.MarshalPKCS8PrivateKey internally.SignaturetoYaml
toYaml
fromYaml
fromYaml
map[string]any, useful for extracting individual fields from a YAML-formatted secret (e.g. (fromYaml .DB_CONFIG.Value).host returns the host field).SignaturesecretFrom
secretFrom
v1beta1 resources (e.g. InfisicalStaticSecret)..Value or .SecretPath accessors on the result — if omitted, .Value is used.This is especially useful when multiple secrets share the same key, either from recursive fetches across different paths or from multiple sources. In both cases, the merge strategy only keeps the first occurrence (read more here), so secretFrom lets you explicitly select the one you need by its full path.sources array will be used.Sprig functions
The Infisical Secrets Operator integrates with the Sprig library to provide additional helper functions.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
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
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
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.