@@ -18,9 +18,14 @@ and reconcile the cluster state from OCI artifacts stored in the same or a diffe
18
18
19
19
## Motivation
20
20
21
+ After the implementation of [ RFC-0003] ( ../0003-kubernetes-oci/README.md ) in 2022 and the introduction
22
+ of the ` OCIRepository ` source, we had a recurring ask from users about improving the UX of running
23
+ Flux fully decoupled from Git.
24
+
21
25
Given that OCI registries are evolving into a generic artifact storage solution,
22
- we should allow Flux users who don't want to run a Git server as part of their
23
- production infrastructure to bootstrap and manage their Kubernetes clusters using OCI artifacts.
26
+ we should assist Flux users who don't want to depend on a Git (for any reason,
27
+ including auth and SSH key management) in their production infrastructure to
28
+ bootstrap and manage their Kubernetes clusters using OCI artifacts.
24
29
25
30
To decouple the clusters reconciliation from the Git repositories, Flux allows packaging and publishing
26
31
the Kubernetes manifests stored in Git to an OCI registry by running the ` flux push artifact `
@@ -70,6 +75,9 @@ The command performs the following steps based on the `url`, `username`,
70
75
a Flux Kustomization object that reconciles the OCI artifact contents.
71
76
6 . Applies the image pull secret, OCIRepository and Flux Kustomization to the cluster.
72
77
78
+ Note that the creation of the image pull secret is skipped when
79
+ [ Kubernetes Workload Identity] ( #story-2 ) is used for authentication to the container registry.
80
+
73
81
Artifacts pushed to the registry:
74
82
- ` <registry-url>/<flux-manifests>:<checksum> ` (immutable artifact)
75
83
- ` <registry-url>/<flux-manifests>:<tag> ` (tag pointing to the immutable artifact)
@@ -91,6 +99,9 @@ continues with the following steps:
91
99
that reconciles the cluster OCI artifact contents.
92
100
4 . Applies the image pull secret, OCIRepository and Flux Kustomization to the cluster.
93
101
102
+ Note that the creation of the image pull secret is skipped when
103
+ [ Kubernetes Workload Identity] ( #story-2 ) is used for authentication to the container registry.
104
+
94
105
Objects created by the command in the ` flux-system ` namespace:
95
106
- ` flux-system ` Secret
96
107
- ` flux-system ` OCIRepository
@@ -220,6 +231,28 @@ spec:
220
231
221
232
#### Story 2
222
233
234
+ > As a platform operator I want to bootstrap an EKS cluster with Flux
235
+ > using OCI artifacts stored in ECR.
236
+
237
+ The following example demonstrates how to bootstrap a Flux instance using ECR using IAM auth.
238
+ Assuming the EKS nodes have read-only access to ECR and the bastion host where
239
+ the Flux CLI is running has read and write access to ECR:
240
+
241
+ ` ` ` shell
242
+ flux bootstrap oci \
243
+ --provider=aws \
244
+ --url=oci://aws_account_id.dkr.ecr.us-west-2.amazonaws.com/flux-manifests:production \
245
+ --kustomization=flux-manifests/kustomization.yaml \
246
+ --cluster-url=oci://aws_account_id.dkr.ecr.us-west-2.amazonaws.com/fleet-manifests:production \
247
+ --cluster-path=clusters/production
248
+ ```
249
+
250
+ Note that when using Kubernetes Workload Identity instead of the worker node IAM role,
251
+ the ` kustomization.yaml ` must contain patches for the source-controller Service Account
252
+ as described [ here] ( https://fluxcd.io/flux/installation/configuration/workload-identity/ ) .
253
+
254
+ #### Story 3
255
+
223
256
> As a platform operator I want to sync the cluster state with the fleet Git repository.
224
257
225
258
Push changes from the fleet Git repository to the container registry:
@@ -251,7 +284,7 @@ The Git repository structure would be similar to the
251
284
` infrastructure.yaml ` and ` apps.yaml ` , have the ` .spec.sourceRef ` set to
252
285
` kind: OCIRepository ` and ` name: flux-system ` .
253
286
254
- #### Story 3
287
+ #### Story 4
255
288
256
289
> As a platform operator I want to update the Flux controllers on my production cluster
257
290
> from CI without access to the Kubernetes API.
@@ -286,7 +319,7 @@ flux tag artifact oci://ghcr.io/stefanprodan/flux-manifests:${checksum} \
286
319
287
320
This operation could be simplified by implementing a dedicated CLI command and/or GitHub Action.
288
321
289
- #### Story 4
322
+ #### Story 5
290
323
291
324
> As a platform operator I want to update the registry credentials on my clusters.
292
325
0 commit comments