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