InfisicalStaticSecretPush CRD pushes native Kubernetes Secrets from your cluster to one or more paths in Infisical and keeps them in sync.
It replaces the v1alpha1 InfisicalPushSecret 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 anInfisicalStaticSecretPush, you need:
- The Infisical Kubernetes operator v0.11.17 or later, installed in your cluster. Earlier versions don’t include
InfisicalStaticSecretPush. - An InfisicalConnection resource configured with your Infisical host and TLS settings.
- An InfisicalAuth resource configured with your machine identity authentication method. The machine identity needs permission to read, create, edit, and delete secrets at each target, and to create folders when
createMissingFoldersis enabled.
Examples
Each example below contains every resource you need to apply: the credentialSecret, InfisicalConnection, InfisicalAuth, the Secret to push, and InfisicalStaticSecretPush.
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’ll 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
updatePolicy:Replace: The operator keeps existing keys in sync with the sources, and takes over keys at a target that were created outside this resourceNone: The operator only creates missing keys and never changes an existing key (including the keys this resource created), so later changes to the sources don’t reach Infisical
deletionPolicy:Delete: The operator deletes a pushed secret from Infisical when its key is removed from the sources, when its target is removed, or when theInfisicalStaticSecretPushis deletedNone: The operator never deletes secrets from Infisical
sources
sources
targets
targets
projectId or projectSlug. If none or both are set, the sync fails.Templating
Pushing the keys of your Kubernetes Secrets as-is 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 the source keys before pushing them to Infisical. When a target has a template, only the keys defined intemplate.data are pushed to that target.
When no template is set, all source keys are pushed as-is.
Each source key is available in the template context as .KEY, which is an object with two accessors:
.Value: the value of the key in the source Secret.SecretPath: the target’ssecretPath
Key/value template map
Bulk string template with a loop
quote function escapes each value, so values that contain quotes, backslashes, or line breaks are pushed unchanged.
How templates are applied
- A key that the template stops rendering is deleted from the target according to
deletionPolicy, like a key removed from the sources - If a template fails, only its target fails, and nothing is deleted from Infisical until the template is fixed
- When a template fails while running, the status shows where it failed but not why, because the reason can contain secret values (syntax errors are shown in full)
- A template whose
datais empty or only contains whitespace is rejected, because it would delete every secret pushed to the target - Only the values pushed to Infisical must be valid UTF-8, so a template can leave out a binary source value or encode it with
encodeBase64
secretFrom and foldersIn look up secrets and folders fetched from Infisical, so they don’t work in an InfisicalStaticSecretPush template.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).SignatureSprig 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.Managing pushed secrets
The operator records the ID of every secret it pushes to Infisical in the resource’sstatus.managedSecrets, and it only ever deletes those secrets.
Keys that already exist in Infisical
Keys that already exist in Infisical
updatePolicy: Replace, the operator takes over a key that already exists at a target: it writes the source value and records the secret in status.managedSecrets, so the key is deleted with the resource when deletionPolicy is Delete. With updatePolicy: None, the operator leaves the key unchanged and never deletes it.If the operator stops right after creating a secret, before it records the secret’s ID, the next sync takes the key over again when updatePolicy is Replace. When updatePolicy is None, the key isn’t recorded, so the operator never deletes it.Keys pushed by another InfisicalStaticSecretPush
Keys pushed by another InfisicalStaticSecretPush
InfisicalStaticSecretPush pushed, even while that resource is being deleted. The resource that didn’t push the key first reports an error that names the keys it left unchanged.The operator only checks the resources it manages: the ones in its own cluster, and if it’s namespace-scoped, only the ones in the namespaces it watches. Resources that different operators manage, for example in two clusters, can’t see each other’s keys: they overwrite each other, and deleting one with deletionPolicy: Delete deletes keys the other still pushes.Push each key from only one InfisicalStaticSecretPush.Secret values
Secret values
encodeBase64 in a template.Infisical removes whitespace at the start and end of a value, and keeps a single trailing newline when the value ends with one.Approval workflows
Approval workflows
updatePolicy is Replace.The operator doesn’t track approval requests yet, so every sync submits a new request. To let the operator push without approval, enable Bypass Approval for Machine Identities in the approval policy.Deleting the resource
Deleting the resource
deletionPolicy is Delete, Kubernetes keeps the InfisicalStaticSecretPush until the operator has deleted every secret in status.managedSecrets from Infisical. If the operator can’t delete them within 5 minutes, for example because Infisical is unreachable, it lets Kubernetes delete the resource, leaves the secrets in Infisical, and logs their IDs.If you change infisicalAuthRef to an InfisicalAuth that connects to another Infisical instance, the secrets pushed to the previous instance stay there. To remove them, delete the InfisicalStaticSecretPush before you change the InfisicalAuth, or delete them in Infisical.Applying the CRD
SYNCED column shows True, the secrets are in Infisical at every target.
Migrating from InfisicalPushSecret
If you push secrets with the v1alpha1 InfisicalPushSecret CRD, anInfisicalStaticSecretPush can take over the secrets that the InfisicalPushSecret pushed. The secrets aren’t deleted or recreated in Infisical during the migration.
The InfisicalStaticSecretPush spec is different from the InfisicalPushSecret spec:
- It authenticates through an InfisicalAuth resource, which connects to Infisical through an InfisicalConnection resource
push.secretbecomes an entry insources.secrets, anddestinationbecomes an entry intargets, withsecretsPathrenamed tosecretPathresyncIntervalbecomessyncOptions.refreshInterval, andupdatePolicyanddeletionPolicymove undersyncOptionsupdatePolicydefaults toReplaceanddeletionPolicydefaults toDelete, while both default toNoneon anInfisicalPushSecret- Its templates use the v1 template syntax, which has no
includeAllSecretsoption (to push every source key along with the keys a template adds, use a bulk template that ranges over.) - It doesn’t support generators (
push.generators) yet
InfisicalStaticSecretPush.InfisicalPushSecret, remove deletionPolicy or set it to None, and apply the change.InfisicalStaticSecretPush that pushes the same Secret to the same project, environment, and path as the InfisicalPushSecret. Keep updatePolicy set to Replace, so the InfisicalStaticSecretPush takes over the secrets that already exist in Infisical.SYNCED column shows True for the InfisicalStaticSecretPush:InfisicalPushSecret:InfisicalStaticSecretPush manages them from now on.Troubleshooting
You can check the status of yourInfisicalStaticSecretPush 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. While the operator deletes the pushed secrets from Infisical, Reason is set to Deleting.
The ObservedGeneration field indicates which generation of the resource spec the operator has last processed. If ObservedGeneration is less than metadata.generation, the operator hasn’t yet reconciled the latest changes to the resource.