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

HostPort when enableClientsHostPort is set to false #300

Closed
mtryfoss opened this issue Dec 15, 2020 · 2 comments
Closed

HostPort when enableClientsHostPort is set to false #300

mtryfoss opened this issue Dec 15, 2020 · 2 comments

Comments

@mtryfoss
Copy link
Contributor

mtryfoss commented Dec 15, 2020

Hi,

I see that gateway, leaf or websocket config automatically enables listening on a HostPort. In my setup, we use Calico CNI where all Pods do have direct connectivity to our environment. I use discovery through a service with "externalTrafficPolicy: Local" which seems to work perfectly.

if gatewayPort > 0 {
	port := v1.ContainerPort{
		Name:          "gateway",
		ContainerPort: int32(gatewayPort),
		Protocol:      v1.ProtocolTCP,
		HostPort:      int32(gatewayPort),
	}
	ports = append(ports, port)
}
if leafnodePort > 0 {
	port := v1.ContainerPort{
		Name:          "leaf",
		ContainerPort: int32(leafnodePort),
		Protocol:      v1.ProtocolTCP,
		HostPort:      int32(leafnodePort),
	}
	ports = append(ports, port)
}
if websocketPort > 0 {
	port := v1.ContainerPort{
		Name:          "websocket",
		ContainerPort: int32(websocketPort),
		Protocol:      v1.ProtocolTCP,
		HostPort:      int32(websocketPort),
	}
	ports = append(ports, port)
}

Would you accept a PR making it possible to disable this behaviour (enabled by default), making it only request a ContainerPort?
For example:

disableGatewaysHostPort
disableLeafnodesHostPort
disableWebsocketsHostPort

@wallyqs
Copy link
Member

wallyqs commented Dec 15, 2020

Sounds like a good change to me, we'd gladly accept a PR like that.

@mtryfoss
Copy link
Contributor Author

Updated the PR with new master branch now. Hope it looks ok.

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

No branches or pull requests

2 participants