Enable passing read only credentials for flux bootstrap secret creation #5380
-
ProblemCurrently, flux bootstrap requires read-write (RW) credentials to commit manifests to the repository, and these same credentials are stored in the cluster's Current WorkaroundsWhile it's possible to rotate the RW credential with 3rd party tools as I suggested in this comment, this requires post-bootstrap manipulation and doesn't follow the principle of least privilege from the start. Proposed SolutionAdd support for providing separate credentials during bootstrap:
The bootstrap process would use RW credentials to commit manifests but store the read-only credentials in the cluster's ImplementationI'd love to take on implementing this feature. My understanding is this would require updates to:
Proposed CLI Interface# Example with separate credentials
flux bootstrap github \
--owner=myorg \
--repository=fleet-infra \
--bootstrap-token=$GITHUB_TOKEN_RW \
--runtime-token=$GITHUB_TOKEN_RO \
--path=clusters/production
# Or with SSH
flux bootstrap git \
--url=ssh://[email protected]/myorg/fleet-infra \
--private-key-file=bootstrap-key.pem \
--runtime-private-key-file=readonly-key.pem \
--path=clusters/production
# Open to suggestions, I suck at naming 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
|
You can do this today with the CLI using 2 commands:
The bootstrap command will not override the The same procedure works with the Flux Terraform provider, you can create the Kubernetes Secret with the read-only PAT before running the bootstrap module.
Flux image automation needs write access to the repo and so for the majority of users having a read-only key will not suffice. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the reply @stefanprodan.
The end goal is to update this provider which makes use of the bootstrap package.
The idea is for this to be an optional flag, that would not impact existing functionality. |
Beta Was this translation helpful? Give feedback.
So set
lifecycle ignore_changesin terraform for the secret.