How to use Infisical to inject secrets into Kubernetes clusters.
The Infisical Secrets Operator is a Kubernetes controller that retrieves secrets from Infisical and stores them in a designated cluster.
It uses an InfisicalSecret resource to specify authentication and storage methods.
The operator continuously updates secrets and can also reload dependent deployments automatically.
If you are already using the External Secrets operator, you can view the
integration documentation for it
here.
# Example installing app version v0.2.0 and chart version 0.1.4helm install --generate-name infisical-helm-charts/secrets-operator --version=0.1.4 --setcontrollerManager.manager.image.tag=v0.2.0
Namespace-scoped Installation
The operator can be configured to watch and manage secrets in a specific namespace instead of having cluster-wide access. This is useful for:
Enhanced Security: Limit the operator’s permissions to only specific namespaces instead of cluster-wide access
Multi-tenant Clusters: Run separate operator instances for different teams or applications
Resource Isolation: Ensure operators in different namespaces don’t interfere with each other
Development & Testing: Run development and production operators side by side in isolated namespaces
Note: For multiple namespace-scoped installations, only the first installation should install CRDs. Subsequent installations should set installCRDs: false to avoid conflicts.
Once you have installed the operator to your cluster, you’ll need to create a InfisicalSecret custom resource definition (CRD).
example-infisical-secret-crd.yaml
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample labels:label-to-be-passed-to-managed-secret: sample-value annotations:example.com/annotation-to-be-passed-to-managed-secret:"sample-value"spec:hostAPI: https://app.infisical.com/apiresyncInterval:10 authentication:# Make sure to only have 1 authentication method defined, serviceToken/universalAuth.# If you have multiple authentication methods defined, it may cause issues.# (Deprecated) Service Token Auth serviceToken: serviceTokenSecretReference:secretName: service-tokensecretNamespace: default secretsScope:envSlug: <env-slug>secretsPath: <secrets-path>recursive:true# Universal Auth universalAuth: secretsScope:projectSlug: new-ob-emenvSlug: dev # "dev", "staging", "prod", etc..secretsPath:"/"# Root is "/"recursive:true# Whether or not to use recursive mode (Fetches all secrets in an environment from a given secret path, and all folders inside the path) / defaults to false credentialsRef:secretName: universal-auth-credentialssecretNamespace: default# Native Kubernetes Auth kubernetesAuth:identityId: <machine-identity-id> serviceAccountRef:name: <service-account-name>namespace: <service-account-namespace># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true# AWS IAM Auth awsIamAuth:identityId: <your-machine-identity-id># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true# Azure Auth azureAuth:identityId: <your-machine-identity-id>resource: https://management.azure.com/&client_id=CLIENT_ID# (Optional) This is the Azure resource that you want to access. For example, "https://management.azure.com/". If no value is provided, it will default to "https://management.azure.com/"# secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true# GCP ID Token Auth gcpIdTokenAuth:identityId: <your-machine-identity-id># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true# GCP IAM Auth gcpIamAuth:identityId: <your-machine-identity-id># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true managedSecretReference:secretName: managed-secretsecretNamespace: defaultcreationPolicy:"Orphan"## Owner | Orphan# template:# includeAllSecrets: true# data:# CUSTOM_KEY: "{{ .KEY.SecretPath }} {{ .KEY.Value }}"# secretType: kubernetes.io/dockerconfigjson
If you are fetching secrets from a self-hosted instance of Infisical set the value of hostAPI to
https://your-self-hosted-instace.com/api
When hostAPI is not defined the operator fetches secrets from Infisical Cloud.
If you have installed your Infisical instance within the same cluster as the Infisical operator, you can optionally access the Infisical backend’s service directly without having to route through the public internet.
To achieve this, use the following address for the hostAPI field:
Make sure to replace <backend-svc-name> and <namespace> with the appropriate values for your backend service and namespace.
This property defines the time in seconds between each secret re-sync from
Infisical. Shorter time between re-syncs will require higher rate limits only
available on paid plans. Default re-sync interval is every 1 minute.
This block defines the TLS settings to use for connecting to the Infisical
instance.
This block defines the reference to the CA certificate to use for connecting
to the Infisical instance with SSL/TLS.
The name of the Kubernetes secret containing the CA certificate to use for
connecting to the Infisical instance with SSL/TLS.
The namespace of the Kubernetes secret containing the CA certificate to use
for connecting to the Infisical instance with SSL/TLS.
The name of the key in the Kubernetes secret which contains the value of the
CA certificate to use for connecting to the Infisical instance with SSL/TLS.
This block defines the method that will be used to authenticate with Infisical
so that secrets can be fetched
The universal machine identity authentication method is used to authenticate with Infisical. The client ID and client secret needs to be stored in a Kubernetes secret. This block defines the reference to the name and namespace of secret that stores these credentials.
Once you have created your machine identity and added it to your project(s), you will need to create a Kubernetes secret containing the identity credentials.
To quickly create a Kubernetes secret containing the identity credentials, you can run the command below.
Make sure you replace <your-identity-client-id> with the identity client ID and <your-identity-client-secret> with the identity client secret.
Add reference for the Kubernetes secret containing the identity credentials
Once the secret is created, add the secretName and secretNamespace of the secret that was just created under authentication.universalAuth.credentialsRef field in the InfisicalSecret resource.
Make sure to also populate the secretsScope field with the project slug
projectSlug, environment slug envSlug, and secrets path
secretsPath that you want to fetch secrets from. Please see the example
below.
Example
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample-crdspec: authentication: universalAuth: secretsScope:projectSlug: <project-slug># <-- project slugenvSlug: <env-slug># "dev", "staging", "prod", etc..secretsPath:"<secrets-path>"# Root is "/" credentialsRef:secretName: universal-auth-credentials # <-- name of the Kubernetes secret that stores our machine identity credentialssecretNamespace: default # <-- namespace of the Kubernetes secret that stores our machine identity credentials...
The Kubernetes machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used within a Kubernetes environment.
1
Obtaining the token reviewer JWT for Infisical
1.1. Start by creating a service account in your Kubernetes cluster that will be used by Infisical to authenticate with the Kubernetes API Server.
1.2. Bind the service account to the system:auth-delegator cluster role. As described here, this role allows delegated authentication and authorization checks, specifically for Infisical to access the TokenReview API. You can apply the following configuration file:
1.3. Next, create a long-lived service account JWT token (i.e. the token reviewer JWT token) for the service account using this configuration file for a new Secret resource:
1.5. Finally, retrieve the token reviewer JWT token from the secret.
kubectl get secret infisical-auth-token -n default -o=jsonpath='{.data.token}'| base64 --decode
Keep this JWT token handy as you will need it for the Token Reviewer JWT field when configuring the Kubernetes Auth authentication method for the identity in step 2.
2
Creating an identity
To create an identity, head to your Organization Settings > Access Control > Machine Identities and press Create identity.
When creating an identity, you specify an organization level role for it to assume; you can configure roles in Organization Settings > Access Control > Organization Roles.
Now input a few details for your new identity. Here’s some guidance for each field:
Name (required): A friendly name for the identity.
Role (required): A role from the Organization Roles tab for the identity to assume. The organization role assigned will determine what organization level resources this identity can have access to.
Once you’ve created an identity, you’ll be prompted to configure the authentication method for it. Here, select Kubernetes Auth.
To learn more about each field of the Kubernetes native authentication method, see step 2 of guide.
3
Adding an identity to a project
To allow the operator to use the given identity to access secrets, you will need to add the identity to project(s) that you would like to grant it access to.
To do this, head over to the project you want to add the identity to and go to Project Settings > Access Control > Machine Identities and press Add identity.
Next, select the identity you want to add to the project and the project level role you want to allow it to assume. The project role assigned will determine what project level resources this identity can have access to.
4
Add your identity ID & service account to your InfisicalSecret resource
Once you have created your machine identity and added it to your project(s), you will need to add the identity ID to your InfisicalSecret resource.
In the authentication.kubernetesAuth.identityId field, add the identity ID of the machine identity you created.
See the example below for more details.
5
Add your Kubernetes service account token to the InfisicalSecret resource
Add the service account details from the previous steps under authentication.kubernetesAuth.serviceAccountRef.
Here you will need to enter the name and namespace of the service account.
The example below shows a complete InfisicalSecret resource with all required fields defined.
Make sure to also populate the secretsScope field with the project slug
projectSlug, environment slug envSlug, and secrets path
secretsPath that you want to fetch secrets from. Please see the example
below.
Example
example-kubernetes-auth.yaml
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample-crdspec: authentication: kubernetesAuth:identityId: <machine-identity-id> serviceAccountRef:name: <service-account-name>namespace: <service-account-namespace># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true...
The AWS IAM machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used within an AWS environment like an EC2 or a Lambda function.
Add your identity ID to your InfisicalSecret resource
Once you have created your machine identity and added it to your project(s), you will need to add the identity ID to your InfisicalSecret resource. In the authentication.awsIamAuth.identityId field, add the identity ID of the machine identity you created. See the example below for more details.
Make sure to also populate the secretsScope field with the project slug
projectSlug, environment slug envSlug, and secrets path
secretsPath that you want to fetch secrets from. Please see the example
below.
Example
example-aws-iam-auth.yaml
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample-crdspec: authentication: awsIamAuth:identityId: <your-machine-identity-id># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true...
The Azure machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used within an Azure environment.
Add your identity ID to your InfisicalSecret resource
Once you have created your machine identity and added it to your project(s), you will need to add the identity ID to your InfisicalSecret resource. In the authentication.azureAuth.identityId field, add the identity ID of the machine identity you created. See the example below for more details.
Make sure to also populate the secretsScope field with the project slug
projectSlug, environment slug envSlug, and secrets path
secretsPath that you want to fetch secrets from. Please see the example
below.
Example
example-azure-auth.yaml
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample-crdspec: authentication: azureAuth:identityId: <your-machine-identity-id># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true...
The GCP ID Token machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used within GCP environments.
Add your identity ID to your InfisicalSecret resource
Once you have created your machine identity and added it to your project(s), you will need to add the identity ID to your InfisicalSecret resource. In the authentication.gcpIdTokenAuth.identityId field, add the identity ID of the machine identity you created. See the example below for more details.
Make sure to also populate the secretsScope field with the project slug
projectSlug, environment slug envSlug, and secrets path
secretsPath that you want to fetch secrets from. Please see the example
below.
Example
example-gcp-id-token-auth.yaml
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample-crdspec: authentication: gcpIdTokenAuth:identityId: <your-machine-identity-id># secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true...
The GCP IAM machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used both within and outside GCP environments.
Add your identity ID and service account token path to your InfisicalSecret resource
Once you have created your machine identity and added it to your project(s), you will need to add the identity ID to your InfisicalSecret resource. In the authentication.gcpIamAuth.identityId field, add the identity ID of the machine identity you created.
You’ll also need to add the service account key file path to your InfisicalSecret resource. In the authentication.gcpIamAuth.serviceAccountKeyFilePath field, add the path to your service account key file path. Please see the example below for more details.
Make sure to also populate the secretsScope field with the project slug
projectSlug, environment slug envSlug, and secrets path
secretsPath that you want to fetch secrets from. Please see the example
below.
Example
example-gcp-id-token-auth.yaml
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample-crdspec: authentication: gcpIamAuth:identityId: <your-machine-identity-id>serviceAccountKeyFilePath:"/path/to-service-account-key-file-path.json"# secretsScope is identical to the secrets scope in the universalAuth field in this sample. secretsScope:projectSlug: your-project-slugenvSlug: prodsecretsPath:"/path"recursive:true...
The service token required to authenticate with Infisical needs to be stored in a Kubernetes secret. This block defines the reference to the name and namespace of secret that stores this service token.
Follow the instructions below to create and store the service token in a Kubernetes secrets and reference it in your CRD.
1. Generate service token
You can generate a service token for an Infisical project by heading over to the Infisical dashboard then to Project Settings.
2. Create Kubernetes secret containing service token
Once you have generated the service token, you will need to create a Kubernetes secret containing the service token you generated.
To quickly create a Kubernetes secret containing the generated service token, you can run the command below. Make sure you replace <your-service-token-here> with your service token.
3. Add reference for the Kubernetes secret containing service token
Once the secret is created, add the name and namespace of the secret that was just created under authentication.serviceToken.serviceTokenSecretReference field in the InfisicalSecret resource.
Make sure to also populate the secretsScope field with the, environment slug
envSlug, and secrets path secretsPath that you want to fetch secrets
from. Please see the example below.
Example
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalSecretmetadata:name: infisicalsecret-sample-crdspec: authentication: serviceToken: serviceTokenSecretReference:secretName: service-token # <-- name of the Kubernetes secret that stores our service tokensecretNamespace: option # <-- namespace of the Kubernetes secret that stores our service token secretsScope:envSlug: <env-slug># "dev", "staging", "prod", etc..secretsPath: <secrets-path># Root is "/"...
The managedSecretReference field is used to define the target location for storing secrets retrieved from an Infisical project.
This field requires specifying both the name and namespace of the Kubernetes secret that will hold these secrets.
The Infisical operator will automatically create the Kubernetes secret with the specified name/namespace and keep it continuously updated.
Note: The managed secret be should be created in the same namespace as the deployment that will use it.
The name of the managed Kubernetes secret to be created
The namespace of the managed Kubernetes secret to be created.
Override the default Opaque type for managed secrets with this field. Useful for creating kubernetes.io/dockerconfigjson secrets.
Templates enable you to transform data from Infisical before storing it as a Kubernetes Secret.
When set to true, this option injects all secrets retrieved from Infisical into your configuration.
Secrets defined in the template will override the automatically injected secrets.
Define secret keys and their corresponding templates.
Each data value uses a Golang template with access to all secrets retrieved from the specified scope.
Secrets are structured as follows:
type TemplateSecret struct { Value string `json:"value"` SecretPath string `json:"secretPath"`}
kubectl get secret managed-secret -ojsonpath='{.data}'
You’ll receive Kubernetes secrets output that includes the NEW_KEY:
{... "KEY":"d29ybGQ=","NEW_KEY":"LyBoZWxsbw=="}
When you set includeAllSecrets as false the Kubernetes secrets outputs will be:
{"NEW_KEY":"LyBoZWxsbw=="}
Creation polices allow you to control whether or not owner references should be added to the managed Kubernetes secret that is generated by the Infisical operator.
This is useful for tools such as ArgoCD, where every resource requires an owner reference; otherwise, it will be pruned automatically.
Available options
Orphan (default)
Owner
When creation policy is set to Owner, the InfisicalSecret CRD must be in
the same namespace as where the managed kubernetes secret.
The operator will transfer all labels & annotations present on the InfisicalSecret CRD to the managed Kubernetes secret to be created.
Thus, if a specific label is required on the resulting secret, it can be applied as demonstrated in the following example:
Once you have configured the InfisicalSecret CRD with the required fields, you can apply it to your cluster.
After applying, you should notice that the managed secret has been created in the desired namespace your specified.
Incorporating the managed secret created by the operator into your deployment can be achieved through several methods.
Here, we will highlight three of the most common ways to utilize it. Learn more about Kubernetes secrets here
This will take all the secrets from your managed secret and expose them to your container
envFrom:- secretRef:name: managed-secret # managed secret name ``` Example usage in a deployment ```yamlapiVersion: apps/v1kind: Deploymentmetadata:name: nginx-deployment labels:app: nginxspec:replicas:1 selector: matchLabels:app: nginx template: metadata: labels:app: nginx spec: containers:-name: nginximage: nginx:1.14.2 envFrom:- secretRef:name: managed-secret # <- name of managed secret ports:-containerPort:80
This will allow you to select individual secrets by key name from your managed secret and expose them to your container
env:-name: SECRET_NAME # The environment variable's name which is made available in the container valueFrom: secretKeyRef:name: managed-secret # managed secret namekey: SOME_SECRET_KEY # The name of the key which exists in the managed secret
Example usage in a deployment
apiVersion: apps/v1kind: Deploymentmetadata:name: nginx-deploymentlabels:app: nginxspec:replicas:1selector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec:containers:-name: nginximage: nginx:1.14.2env:-name: STRIPE_API_SECRETvalueFrom:secretKeyRef:name: managed-secret # <- name of managed secretkey: STRIPE_API_SECRETports:-containerPort:80
This will allow you to create a volume on your container which comprises of files holding the secrets in your managed kubernetes secret
volumes:-name: secrets-volume-name # The name of the volume under which secrets will be stored secret:secretName: managed-secret # managed secret name
You can then mount this volume to the container’s filesystem so that your deployment can access the files containing the managed secrets
Connecting to instances with private/self-signed certificate
To connect to Infisical instances behind a private/self-signed certificate, you can configure the TLS settings in the InfisicalSecret CRD
to point to a CA certificate stored in a Kubernetes secret resource.
Deployments using managed secrets don’t reload automatically on updates, so they may use outdated secrets unless manually redeployed.
To address this, we added functionality to automatically redeploy your deployment when its managed secret updates.
When a secret change occurs, the operator will check to see which deployments are using the operator-managed Kubernetes secret that received the update.
Then, for each deployment that has this annotation present, a rolling update will be triggered.
Below is a sample InfisicalPushSecret CRD that pushes secrets defined in a Kubernetes secret to Infisical.
After filling out the fields in the InfisicalPushSecret CRD, you can apply it directly to your cluster.
Before applying the InfisicalPushSecret CRD, you need to create a Kubernetes secret containing the secrets you want to push to Infisical. An example can be seen below the InfisicalPushSecret CRD.
kubectl apply -f source-secret.yaml
After applying the soruce-secret.yaml file, you are ready to apply the InfisicalPushSecret CRD.
kubectl apply -f infisical-push-secret.yaml
After applying the InfisicalPushSecret CRD, you should notice that the secrets you have defined in your source-secret.yaml file have been pushed to your specified destination in Infisical.
infisical-push-secret.yaml
apiVersion: secrets.infisical.com/v1alpha1kind: InfisicalPushSecret metadata:name: infisical-push-secret-demo spec:resyncInterval: 1mhostAPI: https://app.infisical.com/api# Optional, defaults to no replacement.updatePolicy: Replace # If set to replace, existing secrets inside Infisical will be replaced by the value of the PushSecret on sync.# Optional, defaults to no deletion.deletionPolicy: Delete # If set to delete, the secret(s) inside Infisical managed by the operator, will be deleted if the InfisicalPushSecret CRD is deleted. destination:projectId: <project-id>environmentSlug: <env-slug>secretsPath: <secret-path> push: secret:secretName: push-secret-demo # Secret CRDsecretNamespace: default# Only have one authentication method defined or you are likely to run into authentication issues.# Remove all except one authentication method. authentication: awsIamAuth:identityId: <machine-identity-id> azureAuth:identityId: <machine-identity-id> gcpIamAuth:identityId: <machine-identity-id>serviceAccountKeyFilePath: </path-to-service-account-key-file.json> gcpIdTokenAuth:identityId: <machine-identity-id> kubernetesAuth:identityId: <machine-identity-id> serviceAccountRef:name: <secret-name>namespace: <secret-namespace> universalAuth: credentialsRef:secretName: <secret-name># universal-auth-credentialssecretNamespace: <secret-namespace># default
source-secret.yaml
apiVersion: v1kind: Secret metadata:name: push-secret-demonamespace: defaultstringData:# can also be "data", but needs to be base64 encodedAPI_KEY: some-api-keyDATABASE_URL: postgres://127.0.0.1:5432ENCRYPTION_KEY: fabcc12-a22-facbaa4-11aa568aab
If you are fetching secrets from a self-hosted instance of Infisical set the value of hostAPI to
https://your-self-hosted-instace.com/api
When hostAPI is not defined the operator fetches secrets from Infisical Cloud.
If you have installed your Infisical instance within the same cluster as the Infisical operator, you can optionally access the Infisical backend’s service directly without having to route through the public internet.
To achieve this, use the following address for the hostAPI field:
The field is optional and will default to None if not defined.
The update policy defines how the operator should handle conflicting secrets when pushing secrets to Infisical.
Valid values are None and Replace.
Behavior of each policy:
None: The operator will not override existing secrets in Infisical. If a secret with the same key already exists, the operator will skip pushing that secret, and the secret will not be managed by the operator.
Replace: The operator will replace existing secrets in Infisical with the new secrets. If a secret with the same key already exists, the operator will update the secret with the new value.
spec:updatePolicy: Replace
This field is optional and will default to None if not defined.
The deletion policy defines what the operator should do in case the InfisicalPushSecret CRD is deleted.
Valid values are None and Delete.
Behavior of each policy:
None: The operator will not delete the secrets in Infisical when the InfisicalPushSecret CRD is deleted.
Delete: The operator will delete the secrets in Infisical that are managed by the operator when the InfisicalPushSecret CRD is deleted.
spec:deletionPolicy: Delete
The destination field is used to specify where you want to create the secrets in Infisical. The required fields are projectId, environmentSlug, and secretsPath.
The project ID where you want to create the secrets in Infisical.
The environment slug where you want to create the secrets in Infisical.
The path where you want to create the secrets in Infisical. The root path is /.
The push field is used to define what you want to push to Infisical. Currently the operator only supports pushing Kubernetes secrets to Infisical. An example of the push field is shown below.
The secret field is used to define the Kubernetes secret you want to push to Infisical. The required fields are secretName and secretNamespace.
apiVersion: v1kind: Secret metadata:name: push-secret-demonamespace: default# Pass in the secrets you wish to push to Infisical stringData:API_KEY: some-api-keyDATABASE_URL: postgres://127.0.0.1:5432ENCRYPTION_KEY: fabcc12-a22-facbaa4-11aa568aab
The authentication field dictates which authentication method to use when pushing secrets to Infisical.
The available authentication methods are universalAuth, kubernetesAuth, awsIamAuth, azureAuth, gcpIdTokenAuth, and gcpIamAuth.
The universal authentication method is one of the easiest ways to get started with Infisical. Universal Auth works anywhere and is not tied to any specific cloud provider.
Read more about Universal Auth.
Valid fields:
identityId: The identity ID of the machine identity you created.
credentialsRef: The name and namespace of the Kubernetes secret that stores the service token.
credentialsRef.secretName: The name of the Kubernetes secret.
credentialsRef.secretNamespace: The namespace of the Kubernetes secret.
The Kubernetes machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used within a Kubernetes environment.
Read more about Kubernetes Auth.
Valid fields:
identityId: The identity ID of the machine identity you created.
serviceAccountRef: The name and namespace of the service account that will be used to authenticate with Infisical.
serviceAccountRef.name: The name of the service account.
serviceAccountRef.namespace: The namespace of the service account.
The AWS IAM machine identity authentication method is used to authenticate with Infisical. Azure Auth can only be used from within an Azure environment.
Read more about Azure Auth.
Valid fields:
identityId: The identity ID of the machine identity you created.
The GCP IAM machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used both within and outside GCP environments.
Read more about Azure Auth.
Valid fields:
identityId: The identity ID of the machine identity you created.
serviceAccountKeyFilePath: The path to the GCP service account key file.
The GCP ID Token machine identity authentication method is used to authenticate with Infisical. The identity ID is stored in a field in the InfisicalSecret resource. This authentication method can only be used within GCP environments.
Read more about Azure Auth.
Valid fields:
identityId: The identity ID of the machine identity you created.
This block defines the TLS settings to use for connecting to the Infisical
instance.
Fields:
This block defines the reference to the CA certificate to use for connecting to the Infisical instance with SSL/TLS.
Valid fields:
secretName: The name of the Kubernetes secret containing the CA certificate to use for connecting to the Infisical instance with SSL/TLS.
secretNamespace: The namespace of the Kubernetes secret containing the CA certificate to use for connecting to the Infisical instance with SSL/TLS.
key: The name of the key in the Kubernetes secret which contains the value of the CA certificate to use for connecting to the Infisical instance with SSL/TLS.
Applying the InfisicalPushSecret CRD to your cluster
Once you have configured the InfisicalPushSecret CRD with the required fields, you can apply it to your cluster.
After applying, you should notice that the secrets have been pushed to Infisical.
kubectl apply -f source-push-secret.yaml # The secret that you're referencing in the InfisicalPushSecret CRD push.secret field kubectl apply -f example-infisical-push-secret-crd.yaml # The InfisicalPushSecret CRD itself
Connecting to instances with private/self-signed certificate
To connect to Infisical instances behind a private/self-signed certificate, you can configure the TLS settings in the InfisicalPushSecret CRD
to point to a CA certificate stored in a Kubernetes secret resource.
To configure global settings that will apply to all instances of InfisicalSecret, you can define these configurations in a Kubernetes ConfigMap.
For example, you can configure all InfisicalSecret instances to fetch secrets from a single backend API without specifying the hostAPI parameter for each instance.
All global configurations must reside in a Kubernetes ConfigMap named infisical-config in the namespace infisical-operator-system.
To apply global configuration to the operator, copy the following yaml into infisical-config.yaml file.
If the operator is unable to fetch secrets from the API, it will not affect the managed Kubernetes secret.
It will continue attempting to reconnect to the API indefinitely.
The InfisicalSecret resource uses the status.conditions field to report its current state and any errors encountered.
$ kubectl get infisicalSecretsNAME AGEinfisicalsecret-sample 12s$ kubectl describe infisicalSecret infisicalsecret-sample...Spec:...Status: Conditions:Last Transition Time:2022-12-18T04:29:09ZMessage: Infisical controller has located the Infisical token in provided Kubernetes secretReason: OKStatus:TrueType: secrets.infisical.com/LoadedInfisicalTokenLast Transition Time:2022-12-18T04:29:10ZMessage:Failed to update secret because: 400 Bad RequestReason: ErrorStatus:FalseType: secrets.infisical.com/ReadyToSyncSecretsEvents: <none>