@@ -212,6 +212,88 @@ For password-protected SSH private keys, the password must be provided
212
212
via an additional `password` field in the secret. Flux CLI also supports
213
213
this via the `--password` flag.
214
214
215
+ # ## Provider
216
+
217
+ ` .spec.provider` is an optional field that allows specifying an OIDC provider
218
+ used for authentication purposes.
219
+
220
+ Supported options are :
221
+
222
+ - ` generic`
223
+ - ` azure`
224
+
225
+ When provider is not specified, it defaults to `generic` indicating that
226
+ mechanisms using `spec.secretRef` are used for authentication.
227
+
228
+ # ### Azure
229
+
230
+ The `azure` provider can be used to authenticate to Azure DevOps repositories
231
+ automatically using Workload Identity.
232
+
233
+ # #### Pre-requisites
234
+
235
+ - Ensure that your Azure DevOps Organization is
236
+ [connected](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/connect-organization-to-azure-ad?view=azure-devops)
237
+ to Microsoft Entra
238
+ - Ensure Workload Identity is properly [set up on your
239
+ cluster](https://learn.microsoft.com/en-us/azure/aks/workload-identity-deploy-cluster#create-an-aks-cluster)
240
+
241
+ # #### Configure Flux controller
242
+
243
+ - Create a managed identity to access Azure DevOps. Establish a federated
244
+ identity credential between the managed identity and the source-controller
245
+ service account. In the default installation, the source-controller service
246
+ account is located in the `flux-system` namespace with name
247
+ ` source-controller` . Ensure the federated credential uses the correct
248
+ namespace and name of the source-controller service account. For more details,
249
+ please refer to this
250
+ [guide](https://azure.github.io/azure-workload-identity/docs/quick-start.html#6-establish-federated-identity-credential-between-the-identity-and-the-service-account-issuer--subject)
251
+
252
+ - Add the managed identity to the Azure DevOps organization as a user. Ensure
253
+ that the managed identity has the necessary permissions to access the Azure
254
+ DevOps repository as described
255
+ [here](https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/service-principal-managed-identity?view=azure-devops#2-add-and-manage-service-principals-in-an-azure-devops-organization)
256
+
257
+ - Add the following patch in `flux-system/kustomization.yaml` file :
258
+
259
+
260
+ ` ` ` yaml
261
+ apiVersion: kustomize.config.k8s.io/v1beta1
262
+ kind: Kustomization
263
+ resources:
264
+ - gotk-components.yaml
265
+ - gotk-sync.yaml
266
+ patches:
267
+ - patch: |-
268
+ apiVersion: v1
269
+ kind: ServiceAccount
270
+ metadata:
271
+ name: source-controller
272
+ namespace: flux-system
273
+ annotations:
274
+ azure.workload.identity/client-id: <AZURE_CLIENT_ID>
275
+ labels:
276
+ azure.workload.identity/use: "true"
277
+ - patch: |-
278
+ apiVersion: apps/v1
279
+ kind: Deployment
280
+ metadata:
281
+ name: source-controller
282
+ namespace: flux-system
283
+ labels:
284
+ azure.workload.identity/use: "true"
285
+ spec:
286
+ template:
287
+ metadata:
288
+ labels:
289
+ azure.workload.identity/use: "true"
290
+ ` ` `
291
+
292
+ **Note:** When `provider` is used with `GitRepository`, the `.spec.url` must
293
+ follow this format :
294
+
295
+ > https://dev.azure.com/{your-organization}/{your-project}/_git/{your-repository}.
296
+
215
297
# ## Interval
216
298
217
299
` .spec.interval` is a required field that specifies the interval at which the
0 commit comments