Rancher Fleet
Description
The Rancher Fleet crawler looks recursively for every fleet.yaml or fleet.yml bundle from a specific root directory, and tries to update the Helm chart version each one pins.
A bundle is picked up when both helm.chart and helm.repo are set:
defaultNamespace: cert-manager
helm:
chart: cert-manager
repo: https://charts.jetstack.io
version: 1.14.0This crawler is enabled by default, so it can be used either automatically by running updatecli diff from a directory containing the files to update, or by providing a manifest.
The automatic discovery behavior can be tuned by providing a YAML manifest with a rancher/fleet crawler in top-level directive autodiscovery as explained in the "Autodiscovery" page.
Generated manifests
Each bundle produces one manifest containing:
Only the version is rewritten; the rest of the bundle is left untouched.
Authentication
Use auths to reach private chart repositories. Entries are keyed by repository host and accept either a token or a username/password pair.
Version filtering
If unspecified, the version filter defaults to kind semver with pattern *, since Helm charts are expected to follow semantic versioning.
More details on the "Version Filtering" page.
Manifest
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| auths | object | “auths” defines the Helm repository credentials, keyed by repository host without scheme. remark:
example: | |
| token | string | ||
| ignore | array | “ignore” defines rules to exclude matching Helm charts from the autodiscovery. remark:
| |
| charts | object | “charts” defines the Helm charts to match, keyed by chart name. remark:
| |
| path | string | “path” defines a Fleet bundle file path pattern. remark:
| |
| repositories | array | “repositories” defines the Helm repository URLs to match. remark:
| |
| only | array | “only” defines rules to restrict the autodiscovery to matching Helm charts. remark:
| |
| charts | object | “charts” defines the Helm charts to match, keyed by chart name. remark:
| |
| path | string | “path” defines a Fleet bundle file path pattern. remark:
| |
| repositories | array | “repositories” defines the Helm repository URLs to match. remark:
| |
| rootdir | string | “rootdir” defines the directory where the crawler starts searching for Fleet bundle files. default: the scm directory when “scmid” is set, otherwise the directory relative paths resolve from, by default the working directory. remark:
| |
| versionfilter | object | “versionfilter” defines the version filter used by the generated manifests. default: kind “semver” with pattern “*”, the latest version. remark:
example: | |
| kind | string | “kind” defines the versioning scheme used to select a version. default: latest remark:
example:
| |
| pattern | string | “pattern” defines the version pattern, according to “kind”. default:
remark:
example:
| |
| regex | string | “regex” defines the regular expression extracting the version from each entry. remark:
example:
| |
| replaceall | object | “replaceall” applies a regular expression replacement to each version before filtering. remark:
example: turns “curl-8_15_0” into “curl-8.15.0”. | |
| pattern | string | “pattern” defines the regular expression matching the text to replace. example:
| |
| replacement | string | “replacement” defines the text replacing each match of “pattern”. remark:
example:
| |
| strict | boolean | “strict” enforces strict semantic versioning rules when parsing versions. default: false remark:
|
Note | only and ignore rules accept path (a bundle path pattern that must match the whole path), charts (a map of chart name to version), and repositories (a list of chart repository URLs). |
Example
# updatecli.d/default.yaml
name: "Fleet Autodiscovery using github scm"
scms:
fleet-lab:
kind: github
spec:
owner: olblak
repository: fleet-lab
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: main
actions:
fleet-lab:
kind: github/pullrequest
scmid: fleet-lab
spec:
labels:
- dependencies
autodiscovery:
# scmid is applied to all crawlers
scmid: fleet-lab
actionid: fleet-lab
crawlers:
rancher/fleet:
# To ignore specific path
#ignore:
# - path: <filepath relative to scm repository>
# To only update a specific file
#only:
# - path: <filepath relative to scm repository>