pipelines

by eddycharly

Helm chartv0.12.0App v0.12.1

This chart bootstraps installation of [tekton pipeline](https://github.com/tektoncd/pipeline).

About this chart

Tekton Pipelines Helm Chart

The Tekton Pipelines project provides k8s-style resources for declaring CI/CD-style pipelines.

This helm chart is a lightweight way to deploy, configure and run Tekton Pipelines on a k8s cluster.

Requirements

  • Helm v2 or v3
  • Kubernetes >= 1.15 (it's driven by the version of Tekton Pipelines installed)
  • Depending on the configuration you will need admin access to be able to install the CRDs

Description

This chart deploys the Tekton Pipelines controller and associated webhook. It should run on k8s as well as OpenShift.

It includes various options to expose metrics and/or profiling endpoints, create rbac resources, run in high availabilty mode, control pods placement and resources, etc...

All options are documented in the Chart Values section.

Various configuration examples are document in the Try it out section.

An additional guide is available in the Production grade configuration section to help deploying Tekton Pipelines in a highlly available and secure mode.

Installing

  • Add helm charts repo
helm repo add eddycharly https://eddycharly.github.io/tekton-helm
  • Install (or upgrade)
# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines
  • Install (or upgrade) without CRDs (assuming CRDs have already been deployed by an admin)
# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --no-crd-hook
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --skip-crds
  • Install (or upgrade) without creating RBAC resources (assuming RBAC resources have been created by an admin)
# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set rbac.create=false --set rbac.controllerServiceAccount=accountName  --set rbac.webhookServiceAccount=accountName
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set rbac.create=false --set rbac.controllerServiceAccount=accountName  --set rbac.webhookServiceAccount=accountName

Look below for the list of all available options and their corresponding description.

Uninstalling

To uninstall the chart, simply delete the release.

# This will uninstall Tekton Pipelines in the tekton namespace (assuming a my-pipeline release name)

# Helm v2
helm delete --purge my-pipeline
# Helm v3
helm uninstall my-pipeline --namespace tekton

Version

Current chart version is 0.12.0

Chart Values

KeyTypeDescriptionDefault
config.artifactBucketobjectConfiguration for artifact bucket (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md)See values.yaml
config.artifactPvcobjectConfiguration for artifact pvc (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md)See values.yaml
config.defaultsobjectConfiguration for default values (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md)See values.yaml
config.featureFlagsobjectConfiguration for feature flagsSee values.yaml
config.leaderElectionobjectConfiguration for leader electionSee values.yaml
config.loggingobjectConfiguration for logging (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md)See values.yaml
config.observabilityobjectConfiguration for observability (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md)See values.yaml
controller.affinityobjectController affinity rules{}
controller.annotationsobjectController pod annotationsSee values.yaml
controller.argslistController argumentsSee values.yaml
controller.image.pullPolicystringController docker image pull policy"IfNotPresent"
controller.image.repositorystringController docker image repository"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller"
controller.image.tagstringController docker image tagnil
controller.metrics.enabledboolEnable controller metrics servicetrue
controller.metrics.portintController metrics service port9090
controller.metrics.portNamestring"metrics"
controller.nodeSelectorobjectController node selector{}
controller.resourcesobjectController resource limits and requests{}
controller.securityContextobjectController pods security context{}
controller.service.annotationsobjectController service annotations{}
controller.service.typestringController service type"ClusterIP"
controller.tolerationslistController tolerations[]
fullnameOverridestringFully override resource generated names""
nameOverridestringPartially override resource generated names""
podSecurityPolicy.enabledboolEnable pod security policyfalse
rbac.controllerServiceAccountstringName of the service account to use for controller when rbac.create is falsenil
rbac.createboolCreate RBAC resourcestrue
rbac.webhookServiceAccountstringName of the service account to use for webhook when rbac.create is falsenil
versionstringTekton pipelines version used to add labels on deployments, pods and servicesnil
webhook.affinityobjectWebhook affinity rules{}
webhook.annotationsobjectWebhook pod annotationsSee values.yaml
webhook.image.pullPolicystringWebhook docker image pull policy"IfNotPresent"
webhook.image.repositorystringWebhook docker image repository"gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook"
webhook.image.tagstringWebhook docker image tagnil
webhook.metrics.enabledboolEnable webhook metrics servicetrue
webhook.metrics.portintWebhook metrics service port9090
webhook.metrics.portNamestringWebhook metrics service port name"http-metrics"
webhook.nodeSelectorobjectWebhook node selector{}
webhook.podDisruptionBudget.ennabledboolfalse
webhook.podDisruptionBudget.maxUnavailableintMaximum unavailable webhook pods1
webhook.podDisruptionBudget.minAvailableintMinimum available webhook pods1
webhook.profiling.enabledboolEnable pebhook profiling servicetrue
webhook.profiling.portintWebhook profiling service port8008
webhook.profiling.portNamestringWebhook profiling service port name"http-profiling"
webhook.replicasintWebhook replicas1
webhook.resourcesobjectWebhook resource limits and requests{}
webhook.securityContextobjectWebhook pods security context{}
webhook.service.annotationsobjectWebhook service annotations{}
webhook.service.typestringWebhook service type"ClusterIP"
webhook.tolerationslistWebhook tolerations[]
webhook.updateStrategyobjectWebhook pods update strategy{}

You can look directly at the values.yaml file to look at the options and their default values.

Try it out

This chart should deploy correctly with default values.

You will find examples below of how to customize the deployment of a release with various options. The list of examples is by no means exhaustive, it tries to cover the most used cases.

If you feel something is incomplete, missing or incorrect please open an issue and we'll do our best to improve this documentation.

Configure artifact bucket

Look at the Installing Tekton Pipelines doc for more informations about the content of this config map.

Create a yaml file called config-artifact-bucket.yaml looking like this (the name doesn't really matters):

location: s3://my-artifact-bucket
bucket.service.account.secret.name: my-secret
bucket.service.account.secret.key: boto-config
bucket.service.account.field.name: BOTO_CONFIG

Use the previously created file to pass the configuration to helm:

# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set-file config.artifactBucket=config-artifact-bucket.yaml
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set-file config.artifactBucket=config-artifact-bucket.yaml

Configure artifact pvc

Look at the Installing Tekton Pipelines doc for more informations about the content of this config map.

Create a yaml file called config-artifact-pvc.yaml looking like this (the name doesn't really matters):

size: 1Gi

Use the previously created file to pass the configuration to helm:

# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set-file config.artifactPvc=config-artifact-pvc.yaml
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set-file config.artifactPvc=config-artifact-pvc.yaml

Configure defaults

Look at the Installing Tekton Pipelines doc for more informations about the content of this config map.

Create a yaml file called config-artifact-defaults.yaml looking like this (the name doesn't really matters):

default-service-account: my-service-account
default-pod-template: |
  nodeSelector:
    kops.k8s.io/instancegroup: my-node-group

Use the previously created file to pass the configuration to helm:

# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set-file config.defaults=config-artifact-defaults.yaml
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set-file config.defaults=config-artifact-defaults.yaml

Other config maps

Same thing applies for other config maps.

Find below the list of supported config maps and their corresponding config key:

Config mapConfig keyOfficial documentation
artifact bucketconfig.artifactBucketInstalling Tekton Pipelines
artifact pvcconfig.artifactPvcInstalling Tekton Pipelines
defaultsconfig.defaultsInstalling Tekton Pipelines
feature flagsconfig.featureFlagsInstalling Tekton Pipelines
leader electionconfig.leaderElectionInstalling Tekton Pipelines
loggingconfig.loggingInstalling Tekton Pipelines
observabilityconfig.observabilityInstalling Tekton Pipelines

Please look in values.yaml to find the default values for each config map.

Configure pod resources

Controller and Webhook pod resources are configured independently.

Create a yaml file called pod-resources.yaml looking like this (the name doesn't really matters):

controller:
  resources:
    requests:
      cpu: 0.5
      memory: 128m
    limits:
      cpu: 1
      memory: 256m
webhook:
  resources:
    requests:
      cpu: 0.2
      memory: 100m
    limits:
      cpu: 0.5
      memory: 200m

Use the previously created file to pass the values to helm:

# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --values pod-resources.yaml
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --values pod-resources.yaml

Configure number of webhook replicas

Only Webhook pod replicas can be configured, the controller doesn't support more than 1 replica.

# This will install Tekton Pipelines in the tekton namespace (with a my-pipeline release name)

# Helm v2
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set webhook.replicas=3
# Helm v3
helm upgrade --install my-pipeline --namespace tekton eddycharly/pipelines --set webhook.replicas=3

Enable prometheus scraping

To let prometheus scrape the metrics endpoints, we need to set annotations on the controller and/or webhook services.

This can be done using the controller.service.annotations and webhook.service.annotations options.

Create a yaml file called `servi

Deploy pipelines with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pipelines on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpipelines is pinned at v0.12.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply