Deploying tekton-pipelines in a global cluster through TektonConfig

TOC

Feature Overview

Customize the configuration of each component in the TektonConfig resource by adjusting the options settings.

Use Cases

Typically, tekton-pipelines should be deployed in various business clusters, specifically designed for deployment in those environments.

If a user wishes to deploy this service in a global cluster, they need to reference this document for configuration, as the network, authentication settings, and other configurations in the global cluster differ from those in business clusters.

Prerequisites

Before using this feature, ensure the following:

Deployment Process

If a user wants to deploy this service in a global cluster, they need to adjust the TektonConfig resource configuration because the global cluster's network, authentication settings, and other configurations differ from those of the business cluster.

To correctly deploy tekton-pipelines in the global cluster, the user must modify the TektonConfig resource through the following configuration of spec.pipeline.options:

apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
spec:
  pipeline:
    options:
      ingress:
        tektoncd-hubs-api:
          spec:
            ingressClassName: global-alb2
      deployments:
        tektoncd-hubs-api:
          spec:
            template:
              spec:
                containers:
                  - env:
                      - name: KUBERNETES_PORT_443_TCP
                        value: tcp://erebus.cpaas-system:443
                      - name: KUBERNETES_PORT_443_TCP_ADDR
                        value: erebus.cpaas-system
                      - name: KUBERNETES_PORT
                        value: tcp://erebus.cpaas-system:443
                      - name: EREBUS
                        value: https://erebus.cpaas-system:443
                      - name: KUBERNETES_SERVICE_HOST
                        value: erebus.cpaas-system
                    name: tektoncd-hubs-api
      disabled: false

Optional: Deploying tekton-results in a global cluster

If users have deployed tekton-results in a global cluster, they also need to configure the options for the results component. Similar to the pipeline configuration, you need to configure both ingress and deployment settings for the tektoncd-results-api component.

Add the following configuration to the spec.results.options section:

apiVersion: operator.tekton.dev/v1alpha1
kind: TektonResult
metadata:
  name: result
spec:
  options:
    ingress:
      tektoncd-results-api:
        spec:
          ingressClassName: global-alb2
    deployments:
      tektoncd-results-api:
        spec:
          template:
            spec:
              containers:
                - env:
                    - name: KUBERNETES_PORT_443_TCP
                      value: tcp://erebus.cpaas-system:443
                    - name: KUBERNETES_PORT_443_TCP_ADDR
                      value: erebus.cpaas-system
                    - name: KUBERNETES_PORT
                      value: tcp://erebus.cpaas-system:443
                    - name: EREBUS
                      value: https://erebus.cpaas-system:443
                    - name: KUBERNETES_SERVICE_HOST
                      value: erebus.cpaas-system
                  name: tektoncd-results-api
    disabled: false