GitRepo Resource

The GitRepo resource describes git repositories, how to access them and where the bundles are located.

The content of the resource corresponds to the GitRepoSpec. For more information on how to use GitRepo resource, e.g. how to watch private repositories, see Create a GitRepo Resource.

  1. kind: GitRepo
  2. apiVersion: fleet.cattle.io/v1alpha1
  3. metadata:
  4. # Any name can be used here
  5. name: my-repo
  6. # For single cluster use fleet-local, otherwise use the namespace of
  7. # your choosing
  8. namespace: fleet-local
  9. # Labels are copied to bundles, but not to workloads.
  10. labels:
  11. created-by: fleet
  12. spec:
  13. # This can be a HTTPS or git URL. If you are using a git URL then
  14. # clientSecretName will probably need to be set to supply a credential.
  15. # repo is the only required parameter for a repo to be monitored.
  16. #
  17. repo: https://github.com/rancher/fleet-examples
  18. # Enforce all resources go to this target namespace. If a cluster scoped
  19. # resource is found the deployment will fail.
  20. #
  21. # targetNamespace: app1
  22. # Any branch can be watched, this field is optional. If not specified the
  23. # branch is assumed to be master
  24. #
  25. # branch: master
  26. # A specific commit or tag can also be watched.
  27. #
  28. # revision: v0.3.0
  29. # For a private git repository you must supply a clientSecretName. A default
  30. # secret can be set at the namespace level using the GitRepoRestriction
  31. # type. Secrets must be of the type "kubernetes.io/ssh-auth" or
  32. # "kubernetes.io/basic-auth". The secret is assumed to be in the
  33. # same namespace as the GitRepo
  34. # If no clientSecretName is supplied, Fleet checks for a secret named
  35. # "gitcredential".
  36. #
  37. # clientSecretName: my-ssh-key
  38. # If fleet.yaml contains a private Helm repo that requires authentication,
  39. # provide the credentials in a K8s secret and specify them here.
  40. # Danger: the credentials will be sent to all repositories referenced from
  41. # this gitrepo. See section below for more information.
  42. #
  43. # helmSecretName: my-helm-secret
  44. # Helm credentials from helmSecretName will be used if the helm repository url matches this regular expression.
  45. # Credentials will always be used if it is empty or not provided
  46. #
  47. # helmRepoURLRegex: https://charts.rancher.io/*
  48. # Contains the auth secret for private Helm repository for each path.
  49. # See [Create a GitRepo Resource](.gitrepo-add#use-different-helm-credentials-for-each-path)
  50. #
  51. # helmSecretNameForPaths: multi-helm-secret
  52. # To add additional ca-bundle for self-signed certs, caBundle can be
  53. # filled with base64 encoded pem data. For example:
  54. # `cat /path/to/ca.pem | base64 -w 0`
  55. #
  56. # caBundle: my-ca-bundle
  57. # Disable SSL verification for git repo
  58. #
  59. # insecureSkipTLSVerify: true
  60. # A git repo can read multiple paths in a repo at once.
  61. # The below field is expected to be an array of paths and
  62. # supports path globbing (ex: some/*/path)
  63. #
  64. # Example:
  65. # paths:
  66. # - single-path
  67. # - multiple-paths/*
  68. paths:
  69. - simple
  70. # PollingInterval configures how often fleet checks the git repo. The default
  71. # is 15 seconds.
  72. # Setting this to zero does not disable polling. It results in a 15s
  73. # interval, too.
  74. # As checking a git repo incurs a CPU cost, raising this value can help
  75. # lowering fleetcontroller's CPU usage if tens of git repos are used or more
  76. #
  77. # pollingInterval: 15s
  78. # When disablePolling is set to true the git repo won't be checked periodically.
  79. # It will rely on webhooks only.
  80. # See [Using Webhooks Instead of Polling](https://fleet.rancher.io/webhook)
  81. # disablePolling: false
  82. # When using a webhook, a secret can be defined per GitRepo to validate the received payload.
  83. # webhookSecret is the name of the previously created secret for this purpose.
  84. # See [Using Webhooks Instead of Polling](https://fleet.rancher.io/webhook)
  85. # webhookSecret: webhook-secret-name
  86. # Paused causes changes in Git to not be propagated down to the clusters but
  87. # instead mark resources as OutOfSync
  88. #
  89. # paused: false
  90. # Increment this number to force a redeployment of contents from Git
  91. #
  92. # forceSyncGeneration: 0
  93. # Drift correction removes any external change made to resources managed by Fleet. It performs a helm rollback, which uses
  94. # a three-way merge strategy by default.
  95. # It will try to update all resources by doing a PUT request if force is enabled. Three-way strategic merge might fail when updating
  96. # an item inside of an array as it will try to add a new item instead of replacing the existing one. This can be fixed by using force.
  97. # Keep in mind that resources might be recreated if force is enabled.
  98. # Failed rollback will be removed from the helm history unless keepFailHistory is set to true.
  99. #
  100. # correctDrift:
  101. # enabled: false
  102. # force: false #Warning: it might recreate resources if set to true
  103. # keepFailHistory: false
  104. # The service account that will be used to perform this deployment.
  105. # This is the name of the service account that exists in the
  106. # downstream cluster in the cattle-fleet-system namespace. It is assumed
  107. # this service account already exists so it should be created beforehand,
  108. # for instance coming from another git repo registered with
  109. # the Fleet manager.
  110. # If no service account is configured, Fleet checks for a service account
  111. # named "fleet-default".
  112. #
  113. # serviceAccount: moreSecureAccountThanClusterAdmin
  114. # DeleteNamespace specifies if the namespace created
  115. # must be deleted after deleting the GitRepo.
  116. # deleteNamespace: false
  117. # bundles specifies the user-driven bundle definitions
  118. # With this way of defining Bundles, Fleet will simply load the specified resources
  119. # along with the options file (if defined), or it will attempt to find a
  120. # fleet.yaml file in the defined base.
  121. # See [How Repos are scanned](https://fleet.rancher.io/gitrepo-content#how-repos-are-scanned)
  122. # It is recommended to avoid using the following characters in the base and options paths: :,|?<>
  123. # You can use any of those (or even more than one), but not all of them at once.
  124. # bundles:
  125. # base: basedirectory/to/bundle/resources
  126. # options: path/to/fleet.yaml (optional)
  127. # base: basedirectory/to/bundle2
  128. # Target clusters to deploy to if running Fleet in a multi-cluster
  129. # style. Refer to the "Mapping to Downstream Clusters" docs for
  130. # more information.
  131. # If empty, the "default" cluster group is used.
  132. #
  133. # targets: ...