Issue TLS certificates to your Kubernetes workloads using cert-manager and Infisical. Certificates are requested via ACME, stored in Kubernetes Secrets, and renewed automatically before expiration.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.
This guide assumes you have an Application with ACME enrollment configured.
How It Works
- Install cert-manager in your Kubernetes cluster
- Create an
Issuerthat connects to Infisical’s ACME server - Create
Certificateresources that define what certificates you need - cert-manager requests certificates from Infisical and stores them in Secrets
- Certificates are automatically renewed before expiration
Guide
Get ACME Credentials from Infisical
In your Application, go to the Settings tab and find the Certificate Profiles section. Click Configure on the profile with ACME enrollment, then click Reveal ACME EAB to get:
- ACME Directory URL
- EAB Key ID (KID)
- EAB Secret
Currently, ACME enrollment uses dedicated EAB credentials. Support for Kubernetes Auth is planned.
Install cert-manager
Install cert-manager in your Kubernetes cluster by following the official guide here or by applying the manifest directly:
Create a Kubernetes Secret for the Infisical ACME EAB credentials
Create a Kubernetes
Secret that contains the EAB Secret (HMAC key) obtained in step 1.
The cert-manager uses this secret to authenticate with the Infisical ACME server.- kubectl command
- Configuration file
Create the cert-manager Issuer connecting to Infisical ACME server
Next, create a cert-manager You can check that the issuer was created successfully by running the following command:
Issuer (or ClusterIssuer) by replacing the placeholders <acme_server_url>, <your_email>, and <acme_eab_kid> in the configuration below and applying it.
This resource configures cert-manager to use your Infisical Application’s ACME server for certificate issuance.issuer-infisical.yaml
- Currently, the ACME enrollment method only supports the HTTP-01 challenge method. Support for the DNS-01 challenge method is planned for a future release. If domain ownership validation is not desired, you can disable it by enabling the Skip DNS ownership validation option in your ACME enrollment configuration.
- An
Issueris namespace-scoped. Certificates can only be issued using anIssuerthat exists in the same namespace as theCertificateresource. - If you need to issue certificates across multiple namespaces with a single resource, create a
ClusterIssuerinstead. The configuration is identical exceptkind: ClusterIssuerand nometadata.namespace. - More details: https://cert-manager.io/docs/configuration/acme/
Create the Certificate
Finally, request a certificate from Infisical ACME server by creating a cert-manager The above sample configuration file specifies a certificate to be issued with the dns name You can check that the certificate was created successfully by running the following command:
Certificate resource.
This configuration file specifies the details of the (end-entity/leaf) certificate to be issued.certificate-issuer.yaml
certificate-by-issuer.example.com and ECDSA private key using the P-256 curve, valid for 48 hours; the certificate will be automatically renewed by cert-manager 12 hours before expiry.
The certificate is issued by the issuer issuer-infisical created in the previous step and the resulting certificate and private key will be stored in a secret named certificate-by-issuer.Note that the full list of the fields supported on the Certificate resource can be found in the API reference documentation here.The
enableDurationFeature: true flag in the Issuer configuration (Step 4) is required for cert-manager to honor the duration field. Without it, certificates default to 47 days regardless of what you specify. This flag is disabled by default in cert-manager because public ACME servers like Let’s Encrypt don’t support custom durations.cert-manager does not currently support specifying a
pathLen in the Certificate resource. When issuing CA certificates with isCA: true, ensure your Infisical certificate policy does not set a Maximum Allowed Path Length restriction, otherwise the request will fail validation.Use Certificate in Kubernetes Secret
Since the actual certificate and private key are stored in a Kubernetes secret, we can check that the secret was created successfully by running the following command:We can Here, In any case, the certificate is ready to be used as Kubernetes Secret by your Kubernetes resources.
describe the secret to get more information about it:ca.crt is the Root CA certificate, tls.crt is the requested certificate followed by the certificate chain, and tls.key is the private key for the certificate.We can decode the certificate and print it out using openssl:FAQ
How do I inject the CA certificate into secrets (ca.crt field)?
How do I inject the CA certificate into secrets (ca.crt field)?
By default, cert-manager’s ACME issuer does not populate the 2. Create a CA certificate secretDownload the CA certificate chain from Certificate Manager → Settings → Certificate Authorities (select your CA → Download CA Certificate Chain), then create:3. Create a trust-manager BundleThe Bundle You should now see
ca.crt field in the generated Kubernetes Secret (see GitHub issue). The secret will only contain tls.crt and tls.key.If your application requires ca.crt (e.g., for mTLS), use trust-manager to inject it automatically.1. Install trust-managerinfisical-ca-cert.yaml
trust-bundle.yaml
metadata.name must match your Certificate’s secretName. Update namespaceSelector to target your namespace(s).4. Verifyca.crt, tls.crt, and tls.key in the secret data.What fields can be configured on the Certificate resource?
What fields can be configured on the Certificate resource?
The full list of the fields supported on the
Certificate resource can be found in the API reference documentation here.Currently, not all fields are supported by the Infisical PKI ACME server.
Why is my certificate duration different from what I specified?
Why is my certificate duration different from what I specified?
Make sure your Issuer or ClusterIssuer has
enableDurationFeature: true set under the acme block (see Step 4). Without this flag, cert-manager defaults to 47 days regardless of the duration field in your Certificate resource.This flag is disabled by default in cert-manager because public ACME servers like Let’s Encrypt don’t support custom durations. For more details, see the cert-manager v1.1 release notes.Can certificates be renewed automatically?
Can certificates be renewed automatically?
Yes.
cert-manager will automatically renew certificates according to the renewBefore threshold of expiry as
specified in the corresponding Certificate resource.You can read more about the renewBefore field here.What’s Next?
Nginx with Certbot
Set up ACME for Nginx web servers.
Certificate Syncs
Push certificates to AWS, Azure, and more.
Alerting
Get notified when certificates are about to expire.
ACME Enrollment
Learn more about ACME enrollment configuration.