-
Notifications
You must be signed in to change notification settings - Fork 75
Allow configuring labels, annotations, and ports for the multiplayer Service #222
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
Allow configuring labels, annotations, and ports for the multiplayer Service #222
Conversation
| ports: | ||
| - name: http-server | ||
| protocol: TCP | ||
| {{- if .Values.multiplayer.service.externalPort }} |
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.
There's no need for an if/else here since you defined a default value for externalPort in values.yaml! Feel free to just have the port: {{ .Values.service.externalPort }} here.
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.
With this if/else, it's backwards compatible in case people don't have the externalPort in their current values.yaml. If we don't have it, then if people quietly upgrade their chart without adding to values.yaml, things would likely break.
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.
Ah, thanks for the explanation!
Apologies for being unclear, since you set a default value in values.yaml, it should carry over if they did not define it. I thought our default values.yaml would still act as the final fallback set of values in the event that someone didn't have a value set, but I'm hazy now and don't remember for sure.
Since you're leaving this check, I did notice that you've used .Values.multiplayer.service.externalPort as the if condition, but .Values.service.externalPort as the actual value being set. Should they match?
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.
Oh yeah that was a mistake, it should've all referred to the multiplayer part of the config. Thanks for fixing it directly.
|
Formatting generally looks good here; I may be able to help test this to make sure it works as expected. Would you be able to make the changes as suggested? Unfortunately, I think it may be difficult for me to push directly to the branch as it's a fork (and I actually don't know how easy it would be for me to push to a fork). |
I'm not sure what you mean with the difficulty. You can literally just checkout the branch and push to it. |
bdbd540 to
1898dbb
Compare
|
Just a heads up that this is still on my radar, but I think we have a linting test that's broken. Will try to confirm that it's indeed not working first before rebasing and getting this in, but unfortunately need some more time. |
1898dbb to
68a6e9a
Compare
The main use for this is that in our implementation, the multiplayer Service is exposed as a Network Endpoint Group in Google Cloud. This requires adding a particular
annotationto the Service. So as a workaround, I am using the following Service definition, managed as a manifest outside of the Helm chart:(Our setup is roughly along the lines of this guide.)
It'd be useful if this pattern could be supported through the Helm chart directly. It is already supported for the backend Service, simply by setting this in
values.yaml:I am not a Kubernetes expert, and haven't messed with Helm charts before. So it's quite likely something needs adjusting. Also, this code is untested as of writing. Feel free to push changes to this branch.