-
Notifications
You must be signed in to change notification settings - Fork 201
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 appProtocol for OpenShift #1487
Conversation
@clementduveau Looking great! LGTM! =D |
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 looks reasonable to me, will defer to @petewall for final confirmation.
@@ -29,5 +29,9 @@ spec: | |||
port: {{ $portMap.port }} | |||
targetPort: {{ $portMap.targetPort }} | |||
protocol: {{ coalesce $portMap.protocol "TCP" }} | |||
{{- if not (empty $portMap.appProtocol) }} |
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.
Could this be simplified to:
{{- if not (empty $portMap.appProtocol) }} | |
{{- if $portMap.appProtocol }} |
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.
Would make it easier to read. But isn't {{- if not (empty $portMap.appProtocol) }} better if you want to ensure that $portMap.appProtocol is not only present but also non-empty?
If $portMap.appProtocol is undefined or empty, the first version (empty) will prevent any unexpected issues by skipping the block, while the second version ($portMap.appProtocol) might run into problems if the variable is not properly initialized.
Chances are slim, so I am (in the end) happy with both ❤️
PR Description
On OpenShift, to expose Alloy gRPC to receive OTLP from other ressources, by default, you need to specifiy appProtocol = h2c on the service. It actually depends on your setup but the default Ingress HAProxy requires it, so probably 80% of RedHat customers needs it.
This PR just add the appProtocol as a possibility in the values.yaml. If not set, it outputs nothing. No default value because Kubernetes uses it as a "hint", therefore it's not mandatory.
Which issue(s) this PR fixes
Fixes #1405
PR Checklist