Manage PAC Component
This guide is for cluster administrators only. It covers PAC component deployment, configuration, and maintenance tasks that require cluster administrator permissions.
Regular users should refer to:
- Configure Repository - Set up Git provider integration
- Maintain Pipeline Code - Create and manage pipelines
This guide explains how to deploy, update, and uninstall the Pipelines-as-Code (PAC) component on Kubernetes platforms.
TOC
PrerequisitesDeploy PAC ComponentDeploy PAC ComponentStep 1: Create theOpenShiftPipelinesAsCode CRStep 2: Apply the ConfigurationStep 3: Verify DeploymentConfigure AccessUsing Ingress (HTTP)Using Ingress (HTTPS)Using NodePortHow to Get PAC Controller URLIf Using IngressIf Using NodePortAutomatic Detection by tkn pacConfiguration SettingsUpdate PAC ComponentUpdate ConfigurationUpdate Component VersionVerify UpdatesRollback ConfigurationCommon Configuration UpdatesChange Application NameEnable Error DetectionUpdate Hub URLDisable Remote TasksConfigure Custom Console LinksUninstall PAC ComponentDelete OpenShiftPipelinesAsCode CRStep 1: Delete the CRStep 2: Verify UninstallationClean Up Additional ResourcesDelete Repository CRsDelete SecretsDelete Ingress/ServiceTroubleshootingPAC Pods Not StartingOpenShiftPipelinesAsCode CR Not ReadyTektonInstallerSet IssuesCR Not DeletingResources Not RemovedNext StepsPrerequisites
Before managing PAC, ensure you have:
- Kubernetes cluster (version 1.24 or higher)
- Tekton Operator installed and running
- Cluster administrator permissions
- kubectl installed and configured to access your cluster
Deploy PAC Component
Platform Support: Although the resource name contains "OpenShift", PAC can be deployed on Kubernetes platforms through the Tekton Operator patch that adds PAC controller support.
PAC is deployed by directly creating the OpenShiftPipelinesAsCode CR. The operator will automatically create and manage all necessary resources for PAC.
Deploy PAC Component
Step 1: Create the OpenShiftPipelinesAsCode CR
Create a YAML file named pac.yaml:
Important:
- The resource name must be
pipelines-as-code, otherwise the operator will not deploy the PAC component. - The
targetNamespacefield specifies where PAC components will be deployed. The default istekton-pipelines, but you can use any namespace name.
Create the namespace if it doesn't exist:
Step 2: Apply the Configuration
Apply the CR to your cluster:
Example output:
Step 3: Verify Deployment
Check the OpenShiftPipelinesAsCode CR status:
The output should show the CR with Ready status:
Check the TektonInstallerSet status (replace <pac-namespace> with your actual PAC namespace, default is tekton-pipelines):
Example output:
TektonInstallerSet is an internal operator resource used by the Tekton Operator to manage PAC component installation and lifecycle. It acts as a template that the operator uses to create and manage all PAC-related resources (Deployments, Services, ConfigMaps, RBAC, etc.).
Important:
- You should never create, modify, or delete
TektonInstallerSetdirectly - The operator automatically creates and manages it when you create the
OpenShiftPipelinesAsCodeCR - You can check its status for troubleshooting, but all changes should be made through the
OpenShiftPipelinesAsCodeCR - When you delete the
OpenShiftPipelinesAsCodeCR, the operator automatically deletes theTektonInstallerSetand all related resources
Example output:
Verify the PAC pods are running:
Example output:
Note: Throughout this document, <pac-namespace> or tekton-pipelines refers to the namespace where PAC is deployed. Replace it with your actual namespace name if different.
You should see three pods in Running state:
pipelines-as-code-controller-*pipelines-as-code-watcher-*pipelines-as-code-webhook-*
Configure Access
PAC component needs to be exposed so that webhook events from Git providers can reach it. The PAC controller URL is used when configuring webhooks in your Git provider.
Important: Before configuring repositories, you must expose the PAC controller using one of the methods below. The tkn pac create repo command can automatically detect the controller URL if it's exposed via Ingress, but you need to set it up first.
You can use one of the following methods to expose the PAC controller:
Using Ingress (HTTP)
If you have a domain name:
- Configure the
hostfield with your domain name (e.g.,pac.example.com) - Ensure the domain name can be resolved via DNS to your Ingress Controller's IP address
- Configure DNS A record:
pac.example.com→<Ingress-Controller-IP>
If you don't have a domain name:
- Leave the
hostfield empty or remove thehostline from the Ingress configuration - Access PAC using IP address and port:
http://<Ingress-Controller-IP>:<port> - Git providers (GitLab, GitHub) can still send webhooks to the IP address
Create an IngressClass (if not already exists):
- for more info please refer to Creating Ingresses.
Create an Ingress resource (replace <pac-namespace> with your PAC namespace, default is tekton-pipelines):
Apply the Ingress:
Example output:
Alternative: Ingress without domain name (host-less)
If you don't have a domain name, you can create an Ingress without the host field:
Then access PAC using the Ingress Controller's IP address:
Using Ingress (HTTPS)
TLS Certificate Requirements:
- You need a valid TLS certificate for your domain name
- The certificate's Common Name (CN) or Subject Alternative Name (SAN) must match your domain
- For production, use certificates from trusted CA (Let's Encrypt, DigiCert, etc.)
Domain Name Configuration:
- HTTPS Ingress requires a domain name configured in the
hostfield - Ensure DNS resolution:
pac.example.com→<Ingress-Controller-IP> - Access via IP address with HTTPS may cause certificate validation errors
First, create a TLS Secret (replace <pac-namespace> with your PAC namespace, default is tekton-pipelines):
Then create an HTTPS Ingress (replace <pac-namespace> with your PAC namespace, default is tekton-pipelines):
Using NodePort
Create a NodePort Service (replace <pac-namespace> with your PAC namespace, default is tekton-pipelines):
Important:
- The
targetPortmust be8082, which is the port the PAC controller pod listens on for webhook events - The
port(8080) is the Service port (used for internal cluster communication) - The
nodePort(30080) is the external port accessible from outside the cluster - For Ingress, the Service port is 8080, which routes to the controller's port 8082 internally
Get the NodePort (replace <pac-namespace> with your PAC namespace, default is tekton-pipelines):
Example output:
Access PAC at http://<node-ip>:<node-port>.
How to Get PAC Controller URL
After exposing the PAC controller, you can get the URL using the following methods:
If Using Ingress
Get the Ingress host (replace <pac-namespace> with your PAC namespace, default is tekton-pipelines):
Example output:
The controller URL will be:
- HTTP:
http://<ingress-host> - HTTPS:
https://<ingress-host>
If Using NodePort
Get the NodePort and node IP:
Example output:
Automatic Detection by tkn pac
When using tkn pac create repo, the CLI automatically detects the controller URL by:
- Checking for Ingress resources pointing to the PAC controller service
- Checking for LoadBalancer services
- Checking for NodePort services
- If none found, prompting you to manually enter the URL
If automatic detection fails, you can manually enter the controller URL when prompted.
If you're a regular user and need to find the PAC controller URL:
- Try the query commands above (if you have cluster access)
- If the commands don't work or you don't have permission, contact your PAC administrator to get the URL
- The administrator can find it using the methods in this section
Note: The controller URL must be accessible from Git provider servers to receive webhook events.
Configuration Settings
You can customize PAC behavior through the settings field in the OpenShiftPipelinesAsCode CR:
Note on hub-url:
- Default value points to the cluster-internal Tekton Hub service in the default namespace (
tekton-pipelines) - Format:
http://<service-name>.<namespace>:<port>/v1 - If Tekton Hub is deployed in a different namespace, adjust the namespace in the URL accordingly
- The namespace in the
hub-urlis the namespace where Tekton Hub is deployed, which may differ from your PAC namespace (specified bytargetNamespace) - To use an external Hub (e.g., public Tekton Hub), set to
https://api.hub.tekton.dev/v1 - Only the PAC controller needs access to this URL
Note on custom-console-name & custom-console-url:
- These settings are used to configure custom console links in Git provider UI
- The
custom-console-nameis the display name for the custom console links - The
custom-console-urlis the base URL for the custom console (e.g., Devops Console) - The
custom-console-url-pr-detailsis the URL template for PR/MR details page. Supports variables:{{namespace}},{{pipelinerun}} - The
custom-console-url-pr-tasklogis the URL template for PR/MR task log page. Supports variables:{{namespace}},{{pipelinerun}},{{taskrun}} - The
custom-console-url-namespaceis the URL template for namespace page. Supports variable:{{namespace}} - It provides a way to customize the console links in Git provider UI to point to the Devops Console.
For more information about PAC settings, see the Common Configuration Updates section.
Update PAC Component
Update Configuration
-
Edit the
OpenShiftPipelinesAsCodeCR: -
Update the
settingsfield as needed: -
Save and exit. The operator will automatically update the TektonInstallerSet and apply the changes.
Update Component Version
To update the PAC component version, upgrade the Tekton Operator:
- Update the Tekton Operator to the desired version
- The operator will automatically:
- Delete the old TektonInstallerSet
- Create a new TektonInstallerSet with the new PAC version
- Update the
OpenShiftPipelinesAsCodeCR with the new version
Check the version after upgrade:
Verify Updates
After updating the configuration:
-
Check the
OpenShiftPipelinesAsCodeCR status:
Example output:
-
Check if pods are restarting (replace
<pac-namespace>with your PAC namespace):
Example output:
-
Check pod logs for any errors:
Example output:
-
Verify the configuration is applied:
Example output:
Rollback Configuration
If you need to rollback a configuration change:
-
Restore the previous configuration in the
OpenShiftPipelinesAsCodeCR: -
Or restore from a backup:
Create a backup before making changes:
Restore from the backup:
Common Configuration Updates
Change Application Name
Enable Error Detection
Update Hub URL
If your Tekton Hub is deployed in a different namespace or you want to use an external Hub:
To find your Tekton Hub service:
Example output:
Disable Remote Tasks
Configure Custom Console Links
To integrate PAC with your custom console, configure custom console links. This allows pipeline status links in Git providers (GitLab, GitHub, etc.) to point to your custom console.
Configuration Example
How to Configure
Step 1: Identify your cluster name
Contact your cluster administrator to get the correct cluster name. Common examples:
my-cluster- generic cluster namebusiness-1- for business cluster 1dev-cluster- for development cluster
The cluster name appears in the URL path as ~CLUSTER_NAME~ (note the tilde characters).
Step 2: Set the console URL
Set custom-console-url to your console's entry point (without trailing slash):
https://console.example.comhttps://devops.example.com
Step 3: Configure URL templates
Replace CLUSTER_NAME in the URL templates with your actual cluster name. PAC will automatically replace the following variables:
{{ namespace }}: The namespace where the PipelineRun is executed{{ pr }}: The PipelineRun name{{ task }}: The Task name in the PipelineRun
Example: Complete Configuration
For a cluster named my-cluster with console at https://console.example.com:
Example: Generated Links
When PAC creates a PipelineRun named my-app-build-abc123 with a task build-task in namespace my-project:
-
PipelineRun Details:
-
TaskRun Logs:
-
Namespace Pipeline List:
These links will appear in your Git provider's UI (GitLab merge requests, GitHub pull requests, etc.), allowing developers to quickly navigate to your custom console.
Uninstall PAC Component
Delete OpenShiftPipelinesAsCode CR
Step 1: Delete the CR
Example output:
The operator will automatically:
- Delete the TektonInstallerSet (internal operator resource)
- Remove all PAC-related resources (Deployments, Services, ConfigMaps, etc.)
- Clean up RBAC resources
Note: TektonInstallerSet is an internal operator resource. You should not delete it manually. The operator manages its lifecycle automatically.
Step 2: Verify Uninstallation
Check that the OpenShiftPipelinesAsCode CR is deleted:
Verify TektonInstallerSet is deleted (replace <pac-namespace> with your PAC namespace):
Note: This is a read-only check to verify the internal operator resource has been cleaned up. Do not attempt to delete TektonInstallerSet manually.
Example output (should be empty if deleted successfully):
Check that PAC pods are terminated:
Example output (should be empty if deleted successfully):
Clean Up Additional Resources
After uninstalling PAC, you may want to clean up additional resources:
Delete Repository CRs
If you have Repository CRs created for Git provider integration:
Example output:
Delete Secrets
Important: When you delete the OpenShiftPipelinesAsCode CR, the operator automatically cleans up secrets with the label app.kubernetes.io/part-of=pipelines-as-code in the PAC namespace. However, you need to manually delete Repository CR-related secrets that were created for Git provider authentication.
Secrets that are automatically cleaned up (in PAC namespace):
pipelines-as-code-secret- PAC controller's internal secret (with labelapp.kubernetes.io/part-of=pipelines-as-code)
Secrets that need manual cleanup (in Repository CR namespaces):
gitlab-secret/github-secret- Git provider access tokenswebhook-secret- Webhook validation secretsgit-auth-secret- Private repository access tokensgit-ssh-secret- SSH keys for repository access
To find and delete Repository CR-related secrets:
-
List all secrets in the namespace where Repository CRs are located:
-
Identify secrets that you created specifically for PAC Repository CRs.
Note: Secret names may vary depending on how they were created. Review the list carefully to identify which secrets are related to PAC.
-
Before deleting, ensure:
- All Repository CRs that use the secret have been deleted
- The secret is not used by other applications or resources in the cluster
- You have verified the secret is safe to remove
-
Delete the secret only if you are certain it's no longer needed:
Warning:
- Secrets may be shared across multiple Repository CRs or other resources
- Deleting a secret that is still in use will cause authentication failures
- Always verify the secret is not referenced elsewhere before deletion
Example output:
Delete Ingress/Service
If you created Ingress or NodePort Service for PAC (replace <pac-namespace> with your PAC namespace):
Example output:
Troubleshooting
PAC Pods Not Starting
Check pod logs (replace <pac-namespace> with your PAC namespace):
Example output (example log entries):
OpenShiftPipelinesAsCode CR Not Ready
Check the CR status and events:
Example output (abbreviated):
TektonInstallerSet Issues
Important: TektonInstallerSet is an internal operator resource. If you encounter issues with it, do not modify or delete it directly. Instead, troubleshoot through the OpenShiftPipelinesAsCode CR.
Check TektonInstallerSet status for troubleshooting (replace <pac-namespace> with your PAC namespace):
If the TektonInstallerSet shows errors:
- Check the
OpenShiftPipelinesAsCodeCR status for underlying issues - Review operator logs for detailed error messages
- If necessary, delete and recreate the
OpenShiftPipelinesAsCodeCR (the operator will automatically recreate the TektonInstallerSet)
Example output (abbreviated):
CR Not Deleting
If the OpenShiftPipelinesAsCode CR is not deleting, check for finalizers:
Example output (if finalizers exist):
If no finalizers are present, the output will be empty, indicating the CR can be deleted.
If finalizers are present, the operator may still be processing. Wait a few moments and try again.
Resources Not Removed
If some resources are not automatically removed:
-
Check TektonInstallerSet status for troubleshooting (replace
<pac-namespace>with your PAC namespace):Note: This is a read-only check.
TektonInstallerSetis an internal operator resource. Do not delete it manually. -
Manually delete remaining resources: