|
2 | 2 |
|
3 | 3 | {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} |
4 | 4 |
|
| 5 | +Helm chart for deploying [Codefresh Runner](https://codefresh.io/docs/docs/installation/codefresh-runner/) to Kubernetes. |
| 6 | + |
| 7 | +## Table of Content |
| 8 | + |
| 9 | +- [Prerequisites](#prerequisites) |
| 10 | +- [Get Repo Info](#get-repo-info) |
| 11 | +- [Install Chart](#install-chart) |
| 12 | +- [Upgrade Chart](#upgrade-chart) |
| 13 | + - [To 2.x](#to-2x) |
| 14 | + - [To 3.x](#to-3x) |
| 15 | +- [Architecture](#architecture) |
| 16 | +- [Configuration](#configuration) |
| 17 | + - [EBS backend volume configuration](#ebs-backend-volume-configuration) |
| 18 | + - [Custom volume mounts](#custom-volume-mounts) |
| 19 | + - [Custom global environment variables](#custom-global-environment-variables) |
| 20 | + - [Volume reuse policy](#volume-reuse-policy) |
| 21 | + |
5 | 22 | ## Prerequisites |
6 | 23 |
|
7 | 24 | - Kubernetes **1.19+** |
@@ -34,11 +51,53 @@ helm repo update |
34 | 51 |
|
35 | 52 | helm upgrade --install cf-runtime cf-runtime/cf-runtime -f ./generated_values.yaml --create-namespace --namespace codefresh |
36 | 53 | ``` |
| 54 | + |
| 55 | + *Install from OCI-based registry* |
| 56 | + ```console |
| 57 | + helm upgrade --install cf-runtime oci://quay.io/codefresh/cf-runtime -f ./generated_values.yaml --create-namespace --namespace codefresh |
| 58 | + ``` |
37 | 59 | 4. At this point you should have a working Codefresh Runner. You can verify the installation by running: |
38 | 60 | ```console |
39 | 61 | codefresh runner execute-test-pipeline --runtime-name <runtime-name> |
40 | 62 | ``` |
41 | 63 |
|
| 64 | +## Upgrade chart |
| 65 | + |
| 66 | +### To 2.x |
| 67 | + |
| 68 | +This major release renames and deprecated several values in the chart. Most of the workload templates have been refactored. |
| 69 | + |
| 70 | +Affected values: |
| 71 | +- `dockerRegistry` is deprecated. Replaced with `global.imageRegistry` |
| 72 | +- `re` is renamed to `runtime` |
| 73 | +- `storage.localVolumeMonitor` is replaced with `volumeProvisioner.dind-lv-monitor` |
| 74 | +- `volumeProvisioner.volume-cleanup` is replaced with `volumeProvisioner.dind-volume-cleanup` |
| 75 | +- `image` values structure has been updated. Split to `image.registry` `image.repository` `image.tag` |
| 76 | +- pod's `annotations` is renamed to `podAnnotations` |
| 77 | + |
| 78 | +### To 3.x |
| 79 | + |
| 80 | +⚠️⚠️⚠️ |
| 81 | +### Please, READ this before the upgrade! |
| 82 | + |
| 83 | +This major release adds [runtime-environment](https://codefresh.io/docs/docs/installation/codefresh-runner/#runtime-environment-specification) spec into chart templates. |
| 84 | +That means it is possible to set parametes for `dind` and `engine` pods via [values.yaml](./values.yaml). |
| 85 | + |
| 86 | +**If you had any overrides (i.e. tolerations/nodeSelector/environment variables/etc) added in runtime spec via [codefresh CLI](https://codefresh-io.github.io/cli/) (for example, you did use [get](https://codefresh-io.github.io/cli/runtime-environments/get-runtime-environments/) and [patch](https://codefresh-io.github.io/cli/runtime-environments/apply-runtime-environments/) commands to modify the runtime-environment), you MUST add these into chart's [values.yaml](./values.yaml) for `.Values.runtime.dind` or(and) .`Values.runtime.engine`** |
| 87 | + |
| 88 | +**For backward compatibility, you can disable updating runtime-environment spec via** `.Values.runtime.patch.enabled=false` |
| 89 | + |
| 90 | +Affected values: |
| 91 | +- added **mandatory** `global.codefresh.codefreshToken`/`global.codefresh.codefreshTokenSecretKeyRef` **You must specify it before the upgrade!** |
| 92 | +- `runtime.engine` is added |
| 93 | +- `runtime.dind` is added |
| 94 | +- `global.existingAgentToken` is replaced with `global.agentTokenSecretKeyRef` |
| 95 | +- `global.existingDindCertsSecret` is replaced with `global.dindCertsSecretRef` |
| 96 | + |
| 97 | +## Architecture |
| 98 | + |
| 99 | +[Codefresh Runner architecture](https://codefresh.io/docs/docs/installation/codefresh-runner/#codefresh-runner-architecture) |
| 100 | + |
42 | 101 | ## Configuration |
43 | 102 |
|
44 | 103 | See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands: |
@@ -148,21 +207,76 @@ volumeProvisioner: |
148 | 207 | eks.amazonaws.com/role-arn: "arn:aws:iam::<ACCOUNT_ID>:role/<IAM_ROLE_NAME>" |
149 | 208 | ``` |
150 | 209 |
|
151 | | -{{ template "chart.requirementsSection" . }} |
| 210 | +### Custom volume mounts |
152 | 211 |
|
153 | | -## Upgrading |
| 212 | +You can add your own volumes and volume mounts in the runtime environment, so that all pipeline steps will have access to the same set of external files. |
154 | 213 |
|
155 | | -### To 2.0.0 |
| 214 | +```yaml |
| 215 | +runtime: |
| 216 | + dind: |
| 217 | + userVolumes: |
| 218 | + regctl-docker-registry: |
| 219 | + name: regctl-docker-registry |
| 220 | + secret: |
| 221 | + items: |
| 222 | + - key: .dockerconfigjson |
| 223 | + path: config.json |
| 224 | + secretName: regctl-docker-registry |
| 225 | + optional: true |
| 226 | + userVolumeMounts: |
| 227 | + regctl-docker-registry: |
| 228 | + name: regctl-docker-registry |
| 229 | + mountPath: /home/appuser/.docker/ |
| 230 | + readOnly: true |
156 | 231 |
|
157 | | -This major release renames and deprecated several values in the chart. Most of the workload templates have been refactored. |
| 232 | +``` |
158 | 233 |
|
159 | | -Affected values: |
160 | | -- `dockerRegistry` is deprecated. Replaced with `global.imageRegistry` |
161 | | -- `re` is renamed to `runtime` |
162 | | -- `storage.localVolumeMonitor` is replaced with `volumeProvisioner.dind-lv-monitor` |
163 | | -- `volumeProvisioner.volume-cleanup` is replaced with `volumeProvisioner.dind-volume-cleanup` |
164 | | -- `image` values structure has been updated. Split to `image.registry` `image.repository` `image.tag` |
165 | | -- pod's `annotations` is renamed to `podAnnotations` |
| 234 | +### Custom global environment variables |
| 235 | + |
| 236 | +You can add your own environment variables to the runtime environment. All pipeline steps have access to the global variables. |
| 237 | + |
| 238 | +```yaml |
| 239 | +runtime: |
| 240 | + engine: |
| 241 | + userEnvVars: |
| 242 | + - name: GITHUB_TOKEN |
| 243 | + valueFrom: |
| 244 | + secretKeyRef: |
| 245 | + name: github-token |
| 246 | + key: token |
| 247 | +``` |
| 248 | + |
| 249 | +### Volume reuse policy |
| 250 | + |
| 251 | +Volume reuse behavior depends on the configuration for `reuseVolumeSelector` in the runtime environment spec. |
| 252 | + |
| 253 | +```yaml |
| 254 | +runtime: |
| 255 | + dind: |
| 256 | + pvcs: |
| 257 | + - name: dind |
| 258 | + ... |
| 259 | + reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName' |
| 260 | + reuseVolumeSortOrder: pipeline_id |
| 261 | +``` |
| 262 | + |
| 263 | +The following options are available: |
| 264 | +- `reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName'` - PV can be used by ANY pipeline in the specified account (default). |
| 265 | +Benefit: Fewer PVs, resulting in lower costs. Since any PV can be used by any pipeline, the cluster needs to maintain/reserve fewer PVs in its PV pool for Codefresh. |
| 266 | +Downside: Since the PV can be used by any pipeline, the PVs could have assets and info from different pipelines, reducing the probability of cache. |
| 267 | + |
| 268 | +- `reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName,project_id'` - PV can be used by ALL pipelines in your account, assigned to the same project. |
| 269 | + |
| 270 | +- `reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName,pipeline_id'` - PV can be used only by a single pipeline. |
| 271 | +Benefit: More probability of cache without “spam” from other pipelines. |
| 272 | +Downside: More PVs to maintain and therefore higher costs. |
| 273 | + |
| 274 | +- `reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName,pipeline_id,io.codefresh.branch_name'` - PV can be used only by single pipeline AND single branch. |
| 275 | + |
| 276 | +- `reuseVolumeSelector: 'codefresh-app,io.codefresh.accountName,pipeline_id,trigger'` - PV can be used only by single pipeline AND single trigger. |
| 277 | + |
| 278 | + |
| 279 | +{{ template "chart.requirementsSection" . }} |
166 | 280 |
|
167 | 281 | {{ template "chart.valuesSection" . }} |
168 | 282 |
|
0 commit comments