Configure Custom Certificates
This guide is for cluster administrators who need to configure PAC to trust self-signed certificates or custom CA certificates for Git providers.
Note: Throughout this document, <pac-namespace> or tekton-pipelines refers to the namespace where PAC is deployed. The default namespace is tekton-pipelines, but you can customize it via targetNamespace in the TektonConfig CR. Replace <pac-namespace> or tekton-pipelines with your actual namespace name if different.
This guide explains how to configure PAC to work with Git hosting services that use self-signed certificates or custom CA certificates, such as GitHub Enterprise or self-hosted GitLab.
TOC
PrerequisitesOverviewStep 1: Prepare the CA CertificateStep 2: Create ConfigMap with CA CertificateMethod 1: From FileMethod 2: Manual CreationStep 3: Mount Certificate in PAC ControllerForTektonConfig CRFor automatic webhook registrationConfigure automatic webhook registrationStep 4: Apply ConfigurationStep 5: Verify Certificate ConfigurationCheck Certificate is MountedCheck Enhancement controller configurationCheck PAC Controller LogsTest with a RepositoryTroubleshootingCheck if Certificate is Not TrustedCheck if Certificate is ExpiredWrong CertificatePod Not RestartingMultiple CertificatesOption 1: Combine Certificates in Single ConfigMapOption 2: Use Separate ConfigMapsBest Practices1. Certificate Management2. Security3. TroubleshootingNext StepsPrerequisites
Before configuring custom certificates, ensure you have:
- PAC component deployed
- Administrator access to the cluster
- Access to the CA certificate file
- Ability to modify the
TektonConfigCR
Overview
When your Git hosting service uses self-signed certificates or certificates signed by a custom CA, configure the trust chain for each outbound connection separately:
This requires:
- Creating a ConfigMap with the CA certificate
- Mounting the certificate in PAC controller pods
- Mounting the same certificate in the
tektoncd-enhancement-controllerwhen automatic webhook registration is used - Configuring Git and HTTPS clients to use the certificate
Step 1: Prepare the CA Certificate
Obtain the CA certificate file from your Git hosting service administrator or from your organization's certificate authority.
Common locations for CA certificates:
- Self-hosted GitLab: Usually available in the GitLab installation or from your organization's CA
- GitHub Enterprise: Available from your GitHub Enterprise Server administrator
The certificate file should be in PEM format:
Step 2: Create ConfigMap with CA Certificate
Create a ConfigMap containing the CA certificate in the PAC namespace (default: tekton-pipelines, replace with your actual PAC namespace if different):
Method 1: From File
Example output:
Method 2: Manual Creation
Create a YAML file git-ca-cert-configmap.yaml:
Apply it:
Example output:
Note: Replace <your-ca-certificate-content> with the actual certificate content.
Step 3: Mount Certificate in PAC Controller
Mount the certificate in the PAC controller pods by updating the TektonConfig CR.
For TektonConfig CR
On a Kubernetes cluster the PAC options live under platforms.kubernetes. The operator rejects platforms.openshift there, and rejects platforms.kubernetes on OpenShift:
Do not put this block on the derived OpenShiftPipelinesAsCode CR instead. The operator copies options back over from TektonConfig on every reconcile, so the mount disappears again. The one exception is a cluster where TektonConfig does not manage PAC at all — spec.profile is basic or lite — in which case the same options block goes on that CR under spec.options. See How the Operator Manages PAC.
Important:
- The certificate is mounted at
/etc/ssl/certs/git-ca.crtin the container - Environment variables
GIT_SSL_CAINFOandSSL_CERT_FILEtell Git to use this certificate - After
TektonConfigis updated, the Operator will automatically restart the PAC controller pods
For automatic webhook registration
If you use automatic webhook registration for GitLab or GitHub Webhook mode, mount the same CA bundle into tektoncd-enhancement-controller and set SSL_CERT_FILE. This controller is managed by TektonConfig, so update spec.pipeline.options.deployments instead of patching the Deployment directly. The controller also honors GIT_SSL_CAINFO when SSL_CERT_FILE is not set.
Example TektonConfig patch:
The CA mounted in this section is needed only for the Enhancement controller-to-Git-provider API connection. It does not change webhook payload validation or the certificate verification performed by the Git provider when it calls the PAC webhook.
Configure automatic webhook registration
The tektoncd-enhancement-controller reads automatic webhook registration settings from the managed tektoncd-enhancement-config ConfigMap. Configure that ConfigMap through TektonConfig; do not edit the managed ConfigMap directly:
webhook-target-tls-verify controls only whether GitLab or GitHub verifies the PAC webhook URL certificate when delivering events. It does not disable TLS verification for tektoncd-enhancement-controller or pipelines-as-code-controller when they call the Git provider API. For those connections, configure the CA mount and environment variables above. See Configure Enhancement Features via TektonConfig for the full configuration reference.
Keep webhook-target-tls-verify: true in production whenever the Git provider can trust the PAC webhook certificate. Setting it to false weakens verification of the provider-to-PAC connection and is not a substitute for installing the correct CA certificate.
Step 4: Apply Configuration
Apply the updated TektonConfig:
Example output:
The Operator reconciles the managed ConfigMap and deployments after the CR update. pac-webhook-registration.* settings are hot-reloaded and do not require a rollout; changing a CA volume or environment variable does require the corresponding controller deployment to restart. Check the affected deployments as applicable:
Example output:
Step 5: Verify Certificate Configuration
Check Certificate is Mounted
Verify the certificate is mounted in the PAC controller pod:
Example output — the git-ca-cert volume is the one this guide adds; tls is present on every PAC controller pod:
If only tls is listed, the operator has not applied the mount yet — or it never reached the Deployment, which is what happens when the options block was written on the derived CR instead of on TektonConfig.
You should see the volume configuration showing the certificate is mounted.
Check Enhancement controller configuration
Verify that the managed Enhancement ConfigMap contains the expected registration settings and that the controller pod has the CA environment variables:
The pac-webhook-registration.webhook-target-tls-verify value belongs in the ConfigMap data shown above. The CA path belongs in the Enhancement controller environment, and both settings are managed through TektonConfig.
Check PAC Controller Logs
Check the PAC controller logs for any certificate-related errors:
If configured correctly, you should not see SSL/TLS certificate errors in the logs.
For automatic webhook registration, check the Enhancement controller logs separately:
Errors such as x509: certificate signed by unknown authority in these logs indicate that the Enhancement controller cannot trust the Git provider API certificate. They are not fixed by webhook-target-tls-verify: false; mount the correct CA bundle and set SSL_CERT_FILE/GIT_SSL_CAINFO instead.
Test with a Repository
Trigger a test pipeline from a repository hosted on your Git service:
Example output:
Check if the PipelineRun is created successfully:
Example output:
Troubleshooting
Check if Certificate is Not Trusted
Problem: PAC still cannot connect to your Git service due to certificate issues.
Solutions:
- Verify certificate format: Ensure the certificate is in PEM format with proper BEGIN/END markers
- Check certificate path: Verify the certificate is mounted at the correct path
- Verify environment variables: Ensure
GIT_SSL_CAINFOandSSL_CERT_FILEare set correctly - Check ConfigMap: Verify the ConfigMap exists and contains the certificate:
Example output:
Check if Certificate is Expired
Problem: The CA certificate has expired.
Solutions:
-
Obtain a new CA certificate from your certificate authority
-
Update the ConfigMap:
Example output:
-
Restart PAC controller pods:
Wrong Certificate
Problem: Using the wrong CA certificate for your Git service.
Solutions:
- Verify you're using the correct CA certificate for your Git hosting service
- For self-hosted services, obtain the certificate directly from the service
- For enterprise services, contact your administrator for the correct certificate
Pod Not Restarting
Problem: PAC controller pods are not restarting after TektonConfig was updated.
Solutions:
-
Check CR status:
Example output:
-
Check Operator logs:
Example output (example log entries):
- Manually restart the deployment:
Multiple Certificates
If you need to trust multiple CA certificates (e.g., multiple Git hosting services), you can:
Option 1: Combine Certificates in Single ConfigMap
Combine multiple certificates in a single file:
Option 2: Use Separate ConfigMaps
Use separate ConfigMaps and mount them in different locations, then configure Git to use a certificate bundle:
Create a certificate bundle by combining all certificates into a single file.
Best Practices
1. Certificate Management
- Store securely: Keep CA certificates in secure storage
- Version control: Track certificate changes in version control (if not sensitive)
- Documentation: Document which certificates are used and their sources
- Expiration tracking: Monitor certificate expiration dates
2. Security
- Least privilege: Only grant access to necessary certificates
- Rotation: Rotate certificates regularly
- Validation: Validate certificates before deploying
3. Troubleshooting
- Test first: Test certificate configuration with a test repository before applying to production
- Monitor logs: Regularly check PAC controller logs for certificate errors
- Backup: Keep backup copies of working certificate configurations
Next Steps
- Create a Git Secret for PAC - Set up Git provider credentials
- Manage PAC Component - Learn about managing PAC deployment
- Configure GitHub Repository - GitHub-specific configuration guide
- Configure GitLab Repository - GitLab-specific configuration guide
- Configure Enhancement Features via TektonConfig - Automatic webhook registration settings
- Common Issues - Troubleshooting guide