Skip to main content

Documentation Index

Fetch the complete documentation index at: https://infisical.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

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 configured in Infisical with access to the relevant project(s).
  • An InfisicalConnection resource created in your cluster.

Example

You can only define one authentication method per InfisicalAuth resource.
Authenticates using a client ID and client secret. Works anywhere, not tied to any cloud provider.Read more about Universal Auth.
FieldRequiredDescription
clientIdRefYesReference to the secret containing the universal auth client ID.
clientSecretRefYesReference to the secret containing the universal auth client secret.
1

Create a machine identity

You need to create a machine identity, and give it access to the project(s) you want to interact with. You can read more about machine identities here.
2

Create Kubernetes secret containing machine identity 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.
  kubectl create secret generic universal-auth-credentials \
   --from-literal=clientId="<your-identity-client-id>" \
   --from-literal=clientSecret="<your-identity-client-secret>"
3

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 universal.clientIdRef and universal.clientSecretRef fields in the InfisicalAuth resource. See the full example below for reference.
infisical-auth.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
Apply the resource:
kubectl apply -f infisical-auth.yaml
Authenticates using AWS IAM. Can only be used within AWS environments such as EC2, Lambda, and EKS.Read more about AWS IAM Auth.
FieldRequiredDescription
identityIdRefYesReference to the secret containing the machine identity ID.
infisical-auth.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:
kubectl create secret generic aws-iam-credentials \
  --from-literal=identityId="<your-machine-identity-id>"
Apply the resource:
kubectl apply -f infisical-auth.yaml
Authenticates using Azure managed identity. Can only be used within Azure environments.Read more about Azure Auth.
FieldRequiredDescription
identityIdRefYesReference to the secret containing the machine identity ID.
resourceNoThe Azure resource (audience) to request a token for.
infisical-auth.yaml
apiVersion: secrets.infisical.com/v1beta1
kind: InfisicalAuth
metadata:
  name: my-infisical-auth
spec:
  infisicalConnectionRef:
    name: my-infisical-connection
    namespace: default
  method: azure
  azure:
    identityIdRef:
      name: azure-credentials
      namespace: default
      key: identityId
The referenced Kubernetes secret must contain the machine identity ID:
kubectl create secret generic azure-credentials \
  --from-literal=identityId="<your-machine-identity-id>"
Apply the resource:
kubectl apply -f infisical-auth.yaml
Authenticates using GCP ID tokens. Can only be used within GCP environments.Read more about GCP ID Token Auth.
FieldRequiredDescription
identityIdRefYesReference to the secret containing the machine identity ID.
infisical-auth.yaml
apiVersion: secrets.infisical.com/v1beta1
kind: InfisicalAuth
metadata:
  name: my-infisical-auth
spec:
  infisicalConnectionRef:
    name: my-infisical-connection
    namespace: default
  method: gcp-id-token
  gcpIdToken:
    identityIdRef:
      name: gcp-id-token-credentials
      namespace: default
      key: identityId
The referenced Kubernetes secret must contain the machine identity ID:
kubectl create secret generic gcp-id-token-credentials \
  --from-literal=identityId="<your-machine-identity-id>"
Apply the resource:
kubectl apply -f infisical-auth.yaml
Authenticates using GCP IAM with a service account key file. Works both within and outside GCP environments.Read more about GCP IAM Auth.
FieldRequiredDescription
identityIdRefYesReference to the secret containing the machine identity ID.
serviceAccountKeyFilePathYesPath to the GCP service account key file mounted in the operator pod.
infisical-auth.yaml
apiVersion: secrets.infisical.com/v1beta1
kind: InfisicalAuth
metadata:
  name: my-infisical-auth
spec:
  infisicalConnectionRef:
    name: my-infisical-connection
    namespace: default
  method: gcp-iam
  gcpIam:
    identityIdRef:
      name: gcp-iam-credentials
      namespace: default
      key: identityId
    serviceAccountKeyFilePath: /path/to/service-account-key.json
The referenced Kubernetes secret must contain the machine identity ID:
kubectl create secret generic gcp-iam-credentials \
  --from-literal=identityId="<your-machine-identity-id>"
Apply the resource:
kubectl apply -f infisical-auth.yaml
Authenticates using LDAP credentials.Read more about LDAP Auth.
FieldRequiredDescription
identityIdRefYesReference to the secret containing the machine identity ID.
usernameRefYesReference to the secret containing the LDAP username.
passwordRefYesReference to the secret containing the LDAP password.
infisical-auth.yaml
apiVersion: secrets.infisical.com/v1beta1
kind: InfisicalAuth
metadata:
  name: my-infisical-auth
spec:
  infisicalConnectionRef:
    name: my-infisical-connection
    namespace: default
  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
The referenced Kubernetes secret must contain identityId, username, and password keys:
kubectl create secret generic ldap-credentials \
  --from-literal=identityId="<your-machine-identity-id>" \
  --from-literal=username="<your-ldap-username>" \
  --from-literal=password="<your-ldap-password>"
Apply the resource:
kubectl apply -f infisical-auth.yaml

Troubleshooting

You can check the status of your InfisicalAuth resource by inspecting its conditions:
kubectl get infisicalauth my-infisical-auth -o jsonpath='{.status.conditions}' | jq
When authentication is healthy, the secrets.infisical.com/IsReady condition will have Status: "True" and Reason: "OK". If authentication is unhealthy, 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.