-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add app.kubernetes.io/instance label for flux logs #5
Conversation
Fixes #4 Signed-off-by: Kingdon Barrett <kingdon@weave.works>
Running through the build process by hand, I can see the labels aren't missing at the point that |
Stefan suggested we add the label in the location where we are already patching Flux deployments: Here's my understanding of how the release process works, (and why that will not work) there are some parts I didn't quite understand trying to pick it apart, but I think I have worked most of it out:
What is fairly clear is that the Deployment resources are not part of the bundle directory format, they are in the clusterserviceversion, so any labels we might have passed into ClusterServiceVersion evidently only supports adding labels for the purpose of indicating if support for multiple architectures are present: https://docs.openshift.com/container-platform/4.4/operators/operator_sdk/osdk-generating-csvs.html#olm-enabling-operator-for-multi-arch_osdk-generating-csvs Is that why you suggest we use an operator to install Flux, @chanwit ? Because it will give us control over the labels, and whatever else we need, (like target namespace?) I think that sounds over-complicated, the OLM does add some labels, are any of these labels suitable for use by flux cli? (Could we update
|
Maybe these annotations in the pod spec are more helpful:
(I just realized we are probably selecting pods, not deployments) |
We look for deployment labels https://github.com/fluxcd/flux2/blob/78f4dfa48d851ae51324af6adc6e150449c171a9/cmd/flux/logs.go#L137 |
As @stefanprodan pointed out, I think this patch is good enough. Thank you @kingdonb. |
@chanwit for this to work, the namespace where OLM deploys Flux must be |
My solution is to document that user must install it only to the |
When you run |
Just found that all Deployment got rewritten into this form: |
FFS... so OLM doesn't allow us to set metadata for our own deployments? |
I closed this PR as it does nothing, the label was already there, but it's removed by OLM. |
Labels could be specified there on each StrategyDeploymentSpec: I'll tweak the generator to do so. |
@chanwit great find, this will definitely solve our issues. |
#4not related, I have mixed myself up, #4 was not meant to be about the logs issue.(I do not quite know how to test this, but I have a feeling it's not going to work)