Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
update navigation and add new CRDs
Matheus Nogueira33c5894c5e2c
diff --git a/docs/docs.json b/docs/docs.jsonindex 6d8b5d78f2..8a279c8ba7 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -563,9 +563,23 @@"group": "Kubernetes Operator","pages": ["integrations/platforms/kubernetes/overview",- "integrations/platforms/kubernetes/infisical-secret-crd",- "integrations/platforms/kubernetes/infisical-push-secret-crd",- "integrations/platforms/kubernetes/infisical-dynamic-secret-crd"+ {+ "group": "V2",+ "tag": "RECOMMENDED",+ "pages": [+ "integrations/platforms/kubernetes/infisical-connection-crd",+ "integrations/platforms/kubernetes/infisical-auth-crd",+ "integrations/platforms/kubernetes/infisical-static-secret-crd"+ ]+ },+ {+ "group": "V1",+ "pages": [+ "integrations/platforms/kubernetes/infisical-secret-crd",+ "integrations/platforms/kubernetes/infisical-push-secret-crd",+ "integrations/platforms/kubernetes/infisical-dynamic-secret-crd"+ ]+ }]},"integrations/platforms/kubernetes-injector",diff --git a/docs/integrations/platforms/kubernetes/infisical-auth-crd.mdx b/docs/integrations/platforms/kubernetes/infisical-auth-crd.mdxnew file mode 100644index 0000000000..e906541c5d--- /dev/null+++ b/docs/integrations/platforms/kubernetes/infisical-auth-crd.mdx@@ -0,0 +1,294 @@+---+sidebarTitle: "InfisicalAuth"+title: "Using the InfisicalAuth CRD"+description: "Learn how to configure the InfisicalAuth CRD to define how the operator authenticates with Infisical."+---++<Info>+ This CRD is part of the **v1beta1** API and is only used with v1beta1 secret resources (`InfisicalStaticSecret`).+</Info>++## Overview++The **InfisicalAuth** CRD defines how the Infisical Operator authenticates with your Infisical instance. It encapsulates the machine identity authentication method and credentials. Once created, it can be referenced by multiple secret resources, so you only need to define authentication details once per identity.++The operator caches authenticated credentials using the token's TTL (at 70% of the expiration time) so that multiple resources sharing the same `InfisicalAuth` don't trigger redundant login calls. The cache is automatically invalidated when the `InfisicalAuth` spec changes or when the referenced `InfisicalConnection` is updated.++### Prerequisites++- The operator is installed on your Kubernetes cluster.+- A [machine identity](/documentation/platform/identities/machine-identities) configured in Infisical with access to the relevant project(s).+- An [InfisicalConnection](/integrations/platforms/kubernetes/infisical-connection-crd) resource created in your cluster.++## Example++<Tabs>+ <Tab title="Kubernetes Auth (Recommended)">+```yaml infisical-auth-kubernetes.yaml+apiVersion: secrets.infisical.com/v1beta1+kind: InfisicalAuth+metadata:+ name: my-infisical-auth+spec:+ infisicalConnectionRef:+ name: my-infisical-connection+ namespace: default+ method: kubernetes+ kubernetes:+ identityIdRef:+ name: kubernetes-credentials+ namespace: default+ key: identityId+ serviceAccountRef:+ name: service-account+ namespace: default+```++The referenced Kubernetes secret must contain the machine identity ID:++```bash+kubectl create secret generic kubernetes-credentials \+ --from-literal=identityId="<your-machine-identity-id>"+```+ </Tab>+ <Tab title="Universal Auth">+```yaml infisical-auth-universal.yaml+apiVersion: secrets.infisical.com/v1beta1+kind: InfisicalAuth+metadata:+ name: my-infisical-auth+spec:+ infisicalConnectionRef:+ name: my-infisical-connection+ namespace: default+ method: universal+ universal:+ clientIdRef:+ name: universal-auth-credentials+ namespace: default+ key: clientId+ clientSecretRef:+ name: universal-auth-credentials+ namespace: default+ key: clientSecret+```++The referenced Kubernetes secret must contain `clientId` and `clientSecret` keys:++```bash+kubectl create secret generic universal-auth-credentials \+ --from-literal=clientId="<your-client-id>" \+ --from-literal=clientSecret="<your-client-secret>"+```+ </Tab>+ <Tab title="AWS IAM Auth">+```yaml infisical-auth-aws.yaml+apiVersion: secrets.infisical.com/v1beta1+kind: InfisicalAuth+metadata:+ name: my-infisical-auth+spec:+ infisicalConnectionRef:+ name: my-infisical-connection+ namespace: default+ method: aws-iam+ awsIam:+ identityIdRef:+ name: aws-iam-credentials+ namespace: default+ key: identityId+```++The referenced Kubernetes secret must contain the machine identity ID:++```bash+kubectl create secret generic aws-iam-credentials \+ --from-literal=identityId="<your-machine-identity-id>"+```+ </Tab>+</Tabs>++Apply the resource:++```bash+kubectl apply -f infisical-auth.yaml+```++## Spec++The `InfisicalAuth` spec has the following top-level fields:++| Field | Type | Required | Description |+| ------------------------ | -------------- | -------- | --------------------------------------------------------------------------- |+| `infisicalConnectionRef` | NamespacedName | Yes | Reference to the `InfisicalConnection` resource that defines the Infisical host. |+| `method` | string | Yes | The authentication method to use. Must be one of: `universal`, `kubernetes`, `aws-iam`, `azure`, `gcp-id-token`, `gcp-iam`, `ldap`. |++In addition, you must provide the configuration object that matches your chosen `method` (e.g., `kubernetes`, `universal`, `awsIam`, etc.).++## Authentication methods++Only define **one** authentication method per resource. The method name in `spec.method` must match the configuration object you provide.++<Accordion title="kubernetes">+ Authenticates using a Kubernetes service account token. This is the recommended method when running inside a Kubernetes cluster. The operator automatically creates short-lived service account tokens (10 minutes) for authentication.++ [Read more about Kubernetes Auth](/documentation/platform/identities/kubernetes-auth).++ | Field | Type | Required | Description |+ | ------------------------------ | ----------------- | -------- | ------------------------------------------------------------- |+ | `identityIdRef` | SecretReference | Yes | Reference to the secret containing the machine identity ID. |+ | `serviceAccountRef.name` | string | Yes | Name of the Kubernetes service account. |+ | `serviceAccountRef.namespace` | string | Yes | Namespace of the service account. |+ | `serviceAccountTokenAudiences` | string[] | No | Custom audiences for the generated service account token. |++ ```yaml+ method: kubernetes+ kubernetes:+ identityIdRef:+ name: kubernetes-credentials+ namespace: default+ key: identityId+ serviceAccountRef:+ name: default+ namespace: default+ ```+</Accordion>++<Accordion title="universal">+ Authenticates using a client ID and client secret. Works anywhere, not tied to any cloud provider.+ [Read more about Universal Auth](/documentation/platform/identities/universal-auth).++ | Field | Type | Required | Description |+ | ----------------- | --------------- | -------- | ---------------------------------------------------------- |+ | `clientIdRef` | SecretReference | Yes | Reference to the secret containing the client ID. |+ | `clientSecretRef` | SecretReference | Yes | Reference to the secret containing the client secret. |++ ```yaml+ method: universal+ universal:+ clientIdRef:+ name: universal-auth-credentials+ namespace: default+ key: clientId+ clientSecretRef:+ name: universal-auth-credentials+ namespace: default+ key: clientSecret+ ```+</Accordion>++<Accordion title="awsIam">+ Authenticates using AWS IAM. Can only be used within AWS environments (EC2, Lambda, EKS).+ [Read more about AWS IAM Auth](/documentation/platform/identities/aws-auth).++ | Field | Type | Required | Description |+ | --------------- | --------------- | -------- | --------------------------------------------------------- |+ | `identityIdRef` | SecretReference | Yes | Reference to the secret containing the machine identity ID. |++ ```yaml+ method: aws-iam+ awsIam:+ identityIdRef:+ name: aws-iam-credentials+ namespace: default+ key: identityId+ ```+</Accordion>++<Accordion title="azure">+ Authenticates using Azure managed identity. Can only be used within Azure environments.+ [Read more about Azure Auth](/documentation/platform/identities/azure-auth).++ | Field | Type | Required | Description |+ | --------------- | --------------- | -------- | --------------------------------------------------------- |+ | `identityIdRef` | SecretReference | Yes | Reference to the secret containing the machine identity ID. |+ | `resource` | string | No | The Azure resource (audience) to request a token for. |++ ```yaml+ method: azure+ azure:+ identityIdRef:+ name: azure-credentials+ namespace: default+ key: identityId+ ```+</Accordion>++<Accordion title="gcpIdToken">+ Authenticates using GCP ID tokens. Can only be used within GCP environments.+ [Read more about GCP Auth](/documentation/platform/identities/gcp-auth).++ | Field | Type | Required | Description |+ | --------------- | --------------- | -------- | --------------------------------------------------------- |+ | `identityIdRef` | SecretReference | Yes | Reference to the secret containing the machine identity ID. |++ ```yaml+ method: gcp-id-token+ gcpIdToken:+ identityIdRef:+ name: gcp-id-token-credentials+ namespace: default+ key: identityId+ ```+</Accordion>++<Accordion title="gcpIam">+ Authenticates using GCP IAM with a service account key file. Works both within and outside GCP environments.+ [Read more about GCP Auth](/documentation/platform/identities/gcp-auth).++ | Field | Type | Required | Description |+ | ---------------------------- | --------------- | -------- | --------------------------------------------------------- |+ | `identityIdRef` | SecretReference | Yes | Reference to the secret containing the machine identity ID. |+ | `serviceAccountKeyFilePath` | string | Yes | Path to the GCP service account key file mounted in the operator pod. |++ ```yaml+ method: gcp-iam+ gcpIam:+ identityIdRef:+ name: gcp-iam-credentials+ namespace: default+ key: identityId+ serviceAccountKeyFilePath: /path/to/service-account-key.json+ ```+</Accordion>++<Accordion title="ldap">+ Authenticates using LDAP credentials.+ [Read more about LDAP Auth](/documentation/platform/identities/ldap-auth).++ | Field | Type | Required | Description |+ | --------------- | --------------- | -------- | --------------------------------------------------------- |+ | `identityIdRef` | SecretReference | Yes | Reference to the secret containing the machine identity ID. |+ | `usernameRef` | SecretReference | Yes | Reference to the secret containing the LDAP username. |+ | `passwordRef` | SecretReference | Yes | Reference to the secret containing the LDAP password. |++ ```yaml+ method: ldap+ ldap:+ identityIdRef:+ name: ldap-credentials+ namespace: default+ key: identityId+ usernameRef:+ name: ldap-credentials+ namespace: default+ key: username+ passwordRef:+ name: ldap-credentials+ namespace: default+ key: password+ ```+</Accordion>++## Usage++Once created, reference the `InfisicalAuth` from your secret resources:++```yaml+spec:+ infisicalAuthRef:+ name: my-infisical-auth+ namespace: default+```++This keeps authentication centralized. If you rotate credentials or change identity, you only need to update the `InfisicalAuth` resource — the operator will detect the change, invalidate the cached credentials, and re-authenticate automatically.diff --git a/docs/integrations/platforms/kubernetes/infisical-connection-crd.mdx b/docs/integrations/platforms/kubernetes/infisical-connection-crd.mdxnew file mode 100644index 0000000000..159b9effa5--- /dev/null+++ b/docs/integrations/platforms/kubernetes/infisical-connection-crd.mdx@@ -0,0 +1,83 @@+---+sidebarTitle: "InfisicalConnection"+title: "Using the InfisicalConnection CRD"+description: "Learn how to configure the InfisicalConnection CRD to define how the operator connects to your Infisical instance."+---++<Info>+ This CRD is part of the **v1beta1** API and is only used with v1beta1 secret resources (`InfisicalStaticSecret`).+</Info>++## Overview++The **InfisicalConnection** CRD defines how the Infisical Operator connects to your Infisical instance. It holds the instance address and optional TLS configuration. Once created, it can be referenced by multiple `InfisicalAuth` so you only need to define connection details once per Infisical instance.++### Prerequisites++- The operator is installed on your Kubernetes cluster.+- Access to an Infisical instance (cloud or self-hosted).++## Example++```yaml infisical-connection.yaml+apiVersion: secrets.infisical.com/v1beta1+kind: InfisicalConnection+metadata:+ name: my-infisical-connection+spec:+ address: https://app.infisical.com/api+ tls:+ caCertificate:+ name: custom-ca-certificate+ namespace: default+ key: ca.crt+```++Apply the resource:++```bash+kubectl apply -f infisical-connection.yaml+```++## CRD properties++<Accordion title="address">+ The URL of the Infisical API to connect to.++ When `address` is not defined, the operator connects to the address defined in the environment variable `INFISICAL_HOST_API`.++ For self-hosted instances, set this to `https://your-self-hosted-instance.com/api`.+</Accordion>++<Accordion title="tls">+ This block defines TLS settings for connecting to the Infisical instance.+</Accordion>++<Accordion title="tls.cacaCertificateRef">+ A reference to a Kubernetes secret containing a CA certificate for SSL/TLS connections.++ - `name`: Name of the Kubernetes secret containing the CA certificate.+ - `namespace`: Namespace of the Kubernetes secret.+ - `key`: The key within the secret that holds the CA certificate value.++ ```yaml+ tls:+ caRef:+ name: custom-ca-certificate+ namespace: default+ key: ca.crt+ ```+</Accordion>++## Usage++Once created, reference the `InfisicalConnection` from your secret resources:++```yaml+spec:+ infisicalConnectionRef:+ name: my-infisical-connection+ namespace: example-namespace+```++This keeps connection configuration centralized. If your Infisical host URL or TLS settings change, you only need to update the `InfisicalConnection` resource.diff --git a/docs/integrations/platforms/kubernetes/infisical-dynamic-secret-crd.mdx b/docs/integrations/platforms/kubernetes/infisical-dynamic-secret-crd.mdxindex f2911ac2f9..a66abf2296 100644--- a/docs/integrations/platforms/kubernetes/infisical-dynamic-secret-crd.mdx+++ b/docs/integrations/platforms/kubernetes/infisical-dynamic-secret-crd.mdx@@ -1,9 +1,15 @@----sidebarTitle: "InfisicalDynamicSecret CRD"+sidebarTitle: "InfisicalDynamicSecret"title: "Using the InfisicalDynamicSecret CRD"description: "Learn how to generate dynamic secret leases in Infisical and sync them to your Kubernetes cluster."---+<Warning>+ The `InfisicalDynamicSecret` CRD currently uses the **v1alpha1** API version. A v1beta1 version using the new+ [InfisicalConnection](/integrations/platforms/kubernetes/infisical-connection-crd) and [InfisicalAuth](/integrations/platforms/kubernetes/infisical-auth-crd)+ pattern is coming soon. The v1alpha1 version will be deprecated once the v1beta1 replacement is available.+</Warning>+## OverviewThe **InfisicalDynamicSecret** CRD allows you to easily create and manage dynamic secret leases in Infisical and automatically sync them to your Kubernetes cluster as native **Kubernetes Secret** resources.diff --git a/docs/integrations/platforms/kubernetes/infisical-push-secret-crd.mdx b/docs/integrations/platforms/kubernetes/infisical-push-secret-crd.mdxindex a5c68e503c..b2b49a749d 100644--- a/docs/integrations/platforms/kubernetes/infisical-push-secret-crd.mdx+++ b/docs/integrations/platforms/kubernetes/infisical-push-secret-crd.mdx@@ -1,9 +1,16 @@----sidebarTitle: "InfisicalPushSecret CRD"+sidebarTitle: "InfisicalPushSecret"title: "Using the InfisicalPushSecret CRD"description: "Learn how to use the InfisicalPushSecret CRD to push and manage secrets in Infisical."---+import KubernetesOperatorTemplating from "/snippets/kubernetes-operator-templating.mdx";++<Warning>+ The `InfisicalPushSecret` CRD currently uses the **v1alpha1** API version. A v1beta1 version using the new+ [InfisicalConnection](/integrations/platforms/kubernetes/infisical-connection-crd) and [InfisicalAuth](/integrations/platforms/kubernetes/infisical-auth-crd)+ pattern is coming soon. The v1alpha1 version will be deprecated once the v1beta1 replacement is available.+</Warning>## Overview@@ -521,8 +528,7 @@ Using Go templates, you can format, combine, and create new key-value pairs of sTo help transform your config map data further, the operator provides a set of built-in functions that you can use in your templates.- ### Available templating functions- Please refer to the [templating functions documentation](/integrations/platforms/kubernetes/overview#available-helper-functions) for more information.+ <KubernetesOperatorTemplating /></Accordion>## Using generators to push secretsdiff --git a/docs/integrations/platforms/kubernetes/infisical-secret-crd.mdx b/docs/integrations/platforms/kubernetes/infisical-secret-crd.mdxindex 1db2fcc91d..7a0392d1b8 100644--- a/docs/integrations/platforms/kubernetes/infisical-secret-crd.mdx+++ b/docs/integrations/platforms/kubernetes/infisical-secret-crd.mdx@@ -1,9 +1,17 @@----sidebarTitle: "InfisicalSecret CRD"+sidebarTitle: "InfisicalSecret"title: "Using the InfisicalSecret CRD"description: "Learn how to use the InfisicalSecret CRD to fetch secrets from Infisical and store them as native Kubernetes secret resource"---+import KubernetesOperatorTemplating from "/snippets/kubernetes-operator-templating.mdx";++<Warning>+ The `InfisicalSecret` CRD (v1alpha1) is deprecated and will be removed in a future release.+ For new installations, use [InfisicalStaticSecret](/integrations/platforms/kubernetes/infisical-static-secret-crd) (v1beta1) instead.+ See the [migration guide](/integrations/platforms/kubernetes/overview#migrating-from-v1alpha1-to-v1beta1).+</Warning>+Once you have installed the operator to your cluster, you'll need to create a `InfisicalSecret` custom resource definition (CRD).In this CRD, you'll define the authentication method to use, the secrets to fetch, and the target location to store the secrets within your cluster.@@ -996,9 +1004,7 @@ API_URL = "https://api.acme.us-east-1.com" # Existing secret overridden by templTo help transform your secrets further, the operator provides a set of built-in functions that you can use in your templates.-### Available templating functions--Please refer to the [templating functions documentation](/integrations/platforms/kubernetes/overview#available-helper-functions) for more information.+<KubernetesOperatorTemplating /></Accordion>@@ -1111,9 +1117,7 @@ API_URL = "https://api.example.com.us-east-1.com" # Existing secret overridden bTo help transform your config map data further, the operator provides a set of built-in functions that you can use in your templates.-### Available templating functions--Please refer to the [templating functions documentation](/integrations/platforms/kubernetes/overview#available-helper-functions) for more information.+<KubernetesOperatorTemplating /></Accordion>diff --git a/docs/integrations/platforms/kubernetes/infisical-static-secret-crd.mdx b/docs/integrations/platforms/kubernetes/infisical-static-secret-crd.mdxnew file mode 100644index 0000000000..256240d9c8--- /dev/null+++ b/docs/integrations/platforms/kubernetes/infisical-static-secret-crd.mdx@@ -0,0 +1,194 @@+---+sidebarTitle: "InfisicalStaticSecret"+title: "Using the InfisicalStaticSecret CRD"+description: "Learn how to sync secrets from Infisical and store them as native Kubernetes secret resources using the v1beta1 InfisicalStaticSecret CRD."+---++import KubernetesOperatorTemplating from "/snippets/kubernetes-operator-templating.mdx";++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](/integrations/platforms/kubernetes/infisical-auth-crd) and [InfisicalConnection](/integrations/platforms/kubernetes/infisical-connection-crd)) instead of inline blocks.++### Prerequisites++Before creating an `InfisicalStaticSecret`, you need:+1. An [InfisicalConnection](/integrations/platforms/kubernetes/infisical-connection-crd) resource configured with your Infisical host and TLS settings.+2. An [InfisicalAuth](/integrations/platforms/kubernetes/infisical-auth-crd) resource configured with your machine identity authentication method.++### Example++```yaml infisical-static-secret.yaml+apiVersion: secrets.infisical.com/v1beta1+kind: InfisicalStaticSecret+metadata:+ name: my-static-secret+ labels:+ label-to-be-passed-to-managed-secret: sample-value+ annotations:+ example.com/annotation-to-be-passed-to-managed-secret: "sample-value"+spec:+ infisicalAuthRef:+ name: my-infisical-auth+ namespace: default++ syncOptions:+ refreshInterval: 60s+ instantUpdates: false++ sources:+ - projectId: <your-project-id>+ environmentSlug: dev+ secretPath: /++ targets:+ - name: managed-secret+ namespace: default+ kind: Secret+ creationPolicy: Owner+```++## CRD properties++<Accordion title="infisicalAuthRef">+ 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.++ | Field | Type | Required | Description |+ | ----------- | ------ | -------- | ----------------------------------------------------- |+ | `name` | string | Yes | The name of the `InfisicalAuth` resource. |+ | `namespace` | string | Yes | The namespace of the `InfisicalAuth` resource. |++ See the [InfisicalAuth CRD](/integrations/platforms/kubernetes/infisical-auth-crd) documentation for details.+</Accordion>++<Accordion title="syncOptions">+ Controls the synchronization behavior.++ | Field | Type | Required | Description |+ | ----------------- | ------ | -------- | --------------------------------------------------------------------------- |+ | `refreshInterval` | string | Yes | How often to resync (e.g. `60s`, `5m`, `1h`). |+ | `instantUpdates` | bool | No | When `true`, the operator receives real-time push updates from Infisical. Enterprise feature. |+</Accordion>++<Accordion title="sources">+ An array of secret sources to fetch from Infisical. All secrets from all sources are merged and made available to every target.++ | Field | Type | Required | Description |+ | ------------------ | -------- | -------- | ------------------------------------------------------------- |+ | `projectId` | string | Yes | The Infisical project ID. |+ | `environmentSlug` | string | Yes | The environment slug (e.g. `dev`, `staging`, `prod`). |+ | `secretPath` | string | Yes | The path to the secrets. Root is `/`. |+ | `tagSlugs` | string[] | No | Filter secrets by tag slugs. |+ | `recursive` | bool | No | Whether to recursively fetch secrets from sub-folders. Defaults to `false`. |++ ```yaml+ sources:+ - projectId: <your-project-id>+ environmentSlug: dev+ secretPath: /app+ - projectId: <your-project-id>+ environmentSlug: dev+ secretPath: /shared+ recursive: true+ tagSlugs:+ - backend+ ```+</Accordion>++<Accordion title="targets">+ An array of Kubernetes Secrets or ConfigMaps to create/update with the fetched secrets.++ | Field | Type | Required | Description |+ | ---------------- | --------------- | -------- | --------------------------------------------------------------------------- |+ | `name` | string | Yes | Name of the managed Kubernetes Secret or ConfigMap. |+ | `namespace` | string | Yes | Namespace of the managed Kubernetes Secret or ConfigMap. |+ | `kind` | string | Yes | The type of resource to create. Must be `Secret` or `ConfigMap`. |+ | `secretType` | string | 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` | string | 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` | SecretTemplate | No | Optional templating configuration (see [Templating](#templating) below). |+ | `metadata` | object | 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. |++ <Warning>+ ConfigMaps are intended for non-sensitive data only. Use `kind: Secret` for sensitive values.+ </Warning>++ ```yaml+ targets:+ - name: app-secrets+ namespace: default+ kind: Secret+ creationPolicy: Owner+ - name: app-config+ namespace: default+ kind: ConfigMap+ creationPolicy: Orphan+ metadata:+ labels:+ app: my-app+ annotations:+ description: "Synced from Infisical"+ ```+</Accordion>++<KubernetesOperatorTemplating />++## Metadata propagation++Labels and annotations on the `InfisicalStaticSecret` resource are automatically propagated to all managed Secrets and ConfigMaps that don't have explicit `metadata` set on the target. This allows you to set labels and annotations once on the CRD and have them applied to all managed resources.++When a target has explicit `metadata` set, only those labels and annotations are used instead of inheriting from the CRD.++## Applying the CRD++```bash+kubectl apply -f infisical-static-secret.yaml+```++Verify the managed secret was created:++```bash+kubectl get secrets -n <namespace>+```++## Using the managed secret in your deployment++The managed Kubernetes secret works like any other secret. You can reference it via `envFrom`, `env`, or `volumes`:++<Accordion title="envFrom">+```yaml+envFrom:+ - secretRef:+ name: managed-secret+```+</Accordion>++<Accordion title="env">+```yaml+env:+ - name: SECRET_NAME+ valueFrom:+ secretKeyRef:+ name: managed-secret+ key: SOME_SECRET_KEY+```+</Accordion>++<Accordion title="volumes">+```yaml+volumes:+ - name: secrets-volume+ secret:+ secretName: managed-secret+```+</Accordion>++## Automatic redeployment++Add the following annotation to any Deployment, StatefulSet, or DaemonSet to trigger a rolling restart when the managed secret updates:++```yaml+metadata:+ annotations:+ secrets.infisical.com/auto-reload: "true"+```++The operator detects workloads that consume the managed secret (via `envFrom`, `env`, or `volumes`) and automatically triggers a rolling restart when the secret data changes.diff --git a/docs/snippets/kubernetes-operator-templating.mdx b/docs/snippets/kubernetes-operator-templating.mdxnew file mode 100644index 0000000000..23eb96fe27--- /dev/null+++ b/docs/snippets/kubernetes-operator-templating.mdx@@ -0,0 +1,298 @@+### Available helper functions++The Infisical Secrets Operator exposes a wide range of helper functions to make it easier to work with secrets in Kubernetes.++<AccordionGroup>++<Accordion title="encodeBase64">+ Encodes a string to a base64-encoded string (e.g. `hello world` becomes `aGVsbG8gd29ybGQ=`).++ **Signature**+ ```go+ encodeBase64(plainString string) string+ ```++ **Template usage**+ ```yaml+ template:+ data:+ ENCODED_SECRET: "{{ .MY_SECRET.Value | encodeBase64 }}"+ ```+</Accordion>++<Accordion title="decodeBase64ToBytes">+ Decodes a base64-encoded string back to its original value (e.g. `aGVsbG8gd29ybGQ=` becomes `hello world`).++ **Signature**+ ```go+ decodeBase64ToBytes(encodedString string) string+ ```++ **Template usage**+ ```yaml+ template:+ data:+ DECODED_SECRET: "{{ .MY_BASE64_SECRET.Value | decodeBase64ToBytes }}"+ ```+</Accordion>++<Accordion title="pkcs12key">+ 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**+ ```go+ pkcs12key(input string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ tls.key: "{{ .TLS_CERT_PKCS12.Value | pkcs12key }}"+ ```+</Accordion>++<Accordion title="pkcs12keyPass">+ Same as `pkcs12key`, but uses the provided password to decrypt the PKCS#12 archive.++ **Signature**+ ```go+ pkcs12keyPass(password string, input string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ tls.key: '{{ pkcs12keyPass "my-password" .TLS_CERT_PKCS12.Value }}'+ ```+</Accordion>++<Accordion title="pkcs12cert">+ 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**+ ```go+ pkcs12cert(input string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ tls.crt: "{{ .TLS_CERT_PKCS12.Value | pkcs12cert }}"+ ```+</Accordion>++<Accordion title="pkcs12certPass">+ Same as `pkcs12cert`, but uses the provided password to decrypt the PKCS#12 archive.++ **Signature**+ ```go+ pkcs12certPass(password string, input string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ tls.crt: '{{ pkcs12certPass "my-password" .TLS_CERT_PKCS12.Value }}'+ ```+</Accordion>++<Accordion title="pemToPkcs12">+ 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**+ ```go+ pemToPkcs12(cert string, key string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ keystore.p12: '{{ pemToPkcs12 .TLS_CERT.Value .TLS_KEY.Value }}'+ ```+</Accordion>++<Accordion title="pemToPkcs12Pass">+ Same as `pemToPkcs12`, but encrypts the PKCS#12 archive with the provided password.++ **Signature**+ ```go+ pemToPkcs12Pass(cert string, key string, password string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ keystore.p12: '{{ pemToPkcs12Pass .TLS_CERT.Value .TLS_KEY.Value "my-password" }}'+ ```+</Accordion>++<Accordion title="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 `fullPemToPkcs12Pass` to set a password.++ **Signature**+ ```go+ fullPemToPkcs12(cert string, key string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ keystore.p12: '{{ fullPemToPkcs12 .TLS_FULL_CHAIN.Value .TLS_KEY.Value }}'+ ```+</Accordion>++<Accordion title="fullPemToPkcs12Pass">+ Same as `fullPemToPkcs12`, but encrypts the PKCS#12 archive with the provided password.++ **Signature**+ ```go+ fullPemToPkcs12Pass(cert string, key string, password string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ keystore.p12: '{{ fullPemToPkcs12Pass .TLS_FULL_CHAIN.Value .TLS_KEY.Value "my-password" }}'+ ```+</Accordion>++<Accordion title="filterPEM">+ 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**+ ```go+ filterPEM(pemType string, input string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ ca.crt: '{{ filterPEM "CERTIFICATE" .TLS_BUNDLE.Value }}'+ tls.key: '{{ filterPEM "PRIVATE KEY" .TLS_BUNDLE.Value }}'+ ```+</Accordion>++<Accordion title="filterCertChain">+ 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**+ ```go+ filterCertChain(certType string, input string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ tls.crt: '{{ filterCertChain "leaf" .TLS_CHAIN.Value }}'+ ca.crt: '{{ filterCertChain "root" .TLS_CHAIN.Value }}'+ intermediate.crt: '{{ filterCertChain "intermediate" .TLS_CHAIN.Value }}'+ ```+</Accordion>++<Accordion title="jwkPublicKeyPem">+ Takes a JSON-serialized JWK and returns a PEM block of type `PUBLIC KEY` containing the public key.+ Uses [`x509.MarshalPKIXPublicKey`](https://pkg.go.dev/crypto/x509#MarshalPKIXPublicKey) internally.++ **Signature**+ ```go+ jwkPublicKeyPem(jwkJson string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ public.pem: "{{ .MY_JWK.Value | jwkPublicKeyPem }}"+ ```+</Accordion>++<Accordion title="jwkPrivateKeyPem">+ Takes a JSON-serialized JWK and returns a PEM block of type `PRIVATE KEY` containing the private key.+ Uses [`x509.MarshalPKCS8PrivateKey`](https://pkg.go.dev/crypto/x509#MarshalPKCS8PrivateKey) internally.++ **Signature**+ ```go+ jwkPrivateKeyPem(jwkJson string) string+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ private.pem: "{{ .MY_JWK.Value | jwkPrivateKeyPem }}"+ ```+</Accordion>++<Accordion title="toYaml">+ Marshals a value to a YAML string. Returns an empty string on marshal error.++ **Signature**+ ```go+ toYaml(v any) string+ ```++ **Template usage**+ ```yaml+ template:+ data:+ config.yaml: "{{ .APP_CONFIG.Value | fromYaml | toYaml }}"+ ```+</Accordion>++<Accordion title="fromYaml">+ 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**+ ```go+ fromYaml(str string) map[string]any+ ```++ **Template usage**+ ```yaml+ template:+ includeAllSecrets: false+ data:+ DB_HOST: '{{ (fromYaml .DB_CONFIG.Value).host }}'+ DB_PORT: '{{ (fromYaml .DB_CONFIG.Value).port }}'+ ```+</Accordion>++</AccordionGroup>++### Sprig functions++The Infisical Secrets Operator integrates with the [Sprig library](https://github.com/Masterminds/sprig) to provide additional helper functions.++<Note>+ We've removed `expandEnv` and `env` from the supported functions for security reasons.+</Note>