-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Manifest Factorization through .flux.yaml config files #1848
Conversation
df0cd55
to
977a866
Compare
977a866
to
f5b31c2
Compare
3fc3952
to
7f54431
Compare
c83d6de
to
15dad2f
Compare
5cf9625
to
db644b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting into more detailed stuff now. I don't think there are any show stoppers -- responses arguing that things are invalid, can be ignored, or can be deferred would suffice at this point.
My primary concern is that this will produce exactly the same results as before when --manifest-generation
is off, and I'm fairly well persuaded that will be the case. The rest is negotiable :-)
fd0e871
to
d11ea84
Compare
eeb9cf4
to
8d27f07
Compare
Post-merge checklist:
|
8d27f07
to
2258bf7
Compare
* Remove dependency on `git.Checkout` and rename `checkoutManager` to `fileResourceStore` * Inline configfilemanager and manifestfilemanager into the new `fileResourceStore`
PolicyTranslator exists because the `.flux.yaml` files give commands for updating annotations, rather than updating policies, following on from how KubeYAML was used. But the fact that policies appear as annotations in Kubernetes resources is really up to the code in cluster/kubernetes. This commit changes the format of `.flux.yaml` files so a command for updating _policies_ is supplied, rather than for annotations. All the translation of policies to annotations is then done in cluster/kubernetes. There still needs to be a little code to evaluate the qualified policy updates (i.e., tag_all) against a particular workload, but this can be done without reference to whether they end up as annotations.
Also, fix git file adding (the CommitAndPush check doesn't detect untracked files).
2258bf7
to
b55d0ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a substantial amount of work Fons. Well done on the thoughtful restructuring of the code, and pushing the PR through reviews, pre-releases, and other trials.
As a last smoke test, I tried the image built from this branch locally, both with the flux-example repo (and --manifest-generation=false
) and the repo flux-kustomize-demo (--manifest-generation=true
).
OK, let's merge this and let it soak in master ..
Thanks @squaremo !! |
Want to test this? Go to https://github.com/weaveworks/flux-kustomize-example and follow the instructions.
This feature (behind the flag --manifest-generation) is now available in our prereleases repo: https://hub.docker.com/r/weaveworks/flux-prerelease/tags
This PR implements Generators and Updaters as specified in Generalizing Manifest Factorization in Weave Flux.
It is meant as a Proof of Concept and will only be merged if/when there is positive feedback.One major wart is that Kubernetes doesn't offer Ephemeral containers yet. It's been in the works for quite a while ( kubernetes/kubernetes#59416 ) but until then there is no simple and (reasonably) secure way to run generators and releasers. For now, we will simply assume that the command executables must live in the flux container.
Manifests
:ResourceStore
)Fixes #943 #1261 #1811 (and #1420 to certain extend)