pipelines
by eddycharly
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
| Key | Type | Description | Default |
|---|---|---|---|
config.artifactBucket | object | Configuration for artifact bucket (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md) | See values.yaml |
config.artifactPvc | object | Configuration for artifact pvc (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md) | See values.yaml |
config.defaults | object | Configuration for default values (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md) | See values.yaml |
config.featureFlags | object | Configuration for feature flags | See values.yaml |
config.leaderElection | object | Configuration for leader election | See values.yaml |
config.logging | object | Configuration for logging (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md) | See values.yaml |
config.observability | object | Configuration for observability (see https://github.com/tektoncd/pipeline/blob/master/docs/install.md) | See values.yaml |
controller.affinity | object | Controller affinity rules | {} |
controller.annotations | object | Controller pod annotations | See values.yaml |
controller.args | list | Controller arguments | See values.yaml |
controller.image.pullPolicy | string | Controller docker image pull policy | "IfNotPresent" |
controller.image.repository | string | Controller docker image repository | "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/controller" |
controller.image.tag | string | Controller docker image tag | nil |
controller.metrics.enabled | bool | Enable controller metrics service | true |
controller.metrics.port | int | Controller metrics service port | 9090 |
controller.metrics.portName | string | "metrics" | |
controller.nodeSelector | object | Controller node selector | {} |
controller.resources | object | Controller resource limits and requests | {} |
controller.securityContext | object | Controller pods security context | {} |
controller.service.annotations | object | Controller service annotations | {} |
controller.service.type | string | Controller service type | "ClusterIP" |
controller.tolerations | list | Controller tolerations | [] |
fullnameOverride | string | Fully override resource generated names | "" |
nameOverride | string | Partially override resource generated names | "" |
podSecurityPolicy.enabled | bool | Enable pod security policy | false |
rbac.controllerServiceAccount | string | Name of the service account to use for controller when rbac.create is false | nil |
rbac.create | bool | Create RBAC resources | true |
rbac.webhookServiceAccount | string | Name of the service account to use for webhook when rbac.create is false | nil |
version | string | Tekton pipelines version used to add labels on deployments, pods and services | nil |
webhook.affinity | object | Webhook affinity rules | {} |
webhook.annotations | object | Webhook pod annotations | See values.yaml |
webhook.image.pullPolicy | string | Webhook docker image pull policy | "IfNotPresent" |
webhook.image.repository | string | Webhook docker image repository | "gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/webhook" |
webhook.image.tag | string | Webhook docker image tag | nil |
webhook.metrics.enabled | bool | Enable webhook metrics service | true |
webhook.metrics.port | int | Webhook metrics service port | 9090 |
webhook.metrics.portName | string | Webhook metrics service port name | "http-metrics" |
webhook.nodeSelector | object | Webhook node selector | {} |
webhook.podDisruptionBudget.ennabled | bool | false | |
webhook.podDisruptionBudget.maxUnavailable | int | Maximum unavailable webhook pods | 1 |
webhook.podDisruptionBudget.minAvailable | int | Minimum available webhook pods | 1 |
webhook.profiling.enabled | bool | Enable pebhook profiling service | true |
webhook.profiling.port | int | Webhook profiling service port | 8008 |
webhook.profiling.portName | string | Webhook profiling service port name | "http-profiling" |
webhook.replicas | int | Webhook replicas | 1 |
webhook.resources | object | Webhook resource limits and requests | {} |
webhook.securityContext | object | Webhook pods security context | {} |
webhook.service.annotations | object | Webhook service annotations | {} |
webhook.service.type | string | Webhook service type | "ClusterIP" |
webhook.tolerations | list | Webhook tolerations | [] |
webhook.updateStrategy | object | Webhook 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 map | Config key | Official documentation |
|---|---|---|
| artifact bucket | config.artifactBucket | Installing Tekton Pipelines |
| artifact pvc | config.artifactPvc | Installing Tekton Pipelines |
| defaults | config.defaults | Installing Tekton Pipelines |
| feature flags | config.featureFlags | Installing Tekton Pipelines |
| leader election | config.leaderElection | Installing Tekton Pipelines |
| logging | config.logging | Installing Tekton Pipelines |
| observability | config.observability | Installing 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpipelines is pinned at v0.12.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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