You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/bundle-resolver.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ This Resolver responds to type `bundles`.
19
19
|`bundle`| The bundle url pointing at the image to fetch |`gcr.io/tekton-releases/catalog/upstream/golang-build:0.1`|
20
20
|`name`| The name of the resource to pull out of the bundle |`golang-build`|
21
21
|`kind`| The resource kind to pull out of the bundle |`task`|
22
+
|`cache`| Controls caching behavior for the resolved resource |`always`, `never`, `auto`|
22
23
23
24
## Requirements
24
25
@@ -45,6 +46,44 @@ for the name, namespace and defaults that the resolver ships with.
45
46
|`backoff-cap`| The maxumum backoff duration. If reached, remaining steps are zeroed.|`10s`, `20s`|
46
47
|`default-kind`| The default layer kind in the bundle image. |`task`, `pipeline`|
47
48
49
+
### Caching Options
50
+
51
+
The bundle resolver supports caching of resolved resources to improve performance. The caching behavior can be configured using the `cache` option:
52
+
53
+
| Cache Value | Description |
54
+
|-------------|-------------|
55
+
|`always`| Always cache resolved resources. This is the most aggressive caching strategy and will cache all resolved resources regardless of their source. |
56
+
|`never`| Never cache resolved resources. This disables caching completely. |
57
+
|`auto`| Caching will only occur for bundles pulled by digest. (default) |
58
+
59
+
### Cache Configuration
60
+
61
+
The resolver cache can be configured globally using the `resolver-cache-config` ConfigMap. This ConfigMap controls the cache size and TTL (time-to-live) for all resolvers.
62
+
63
+
| Option Name | Description | Default Value | Example Values |
|`max-size`| Maximum number of entries in the cache |`1000`|`500`, `2000`|
66
+
|`ttl`| Time-to-live for cache entries |`5m`|`10m`, `1h`|
67
+
68
+
The ConfigMap name can be customized using the `RESOLVER_CACHE_CONFIG_MAP_NAME` environment variable. If not set, it defaults to `resolver-cache-config`.
69
+
70
+
Additionally, you can set a default cache mode for the bundle resolver by adding the `default-cache-mode` option to the `bundleresolver-config` ConfigMap. This overrides the system default (`auto`) for this resolver:
| (not specified) |**Default behavior**: Never cache (same as `auto` for cluster resolver). |
33
+
34
+
**Note**: The cluster resolver only caches when `cache: always` is explicitly specified. This is because cluster resources (Tasks, Pipelines, etc.) do not have immutable references like Git commit hashes or bundle digests, making automatic caching unreliable.
35
+
36
+
### Cache Configuration
37
+
38
+
The resolver cache can be configured globally using the `resolver-cache-config` ConfigMap. This ConfigMap controls the cache size and TTL (time-to-live) for all resolvers.
39
+
40
+
| Option Name | Description | Default Value | Example Values |
|`max-size`| Maximum number of entries in the cache |`1000`|`500`, `2000`|
43
+
|`ttl`| Time-to-live for cache entries |`5m`|`10m`, `1h`|
44
+
45
+
The ConfigMap name can be customized using the `RESOLVER_CACHE_CONFIG_MAP_NAME` environment variable. If not set, it defaults to `resolver-cache-config`.
46
+
47
+
Additionally, you can set a default cache mode for the cluster resolver by adding the `default-cache-mode` option to the `cluster-resolver-config` ConfigMap. This overrides the system default (`auto`) for this resolver:
Copy file name to clipboardExpand all lines: docs/git-resolver.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ This Resolver responds to type `git`.
26
26
|`pathInRepo`| Where to find the file in the repo. |`task/golang-build/0.3/golang-build.yaml`|
27
27
|`serverURL`| An optional server URL (that includes the https:// prefix) to connect for API operations |`https:/github.mycompany.com`|
28
28
|`scmType`| An optional SCM type to use for API operations |`github`, `gitlab`, `gitea`|
29
+
|`cache`| Controls caching behavior for the resolved resource |`always`, `never`, `auto`|
29
30
30
31
## Requirements
31
32
@@ -55,6 +56,44 @@ for the name, namespace and defaults that the resolver ships with.
55
56
|`api-token-secret-namespace`| The namespace containing the token secret, if not `default`. |`other-namespace`|
56
57
|`default-org`| The default organization to look for repositories under when using the authenticated API, if not specified in the resolver parameters. Optional. |`tektoncd`, `kubernetes`|
57
58
59
+
### Caching Options
60
+
61
+
The git resolver supports caching of resolved resources to improve performance. The caching behavior can be configured using the `cache` option:
62
+
63
+
| Cache Value | Description |
64
+
|-------------|-------------|
65
+
|`always`| Always cache resolved resources. This is the most aggressive caching strategy and will cache all resolved resources regardless of their source. |
66
+
|`never`| Never cache resolved resources. This disables caching completely. |
67
+
|`auto`| Caching will only occur when revision is a commit hash. (default) |
68
+
69
+
### Cache Configuration
70
+
71
+
The resolver cache can be configured globally using the `resolver-cache-config` ConfigMap. This ConfigMap controls the cache size and TTL (time-to-live) for all resolvers.
72
+
73
+
| Option Name | Description | Default Value | Example Values |
|`max-size`| Maximum number of entries in the cache |`1000`|`500`, `2000`|
76
+
|`ttl`| Time-to-live for cache entries |`5m`|`10m`, `1h`|
77
+
78
+
The ConfigMap name can be customized using the `RESOLVER_CACHE_CONFIG_MAP_NAME` environment variable. If not set, it defaults to `resolver-cache-config`.
79
+
80
+
Additionally, you can set a default cache mode for the git resolver by adding the `default-cache-mode` option to the `git-resolver-config` ConfigMap. This overrides the system default (`auto`) for this resolver:
For a table of the interfaces and methods a resolver must implement
35
35
along with those that are optional, see [resolver-reference.md](./resolver-reference.md).
36
36
37
+
## Resolver Cache Configuration
38
+
39
+
The resolver cache is used to improve performance by caching resolved resources for bundle and git resolver. By default, the cache uses:
40
+
- 5 minutes ("5m") as the time-to-live (TTL) for cache entries
41
+
- 1000 entries as the maximum cache size
42
+
43
+
You can override these defaults by editing the `resolver-cache-config.yaml` ConfigMap in the `tekton-pipelines-resolvers` namespace. Set the following keys:
44
+
-`max-size`: Set the maximum number of cache entries (e.g., "500")
45
+
-`default-ttl`: Set the default TTL for cache entries (e.g., "10m", "30s")
46
+
47
+
If these values are missing or invalid, the defaults will be used.
48
+
37
49
---
38
50
39
51
Except as otherwise noted, the content of this page is licensed under the
0 commit comments