-
Notifications
You must be signed in to change notification settings - Fork 799
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
GameServer Pod: Stable Network ID #2826
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,25 @@ The `spec` field is the actual GameServer specification and it is composed as fo | |
The GameServer resource does not support updates. If you need to make regular updates to the GameServer spec, consider using a [Fleet]({{< ref "/docs/Reference/fleet.md" >}}). | ||
{{< /alert >}} | ||
|
||
## Stable Network ID | ||
|
||
{{< alpha title="Stable Network ID" gate="PodHostname" >}} | ||
|
||
Each Pod attached to a `GameServer` derives its hostname from the name of the `GameServer`. | ||
A group of `Pods` attached to `GameServers` can use a | ||
[Headless Service](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) to control | ||
the domain of the Pods, along with providing | ||
a [`subdomain` value to the `GameServer` `PodTemplateSpec`](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-hostname-and-subdomain-fields) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This documentation says:
Which sounds like k8s already does exactly what you are adding in this PR. Do we need to explicitly set the hostname field? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went back and forth on this as well, but then I read this part:
So TL;DR - to have a A record for the pod, it has to have a hostname specified. This isn't surprising to me - since the (general) formatting for a resource name allows characters and lengths of strings that aren't allowed in host names for DNS entries. I think where they say "hostname" above, what they mean is the internal hostname to the container - not an external DNS entry. |
||
to provide all the required details such that Kubernetes will create a DNS record for each Pod behind the Service. | ||
|
||
You are also responsible for setting the labels on the `GameServer.Spec.Template.Metadata` to set the labels on the | ||
created Pods and creating the Headless Service responsible for the network identity of the pods, Agones will not do | ||
this for you, as a stable DNS record is not required for all use cases. | ||
|
||
To ensure that the `hostName` value matches | ||
[RFC 1123](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names), any `.` values | ||
in the `GameServer` name are replaced by `-` when setting the `hostName` value. | ||
|
||
## GameServer State Diagram | ||
|
||
The following diagram shows the lifecycle of a `GameServer`. | ||
|
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.
Just adding this as a formal review comment. I think since this is altering the generated pod in a possibly significant way, we should add a feature gate. It can go straight to
beta
, IMO - but especially in a world where we're releasing straight frommain
, I think we should be a little cautious.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.
Sounds good to me - I'll make the change.
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.
...and done!