Skip to content

Commit 06b03c4

Browse files
committed
Add workload identity user story
Signed-off-by: Stefan Prodan <[email protected]>
1 parent ab4692c commit 06b03c4

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

rfcs/000X-flux-bootstrap-oci/README.md

+37-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ and reconcile the cluster state from OCI artifacts stored in the same or a diffe
1818

1919
## Motivation
2020

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+
2125
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.
2429

2530
To decouple the clusters reconciliation from the Git repositories, Flux allows packaging and publishing
2631
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`,
7075
a Flux Kustomization object that reconciles the OCI artifact contents.
7176
6. Applies the image pull secret, OCIRepository and Flux Kustomization to the cluster.
7277

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+
7381
Artifacts pushed to the registry:
7482
- `<registry-url>/<flux-manifests>:<checksum>` (immutable artifact)
7583
- `<registry-url>/<flux-manifests>:<tag>` (tag pointing to the immutable artifact)
@@ -91,6 +99,9 @@ continues with the following steps:
9199
that reconciles the cluster OCI artifact contents.
92100
4. Applies the image pull secret, OCIRepository and Flux Kustomization to the cluster.
93101

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+
94105
Objects created by the command in the `flux-system` namespace:
95106
- `flux-system` Secret
96107
- `flux-system` OCIRepository
@@ -220,6 +231,28 @@ spec:
220231
221232
#### Story 2
222233
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+
223256
> As a platform operator I want to sync the cluster state with the fleet Git repository.
224257
225258
Push changes from the fleet Git repository to the container registry:
@@ -251,7 +284,7 @@ The Git repository structure would be similar to the
251284
`infrastructure.yaml` and `apps.yaml`, have the `.spec.sourceRef` set to
252285
`kind: OCIRepository` and `name: flux-system`.
253286

254-
#### Story 3
287+
#### Story 4
255288

256289
> As a platform operator I want to update the Flux controllers on my production cluster
257290
> from CI without access to the Kubernetes API.
@@ -286,7 +319,7 @@ flux tag artifact oci://ghcr.io/stefanprodan/flux-manifests:${checksum} \
286319

287320
This operation could be simplified by implementing a dedicated CLI command and/or GitHub Action.
288321

289-
#### Story 4
322+
#### Story 5
290323

291324
> As a platform operator I want to update the registry credentials on my clusters.
292325

0 commit comments

Comments
 (0)