open-feature / open-feature-operator

A Kubernetes feature flag operator
https://openfeature.dev
Apache License 2.0
164 stars 33 forks source link

Added Support for custom labels and annotations in pods created by chart #682

Open SargamPuram opened 2 weeks ago

SargamPuram commented 2 weeks ago

This PR

This PR introduces support for custom labels and annotations for Kubernetes resources controllerManager and kubeRbacProxy to enhance organization and metadata management within the cluster.

Related Issues

Fixes #677

Notes

Follow-up Tasks

How to test

toddbaert commented 1 week ago

Hey @SargamPuram ! @cpitstick-latai started work on this as well. Check it here. What he has done fixes the errors in your build. The problem is that kustomize/helm don't play nice together, so we have to have a hacky script to do some pre-processing. His implementation adds the labels and annotations to the helm-installed pods, like you did here, but not the runtime injected ones.

If you'd still like to help with this issue, I'd recommend that you base of https://github.com/open-feature/open-feature-operator/pull/681, and add the annotations/labels at runtime (in Go code). You can see something similar here that I did for image pull secrets: https://github.com/open-feature/open-feature-operator/pull/655 (you can see in that PR I added an additional arg to the go application/container which adds the imagePullSecrets to the injected deployment template...you'd have to do something similar for pods/labels). Perhaps you can create a PR to @cpitstick-latai 's branch? Or you could base on his changes in a new PR (I don't think he will mind).

SargamPuram commented 5 days ago

Hey @SargamPuram ! @cpitstick-latai started work on this as well. Check it here. What he has done fixes the errors in your build. The problem is that kustomize/helm don't play nice together, so we have to have a hacky script to do some pre-processing. His implementation adds the labels and annotations to the helm-installed pods, like you did here, but not the runtime injected ones.

If you'd still like to help with this issue, I'd recommend that you base of #681, and add the annotations/labels at runtime (in Go code). You can see something similar here that I did for image pull secrets: #655 (you can see in that PR I added an additional arg to the go application/container which adds the imagePullSecrets to the injected deployment template...you'd have to do something similar for pods/labels). Perhaps you can create a PR to @cpitstick-latai 's branch? Or you could base on his changes in a new PR (I don't think he will mind).

Hey @SargamPuram ! @cpitstick-latai started work on this as well. Check it here. What he has done fixes the errors in your build. The problem is that kustomize/helm don't play nice together, so we have to have a hacky script to do some pre-processing. His implementation adds the labels and annotations to the helm-installed pods, like you did here, but not the runtime injected ones.

If you'd still like to help with this issue, I'd recommend that you base of #681, and add the annotations/labels at runtime (in Go code). You can see something similar here that I did for image pull secrets: #655 (you can see in that PR I added an additional arg to the go application/container which adds the imagePullSecrets to the injected deployment template...you'd have to do something similar for pods/labels). Perhaps you can create a PR to @cpitstick-latai 's branch? Or you could base on his changes in a new PR (I don't think he will mind).

Hey @toddbaert ,

Thanks for the update! I checked out your work and it looks great. I understand the challenges with kustomize and helm, and the need for a pre-processing script makes sense.

I’ll base my work off #681 and add the annotations/labels at runtime in the Go code, similar to what you did in #655 for image pull secrets. I’ll create a PR to your branch to include these changes. Thanks!

toddbaert commented 2 days ago

Hey @SargamPuram ! @cpitstick-latai started work on this as well. Check it here. What he has done fixes the errors in your build. The problem is that kustomize/helm don't play nice together, so we have to have a hacky script to do some pre-processing. His implementation adds the labels and annotations to the helm-installed pods, like you did here, but not the runtime injected ones. If you'd still like to help with this issue, I'd recommend that you base of #681, and add the annotations/labels at runtime (in Go code). You can see something similar here that I did for image pull secrets: #655 (you can see in that PR I added an additional arg to the go application/container which adds the imagePullSecrets to the injected deployment template...you'd have to do something similar for pods/labels). Perhaps you can create a PR to @cpitstick-latai 's branch? Or you could base on his changes in a new PR (I don't think he will mind).

Hey @SargamPuram ! @cpitstick-latai started work on this as well. Check it here. What he has done fixes the errors in your build. The problem is that kustomize/helm don't play nice together, so we have to have a hacky script to do some pre-processing. His implementation adds the labels and annotations to the helm-installed pods, like you did here, but not the runtime injected ones. If you'd still like to help with this issue, I'd recommend that you base of #681, and add the annotations/labels at runtime (in Go code). You can see something similar here that I did for image pull secrets: #655 (you can see in that PR I added an additional arg to the go application/container which adds the imagePullSecrets to the injected deployment template...you'd have to do something similar for pods/labels). Perhaps you can create a PR to @cpitstick-latai 's branch? Or you could base on his changes in a new PR (I don't think he will mind).

Hey @toddbaert ,

Thanks for the update! I checked out your work and it looks great. I understand the challenges with kustomize and helm, and the need for a pre-processing script makes sense.

I’ll base my work off #681 and add the annotations/labels at runtime in the Go code, similar to what you did in #655 for image pull secrets. I’ll create a PR to your branch to include these changes. Thanks!

Thanks so much @SargamPuram !

FYI @cpitstick-latai