fleet.yaml
The fleet.yaml file adds options to a bundle. Any directory with a
fleet.yaml is automatically turned into bundle.
For more information on how to use the fleet.yaml to customize bundles see
Git Repository Contents.
The content of the fleet.yaml corresponds to the FleetYAML struct at
pkg/apis/fleet.cattle.io/v1alpha1/fleetyaml.go,
which contains the BundleSpec.
Reference
# The default namespace to be applied to resources. This field is not used to
# enforce or lock down the deployment to a specific namespace, but instead
# provide the default value of the namespace field if one is not specified in
# the manifests.
#
# Default: default
defaultNamespace: default
# All resources will be assigned to this namespace and if any cluster scoped
# resource exists the deployment will fail.
#
# Default: ""
namespace: default
namespaceLabels:
key: value
namespaceAnnotations:
key: value
labels:
key: value
kustomize:
dir: ./kustomize
helm:
chart: ./chart
repo: https://charts.rancher.io
version: 0.1.0
disableDependencyUpdate: false
values:
any-custom: value
variableName: global.fleet.clusterLabels.LABELNAME
templatedLabel: "${ .ClusterLabels.LABELNAME }-foo"
valueFromEnv:
"${ .ClusterLabels.ENV }": ${ .ClusterValues.someValue | upper | quote }
valuesFiles:
- values1.yaml
- values2.yaml
valuesFrom:
- configMapKeyRef:
name: configmap-values
namespace: default
key: values.yaml
- secretKeyRef:
name: secret-values
namespace: default
key: values.yaml
releaseName: my-release
takeOwnership: false
force: false
atomic: false
disablePreProcess: false
disableDNS: false
skipSchemaValidation: false
waitForJobs: true
paused: false
rolloutStrategy:
maxUnavailable: 15%
maxUnavailablePartitions: 20%
autoPartitionSize: 10%
partitions:
- name: canary
maxUnavailable: 10%
clusterSelector:
matchLabels:
env: prod
clusterGroup: agroup
clusterGroupSelector:
clusterSelector:
matchLabels:
env: prod
targetCustomizations:
- name: prod
namespace: newvalue
defaultNamespace: newdefaultvalue
kustomize: {}
helm: {}
yaml:
overlays:
- custom2
- custom3
clusterSelector:
matchLabels:
env: prod
clusterName: dev-cluster
clusterGroupSelector:
matchLabels:
region: us-east
clusterGroup: group1
doNotDeploy: false
correctDrift:
enabled: false
force: false
keepFailHistory: false
dependsOn:
- name: one-multi-cluster-hello-world
- selector:
matchLabels:
app: weak-monkey
ignore:
conditions:
- type: Active
status: "False"
overrideTargets:
- clusterSelector:
matchLabels:
env: dev
Helm Options
Main options
chart
This specifies a custom location for the Helm chart. This can refer to any go-getter URL or OCI registry based Helm
chart URL, e.g. oci://ghcr.io/fleetrepoci/guestbook.
|
Limitation: downloading Helm charts from git with custom CA bundles Git repositories can be downloaded via unauthenticated http. However, this does not work with custom CA bundles. See fleet#3646. |
How fleet-agent deploys the bundle
-
releaseName
-
takeOwnership
-
force
-
atomic
-
disablePreProcess
-
disableDNS
-
skipSchemaValidation
-
waitForJobs
Helm Chart Download Options
-
chart
-
repo
-
version
The reference to the chart can be either:
-
a local path in the cloned Git repository, specified by
chart. -
a go-getter URL, specified by
chart. -
a Helm repository, specified by
repoand optionallyversion. -
an OCI Helm repository, specified by
repoand optionallyversion.
Values
Values are processed in different stages of the lifecycle: Bundle Lifecycle
-
fleet.yaml
values:andvaluesFile:are added to the bundle’s values when it is created. -
helm values templating happens when the bundle is targeted at a cluster.
-
values from
valuesFromare read during install.
Templating
Most functions from the sprig templating library are available.
The template context has the following keys:
-
.ClusterValues -
.ClusterLabels -
.ClusterAnnotations -
.ClusterName -
.ClusterNamespace
${ get .ClusterLabels "management.cattle.io/cluster-display-name" }
foo-bar-${`${PWD}`}
foo-bar-${PWD}