|
| 1 | +# Cluster Resolver |
| 2 | + |
| 3 | +## Resolver Type |
| 4 | + |
| 5 | +This Resolver responds to type `cluster`. |
| 6 | + |
| 7 | +## Parameters |
| 8 | + |
| 9 | +| Param Name | Description | Example Value | |
| 10 | +|-------------|-------------------------------------------------------|------------------------------| |
| 11 | +| `kind` | The kind of resource to fetch. | `task`, `pipeline` | |
| 12 | +| `name` | The name of the resource to fetch. | `some-pipeline`, `some-task` | |
| 13 | +| `namespace` | The namespace in the cluster containing the resource. | `default`, `other-namespace` | |
| 14 | + |
| 15 | +## Requirements |
| 16 | + |
| 17 | +- A cluster running Tekton Pipeline v0.40.0 or later, with the `alpha` feature gate enabled. |
| 18 | +- The [built-in remote resolvers installed](./install.md#installing-and-configuring-remote-task-and-pipeline-resolution). |
| 19 | +- The `enable-cluster-resolver` feature flag set to `true`. |
| 20 | + |
| 21 | +## Configuration |
| 22 | + |
| 23 | +This resolver uses a `ConfigMap` for its settings. See |
| 24 | +[`../config/resolvers/cluster-resolver-config.yaml`](../config/resolvers/cluster-resolver-config.yaml) |
| 25 | +for the name, namespace and defaults that the resolver ships with. |
| 26 | + |
| 27 | +### Options |
| 28 | + |
| 29 | +| Option Name | Description | Example Values | |
| 30 | +|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------| |
| 31 | +| `default-kind` | The default resource kind to fetch if not specified in parameters. | `task`, `pipeline` | |
| 32 | +| `default-namespace` | The default namespace to fetch resources from if not specified in parameters. | `default`, `some-namespace` | |
| 33 | +| `allowed-namespaces` | An optional comma-separated list of namespaces which the resolver is allowed to access. Defaults to empty, meaning all namespaces are allowed. | `default,some-namespace`, (empty) | |
| 34 | +| `blocked-namespaces` | An optional comma-separated list of namespaces which the resolver is blocked from accessing. Defaults to empty, meaning all namespaces are allowed. | `default,other-namespace`, (empty) | |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +### Task Resolution |
| 39 | + |
| 40 | +```yaml |
| 41 | +apiVersion: tekton.dev/v1beta1 |
| 42 | +kind: TaskRun |
| 43 | +metadata: |
| 44 | + name: remote-task-reference |
| 45 | +spec: |
| 46 | + taskRef: |
| 47 | + resolver: cluster |
| 48 | + params: |
| 49 | + - name: kind |
| 50 | + value: task |
| 51 | + - name: name |
| 52 | + value: some-task |
| 53 | + - name: namespace |
| 54 | + value: namespace-containing-task |
| 55 | +``` |
| 56 | +
|
| 57 | +### Pipeline resolution |
| 58 | +
|
| 59 | +```yaml |
| 60 | +apiVersion: tekton.dev/v1beta1 |
| 61 | +kind: PipelineRun |
| 62 | +metadata: |
| 63 | + name: remote-pipeline-reference |
| 64 | +spec: |
| 65 | + pipelineRef: |
| 66 | + resolver: cluster |
| 67 | + params: |
| 68 | + - name: kind |
| 69 | + value: pipeline |
| 70 | + - name: name |
| 71 | + value: some-pipeline |
| 72 | + - name: namespace |
| 73 | + value: namespace-containing-pipeline |
| 74 | +``` |
| 75 | +
|
| 76 | +--- |
| 77 | +
|
| 78 | +Except as otherwise noted, the content of this page is licensed under the |
| 79 | +[Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), |
| 80 | +and code samples are licensed under the |
| 81 | +[Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). |
0 commit comments