googleforgames / open-match

Flexible, extensible, and scalable video game matchmaking.
http://open-match.dev
Apache License 2.0
3.17k stars 335 forks source link

Add pod annotations to Helm templates for injecting user-specified pod annotations. #1588

Open oniku-2929 opened 1 year ago

oniku-2929 commented 1 year ago

Is your feature request related to a problem? Please describe. Some Service Mesh OSS products require pod annotations for controlling their functions. e.g. Istio:https://istio.io/latest/docs/reference/config/annotations/ Consul:https://developer.hashicorp.com/consul/docs/k8s/annotations-and-labels

It would be helpful if we can inject our specified pod annotations during the chart installation process.

Describe the solution you'd like Add podAnnotations to Helm templates for injecting user-specified pod annotations.

e.g.

# use --set 
helm install open-match --create-namespace --namespace open-match open-match/open-match \
  --set open-match-customize.enabled=true \
  --set open-match-customize.evaluator.enabled=true \
  --set open-match-override.enabled=true \
  --set query.podAnnotations.test\\.sh/component=query

or

#values.yaml
query:
  podAnnotations:
    test.sh/component: query

# use values.yaml
helm install open-match --create-namespace --namespace open-match open-match/open-match -f values.yaml \
  --set open-match-customize.enabled=true \
  --set open-match-customize.evaluator.enabled=true \
  --set open-match-override.enabled=true

=> pod "open-match-query-***" has an annotation "test.sh/component=query"

Describe alternatives you've considered The user can use "kubectl annotate" to annotate the pod after the chart installation process. But, It's more declarative.

Additional context Nothing.

ashutosji commented 1 year ago

Hey @oniku-2929, Thanks for filling the PR. Once, PR 1587 will merge then I will try to rebuild this PR. Meanwhile, if you could let use know did you try user-specified pod annotations? Is it working as expected?

oniku-2929 commented 1 year ago

Hi, @ashutosji Thank you for your reply.

Once, PR #1587 will merge then I will try to rebuild this PR.

I got it.

if you could let use know did you try user-specified pod annotations? Is it working as expected?

Sure, I tested it with yaml file on "Special notes for your reviewer" section: (https://github.com/googleforgames/open-match/pull/1589)