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 struct at pkg/bundlereader/read.go, 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. Note, if the functions output changes with every
  51. # call, e.g. `uuidv4`, the bundle will get redeployed.
  52. # The template context has following keys.
  53. # `.ClusterValues` are retrieved from target cluster's `spec.templateValues`
  54. # `.ClusterLabels` and `.ClusterAnnotations` are the labels and annoations in the cluster resource.
  55. # `.ClusterName` as the fleet's cluster resource name.
  56. # `.ClusterNamespace` as the namespace in which the cluster resource exists.
  57. # Note: The fleet.yaml must be valid yaml. Templating uses ${ } as delims,
  58. # unlike helm which uses {{ }}.
  59. templatedLabel: "${ .ClusterLabels.LABELNAME }-foo"
  60. valueFromEnv:
  61. "${ .ClusterLabels.ENV }": ${ .ClusterValues.someValue | upper | quote }
  62. # Path to any values files that need to be passed to helm during install
  63. valuesFiles:
  64. - values1.yaml
  65. - values2.yaml
  66. # Allow to use values files from configmaps or secrets defined in the downstream clusters
  67. valuesFrom:
  68. - configMapKeyRef:
  69. name: configmap-values
  70. # default to namespace of bundle
  71. namespace: default
  72. key: values.yaml
  73. - secretKeyRef:
  74. name: secret-values
  75. namespace: default
  76. key: values.yaml
  77. # Override immutable resources. This could be dangerous.
  78. force: false
  79. # Set the Helm --atomic flag when upgrading
  80. atomic: false
  81. # Disable go template pre-processing on the fleet values
  82. disablePreProcess: false
  83. # if set and timeoutSeconds provided, will wait until all Jobs have been completed before marking the GitRepo as ready.
  84. # It will wait for as long as timeoutSeconds
  85. waitForJobs: true
  86. # A paused bundle will not update downstream clusters but instead mark the bundle
  87. # as OutOfSync. One can then manually confirm that a bundle should be deployed to
  88. # the downstream clusters.
  89. # Default: false
  90. paused: false
  91. rolloutStrategy:
  92. # A number or percentage of clusters that can be unavailable during an update
  93. # of a bundle. This follows the same basic approach as a deployment rollout
  94. # strategy. Once the number of clusters meets unavailable state update will be
  95. # paused. Default value is 100% which doesn't take effect on update.
  96. # default: 100%
  97. maxUnavailable: 15%
  98. # A number or percentage of cluster partitions that can be unavailable during
  99. # an update of a bundle.
  100. # default: 0
  101. maxUnavailablePartitions: 20%
  102. # A number of percentage of how to automatically partition clusters if not
  103. # specific partitioning strategy is configured.
  104. # default: 25%
  105. autoPartitionSize: 10%
  106. # A list of definitions of partitions. If any target clusters do not match
  107. # the configuration they are added to partitions at the end following the
  108. # autoPartitionSize.
  109. partitions:
  110. # A user friend name given to the partition used for Display (optional).
  111. # default: ""
  112. - name: canary
  113. # A number or percentage of clusters that can be unavailable in this
  114. # partition before this partition is treated as done.
  115. # default: 10%
  116. maxUnavailable: 10%
  117. # Selector matching cluster labels to include in this partition
  118. clusterSelector:
  119. matchLabels:
  120. env: prod
  121. # A cluster group name to include in this partition
  122. clusterGroup: agroup
  123. # Selector matching cluster group labels to include in this partition
  124. clusterGroupSelector:
  125. clusterSelector:
  126. matchLabels:
  127. env: prod
  128. # Target customization are used to determine how resources should be modified per target
  129. # Targets are evaluated in order and the first one to match a cluster is used for that cluster.
  130. targetCustomizations:
  131. # The name of target. If not specified a default name of the format "target000"
  132. # will be used. This value is mostly for display
  133. - name: prod
  134. # Custom namespace value overriding the value at the root
  135. namespace: newvalue
  136. # Custom defaultNamespace value overriding the value at the root
  137. defaultNamespace: newdefaultvalue
  138. # Custom kustomize options overriding the options at the root
  139. kustomize: {}
  140. # Custom Helm options override the options at the root
  141. helm: {}
  142. # If using raw YAML these are names that map to overlays/{name} that will be used
  143. # to replace or patch a resource. If you wish to customize the file ./subdir/resource.yaml
  144. # then a file ./overlays/myoverlay/subdir/resource.yaml will replace the base file.
  145. # A file named ./overlays/myoverlay/subdir/resource_patch.yaml will patch the base file.
  146. # A patch can in JSON Patch or JSON Merge format or a strategic merge patch for builtin
  147. # Kubernetes types. Refer to "Raw YAML Resource Customization" below for more information.
  148. yaml:
  149. overlays:
  150. - custom2
  151. - custom3
  152. # A selector used to match clusters. The structure is the standard
  153. # metav1.LabelSelector format. If clusterGroupSelector or clusterGroup is specified,
  154. # clusterSelector will be used only to further refine the selection after
  155. # clusterGroupSelector and clusterGroup is evaluated.
  156. clusterSelector:
  157. matchLabels:
  158. env: prod
  159. # A selector used to match a specific cluster by name.
  160. clusterName: dev-cluster
  161. # A selector used to match cluster groups.
  162. clusterGroupSelector:
  163. matchLabels:
  164. region: us-east
  165. # A specific clusterGroup by name that will be selected
  166. clusterGroup: group1
  167. # dependsOn allows you to configure dependencies to other bundles. The current bundle
  168. # will only be deployed, after all dependencies are deployed and in a Ready state.
  169. dependsOn:
  170. # Format: <GITREPO-NAME>-<BUNDLE_PATH> with all path separators replaced by "-"
  171. # Example: GitRepo name "one", Bundle path "/multi-cluster/hello-world" => "one-multi-cluster-hello-world"
  172. - name: one-multi-cluster-hello-world
  173. # Select bundles to depend on based on their label.
  174. - selector:
  175. matchLabels:
  176. app: weak-monkey
  177. # Ignore fields when monitoring a Bundle. This can be used when Fleet thinks some conditions in Custom Resources
  178. # makes the Bundle to be in an error state when it shouldn't.
  179. ignore:
  180. # Conditions to be ignored
  181. conditions:
  182. # In this example a condition will be ignored if it contains {"type": "Active", "status", "False"}
  183. - type: Active
  184. status: "False"