Skip to main content
The 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 an InfisicalStaticSecret, you need:
  1. An InfisicalConnection resource configured with your Infisical host and TLS settings.
  2. An InfisicalAuth resource configured with your machine identity authentication method.

Examples

Each example below contains every resource you need to apply: the credential Secret, 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.
Platform-agnostic authentication using a client ID and client secret. Works in any environment.
complete-universal-auth.yaml
For workloads running in AWS (EC2, Lambda, EKS). The operator uses the instance’s IAM role to authenticate.
complete-aws-iam-auth.yaml
For workloads running in Azure. Uses the Azure managed identity attached to the compute resource.
complete-azure-auth.yaml
For workloads running in GCP. Uses the GCP metadata server to obtain an ID token.
complete-gcp-id-token-auth.yaml
Uses a GCP service account key file for authentication. Works both inside and outside GCP.
The 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.
complete-gcp-iam-auth.yaml
Authenticates using LDAP credentials (username and password).
complete-ldap-auth.yaml

CRD properties

A reference to the InfisicalAuth resource that defines how to authenticate with Infisical. The connection to the Infisical instance is resolved through the InfisicalAuth resource’s infisicalConnectionRef field.See the InfisicalAuth CRD documentation for details.
Controls the synchronization behavior.
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.To access a secret that was dropped by the merge (e.g. a duplicate key under a different path or source), use the secretFrom template function to select it by its full path.
You have to provide either projectId or projectSlug. If none or both are set, the CRD validation will fail.
An array of Kubernetes Secrets or ConfigMaps to create/update with the fetched secrets.
ConfigMaps are intended for non-sensitive data only. Use kind: Secret for sensitive values.

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 in template.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

To help transform your secrets further, the operator provides a set of built-in functions that you can use in your templates.

Available helper functions

The Infisical Secrets Operator exposes a wide range of helper functions to make it easier to work with secrets in Kubernetes.
Encodes a string to a base64-encoded string (e.g. hello world becomes aGVsbG8gd29ybGQ=).Signature
Template usage
Decodes a base64-encoded string back to its original value (e.g. aGVsbG8gd29ybGQ= becomes hello world).Signature
Template usage
Extracts all private keys from a PKCS#12 archive and returns them as PKCS#8 PEM-encoded blocks (-----BEGIN PRIVATE KEY-----...). The archive must not be password-protected — use pkcs12keyPass for password-protected archives.Signature
Template usage
Same as pkcs12key, but uses the provided password to decrypt the PKCS#12 archive.Signature
Template usage
Extracts all certificates from a PKCS#12 archive and returns them as an ordered PEM chain (-----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.Signature
Template usage
Same as pkcs12cert, but uses the provided password to decrypt the PKCS#12 archive.Signature
Template usage
Takes a PEM-encoded certificate and private key and creates a base64-encoded PKCS#12 archive. The output is not password-protected — use pemToPkcs12Pass to set a password.Signature
Template usage
Same as pemToPkcs12, but encrypts the PKCS#12 archive with the provided password.Signature
Template usage
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 fullPemToPkcs12Pass to set a password.Signature
Template usage
Same as fullPemToPkcs12, but encrypts the PKCS#12 archive with the provided password.Signature
Template usage
Filters PEM blocks by type from a bundle containing multiple PEM blocks (e.g. extract only CERTIFICATE or PRIVATE KEY blocks). Common PEM types: CERTIFICATE, PRIVATE KEY, PUBLIC KEY, RSA PRIVATE KEY.Signature
Template usage
Filters PEM certificates by their position in a certificate chain. The chain is automatically ordered before filtering. Accepted types: 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.Signature
Template usage
Takes a JSON-serialized JWK and returns a PEM block of type PUBLIC KEY containing the public key. Uses x509.MarshalPKIXPublicKey internally.Signature
Template usage
Takes a JSON-serialized JWK and returns a PEM block of type PRIVATE KEY containing the private key. Uses x509.MarshalPKCS8PrivateKey internally.Signature
Template usage
Marshals a value to a YAML string. Returns an empty string on marshal error.Signature
Template usage
Parses a YAML string into a map[string]any, useful for extracting individual fields from a YAML-formatted secret (e.g. (fromYaml .DB_CONFIG.Value).host returns the host field).Signature
Template usage
This function is only available in v1beta1 resources (e.g. InfisicalStaticSecret).
Resolves a secret from a specific folder path within the Infisical project. Takes a path and a secret name as parameters, and returns the secret’s value by default. You can optionally use .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.
If multiple sources contain a secret with the same name and path, the secret from the first source listed in the sources array will be used.
Signature
Template usage

Sprig 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.
By default, the operator merges labels and annotations from the 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 InfisicalStaticSecret resource 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 InfisicalStaticSecret resource.
  • Kubernetes system annotations and Infisical operator tracking annotations are preserved.
This creates a managed Secret with the inherited metadata:
When you specify metadata on a target, those labels and annotations are used exclusively for that managed resource:
  • Target metadata.labels replaces the managed resource’s labels.
  • Target metadata.annotations replaces user-defined annotations on the managed resource.
  • Kubernetes system annotations and the Infisical version annotation are preserved.
  • Labels and annotations from the InfisicalStaticSecret resource are not propagated to that target.
  • This lets you keep CRD-specific metadata separate from managed resource metadata.
To prevent any propagation while using target metadata, pass empty objects for labels and/or annotations:
This creates a managed Secret with only the target metadata:

Applying the CRD

Verify the managed secret was created:

Using the managed resource in your deployment

The managed Kubernetes Secret or ConfigMap works like any other native resource. You can reference it via envFrom, env, or 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:
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 your InfisicalStaticSecret resource by inspecting its conditions:
When reconciliation is successful, the 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.