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

TCPUDP not supported #2314

Closed
stpnov opened this issue Oct 15, 2021 · 11 comments · Fixed by #3375
Closed

TCPUDP not supported #2314

stpnov opened this issue Oct 15, 2021 · 11 comments · Fixed by #3375
Assignees
Labels
awaiting-maintainer Block issues from being stale/obsolete/closed help wanted We would love help on these issues. Please come help us! kind/bug These are bugs.

Comments

@stpnov
Copy link

stpnov commented Oct 15, 2021

What happened:

Pod "gameserver" is invalid: spec.containers[0].ports[0].protocol: Unsupported value: "TCPUDP": supported values: "SCTP", "TCP", "UDP"

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

apiVersion: agones.dev/v1
kind: GameServer
spec:
  ports:
     portPolicy: Static
     containerPort: 7000
     hostPort: 7000
     protocol: TCPUDP

Anything else we need to know?:

Environment:

  • Agones version: v1.18.0
  • Kubernetes version (use kubectl version): v1.22.1
  • Install method (yaml/helm): helm
@stpnov stpnov added the kind/bug These are bugs. label Oct 15, 2021
@markmandel
Copy link
Member

🤔 I wonder if we don't catch the condition in a Static config.

Can you try a dynamic port config?

@stpnov
Copy link
Author

stpnov commented Oct 15, 2021

Everything works fine with dynamic port

@roberthbailey
Copy link
Member

roberthbailey commented Oct 18, 2021

#1764 only updated the code path where we assign a port to the game server.

@roberthbailey roberthbailey added the help wanted We would love help on these issues. Please come help us! label Oct 18, 2021
@markmandel
Copy link
Member

markmandel commented Feb 24, 2022

This looks to be the magic line of concern:

if p.PortPolicy != agonesv1.Dynamic && p.PortPolicy != agonesv1.Passthrough {
continue
}

Reference for GameServer - see ports section:
https://agones.dev/site/docs/reference/gameserver/

@markmandel
Copy link
Member

On review with @SaitejaTamma , really we should move the custom logic from portallocator.go to

for _, p := range gs.Spec.Ports {
cp := corev1.ContainerPort{
ContainerPort: p.ContainerPort,
HostPort: p.HostPort,
Protocol: p.Protocol,
}

Since GameServer.Pod(...) is the central place that handles the creation of a Pod's container ports.

@markmandel
Copy link
Member

@ashutosji we tried this a long time ago - but if you're looking for a challenge, this could be for you.

This will require you to create a test cluster, build Agones, and have tests for it (go through https://github.com/googleforgames/agones/blob/main/build/README.md). Have a look and let me know if you would be willing to give this a shot.

@ashutosji
Copy link
Contributor

Sure @markmandel! I will look into this.

@ashutosji
Copy link
Contributor

This looks to be the magic line of concern:

if p.PortPolicy != agonesv1.Dynamic && p.PortPolicy != agonesv1.Passthrough {
continue
}

Reference for GameServer - see ports section: https://agones.dev/site/docs/reference/gameserver/

isn't this piece of code is confusing? If the condition is valid then it should work for Static as well. Or else i can remove this case.
WDYT?

@markmandel
Copy link
Member

markmandel commented Aug 24, 2023

The tricky part is:

gsCopy := c.portAllocator.Allocate(gs.DeepCopy())

Doesn't get called, because for Static port, there is no allocation.

@github-actions
Copy link

'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '

@github-actions github-actions bot added the stale Pending closure unless there is a strong objection. label Oct 15, 2023
@markmandel
Copy link
Member

Currently being work on in #3375

@markmandel markmandel added awaiting-maintainer Block issues from being stale/obsolete/closed and removed stale Pending closure unless there is a strong objection. labels Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Block issues from being stale/obsolete/closed help wanted We would love help on these issues. Please come help us! kind/bug These are bugs.
Projects
None yet
5 participants