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 https://github.com/rancher/fleet/blob/master/pkg/bundlereader/read.go#L129-L135, which contains the BundleSpec.

Reference

fleet.yaml

  1. # The default namespace to be applied to resources. This field is not used to
  2. # enforce or lock down the deployment to a specific namespace, but instead
  3. # provide the default value of the namespace field if one is not specified
  4. # in the manifests.
  5. # Default: default
  6. defaultNamespace: default
  7. # All resources will be assigned to this namespace and if any cluster scoped
  8. # resource exists the deployment will fail.
  9. # Default: ""
  10. namespace: default
  11. # Optional map of labels, that are set at the bundle and can be used in a
  12. # dependsOn.selector
  13. labels:
  14. key: value
  15. kustomize:
  16. # Use a custom folder for kustomize resources. This folder must contain
  17. # a kustomization.yaml file.
  18. dir: ./kustomize
  19. helm:
  20. # Use a custom location for the Helm chart. This can refer to any go-getter URL or
  21. # OCI registry based helm chart URL e.g. "oci://ghcr.io/fleetrepoci/guestbook".
  22. # This allows one to download charts from most any location. Also know that
  23. # go-getter URL supports adding a digest to validate the download. If repo
  24. # is set below this field is the name of the chart to lookup
  25. chart: ./chart
  26. # A https URL to a Helm repo to download the chart from. It's typically easier
  27. # to just use `chart` field and refer to a tgz file. If repo is used the
  28. # value of `chart` will be used as the chart name to lookup in the Helm repository.
  29. repo: https://charts.rancher.io
  30. # A custom release name to deploy the chart as. If not specified a release name
  31. # will be generated by combining the invoking GitRepo.name + GitRepo.path.
  32. releaseName: my-release
  33. # Makes helm skip the check for its own annotations
  34. takeOwnership: false
  35. # The version of the chart or semver constraint of the chart to find. If a constraint
  36. # is specified it is evaluated each time git changes.
  37. # The version also determines which chart to download from OCI registries.
  38. version: 0.1.0
  39. # Any values that should be placed in the `values.yaml` and passed to helm during
  40. # install.
  41. values:
  42. any-custom: value
  43. # All labels on Rancher clusters are available using global.fleet.clusterLabels.LABELNAME
  44. # These can now be accessed directly as variables
  45. # The variable's value will be an empty string if the referenced cluster label does not
  46. # exist on the targeted cluster
  47. variableName: global.fleet.clusterLabels.LABELNAME
  48. # It is possible to specify the keys and values as go template strings for
  49. # advanced templating needs. Most of the functions from the sprig templating
  50. # library are available. However, the `uuidv4` function is not supported.
  51. # The template context has following keys.
  52. # `.ClusterValues` are retrieved from target cluster's `spec.templateValues`
  53. # `.ClusterLabels` and `.ClusterAnnotations` are the labels and annoations in the cluster resource.
  54. # `.ClusterName` as the fleet's cluster resource name.
  55. # `.ClusterNamespace` as the namespace in which the cluster resource exists.
  56. # Note: The fleet.yaml must be valid yaml. Templating uses ${ } as delims,
  57. # unlike helm which uses {{ }}.
  58. templatedLabel: "${ .ClusterLabels.LABELNAME }-foo"
  59. valueFromEnv:
  60. "${ .ClusterLabels.ENV }": ${ .ClusterValues.someValue | upper | quote }
  61. # Path to any values files that need to be passed to helm during install
  62. valuesFiles:
  63. - values1.yaml
  64. - values2.yaml
  65. # Allow to use values files from configmaps or secrets defined in the downstream clusters
  66. valuesFrom:
  67. - configMapKeyRef:
  68. name: configmap-values
  69. # default to namespace of bundle
  70. namespace: default
  71. key: values.yaml
  72. - secretKeyRef:
  73. name: secret-values
  74. namespace: default
  75. key: values.yaml
  76. # Override immutable resources. This could be dangerous.
  77. force: false
  78. # Set the Helm --atomic flag when upgrading
  79. atomic: false
  80. # Disable go template pre-processing on the fleet values
  81. disablePreProcess: false
  82. # if set and timeoutSeconds provided, will wait until all Jobs have been completed before marking the GitRepo as ready.
  83. # It will wait for as long as timeoutSeconds
  84. waitForJobs: true
  85. # A paused bundle will not update downstream clusters but instead mark the bundle
  86. # as OutOfSync. One can then manually confirm that a bundle should be deployed to
  87. # the downstream clusters.
  88. # Default: false
  89. paused: false
  90. rolloutStrategy:
  91. # A number or percentage of clusters that can be unavailable during an update
  92. # of a bundle. This follows the same basic approach as a deployment rollout
  93. # strategy. Once the number of clusters meets unavailable state update will be
  94. # paused. Default value is 100% which doesn't take effect on update.
  95. # default: 100%
  96. maxUnavailable: 15%
  97. # A number or percentage of cluster partitions that can be unavailable during
  98. # an update of a bundle.
  99. # default: 0
  100. maxUnavailablePartitions: 20%
  101. # A number of percentage of how to automatically partition clusters if not
  102. # specific partitioning strategy is configured.
  103. # default: 25%
  104. autoPartitionSize: 10%
  105. # A list of definitions of partitions. If any target clusters do not match
  106. # the configuration they are added to partitions at the end following the
  107. # autoPartitionSize.
  108. partitions:
  109. # A user friend name given to the partition used for Display (optional).
  110. # default: ""
  111. - name: canary
  112. # A number or percentage of clusters that can be unavailable in this
  113. # partition before this partition is treated as done.
  114. # default: 10%
  115. maxUnavailable: 10%
  116. # Selector matching cluster labels to include in this partition
  117. clusterSelector:
  118. matchLabels:
  119. env: prod
  120. # A cluster group name to include in this partition
  121. clusterGroup: agroup
  122. # Selector matching cluster group labels to include in this partition
  123. clusterGroupSelector:
  124. clusterSelector:
  125. matchLabels:
  126. env: prod
  127. # Target customization are used to determine how resources should be modified per target
  128. # Targets are evaluated in order and the first one to match a cluster is used for that cluster.
  129. targetCustomizations:
  130. # The name of target. If not specified a default name of the format "target000"
  131. # will be used. This value is mostly for display
  132. - name: prod
  133. # Custom namespace value overriding the value at the root
  134. namespace: newvalue
  135. # Custom defaultNamespace value overriding the value at the root
  136. defaultNamespace: newdefaultvalue
  137. # Custom kustomize options overriding the options at the root
  138. kustomize: {}
  139. # Custom Helm options override the options at the root
  140. helm: {}
  141. # If using raw YAML these are names that map to overlays/{name} that will be used
  142. # to replace or patch a resource. If you wish to customize the file ./subdir/resource.yaml
  143. # then a file ./overlays/myoverlay/subdir/resource.yaml will replace the base file.
  144. # A file named ./overlays/myoverlay/subdir/resource_patch.yaml will patch the base file.
  145. # A patch can in JSON Patch or JSON Merge format or a strategic merge patch for builtin
  146. # Kubernetes types. Refer to "Raw YAML Resource Customization" below for more information.
  147. yaml:
  148. overlays:
  149. - custom2
  150. - custom3
  151. # A selector used to match clusters. The structure is the standard
  152. # metav1.LabelSelector format. If clusterGroupSelector or clusterGroup is specified,
  153. # clusterSelector will be used only to further refine the selection after
  154. # clusterGroupSelector and clusterGroup is evaluated.
  155. clusterSelector:
  156. matchLabels:
  157. env: prod
  158. # A selector used to match a specific cluster by name.
  159. clusterName: dev-cluster
  160. # A selector used to match cluster groups.
  161. clusterGroupSelector:
  162. matchLabels:
  163. region: us-east
  164. # A specific clusterGroup by name that will be selected
  165. clusterGroup: group1
  166. # dependsOn allows you to configure dependencies to other bundles. The current bundle
  167. # will only be deployed, after all dependencies are deployed and in a Ready state.
  168. dependsOn:
  169. # Format: <GITREPO-NAME>-<BUNDLE_PATH> with all path separators replaced by "-"
  170. # Example: GitRepo name "one", Bundle path "/multi-cluster/hello-world" => "one-multi-cluster-hello-world"
  171. - name: one-multi-cluster-hello-world
  172. # Select bundles to depend on based on their label.
  173. - selector:
  174. matchLabels:
  175. app: weak-monkey