Skip to content
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

change service port name to support Istio explicit protocol selection #346

Merged
merged 1 commit into from Aug 30, 2022
Merged

Conversation

nberlee
Copy link
Contributor

@nberlee nberlee commented Aug 29, 2022

Kubernetes has a native construct for this called appProtocol. Kubernetes
expects either a IANA protocol or a custom protocol prefix with a domain.

I tried setting appProtocol to nats.io/client but that does not effect
anything Istio, as istio expects only these protocols:
https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/#explicit-protocol-selection

Setting appProtocol to tcp probably does work, but tcp is not a valid
iana service name. See:
https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml

Therefor the least intrusive, compatible leaves us with prefixing the service
port name.

Fixes: #88

Kubernetes has a native construct for this called `appProtocol`. Kubernetes
expects either a IANA protocol or a custom protocol prefix with a domain.

I tried setting `appProtocol` to `nats.io/client` but that does not effect
in Istio, as istio expects only these protocols:
https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/#explicit-protocol-selection

Setting `appProtocol` to `tcp` probably does work, but tcp is not a valid
iana service name. See:
https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml

Therefor the least intrusive, compatible leaves us with prefixing the service
port name.

Fixes: #88
@wallyqs wallyqs merged commit 5e702c5 into nats-io:master Aug 30, 2022
@vitalii-buchyn-exa
Copy link

hi, sorry for postmortem post, but is this fix needed for tcp/6222 server port as well?
thank you

@nberlee
Copy link
Contributor Author

nberlee commented Dec 23, 2022

Typically no... As running NATS inside the istio-mesh may break other things also... but it could not hurt

If I understand correctly 6222 is only used from server to server. And I think most people will run NATS outside the istio-mesh as you run into other problems as well when you run it inside the mesh.

As 4222 can be called from a pod inside the istio-mesh, you need the explicit protocol selection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nats-Operator incompatible with istio?
3 participants