From ac56c52b4cd7a27369e2cee34b89b5d4dc9fd51c Mon Sep 17 00:00:00 2001 From: Mikael Bergemalm Date: Thu, 19 Dec 2024 15:33:10 +0100 Subject: [PATCH] feat(helm): support dual-stack networking for load balancers --- install/helm/agones/templates/ping.yaml | 12 ++++++++++++ .../agones/templates/service/allocation.yaml | 6 ++++++ install/helm/agones/values.yaml | 6 ++++++ .../docs/Installation/Install Agones/helm.md | 18 ++++++++++++------ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/install/helm/agones/templates/ping.yaml b/install/helm/agones/templates/ping.yaml index d3c0ad4014..c2fe7179b2 100644 --- a/install/helm/agones/templates/ping.yaml +++ b/install/helm/agones/templates/ping.yaml @@ -158,6 +158,12 @@ metadata: spec: selector: agones.dev/role: ping +{{- if .Values.agones.ping.http.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.agones.ping.http.ipFamilyPolicy }} +{{- end }} +{{- if .Values.agones.ping.http.ipFamilies }} + ipFamilies: {{ toYaml .Values.agones.ping.http.ipFamilies | nindent 4 }} +{{- end }} ports: - port: {{ .Values.agones.ping.http.port }} name: http @@ -198,6 +204,12 @@ metadata: spec: selector: agones.dev/role: ping +{{- if .Values.agones.ping.udp.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.agones.ping.udp.ipFamilyPolicy }} +{{- end }} +{{- if .Values.agones.ping.udp.ipFamilies }} + ipFamilies: {{ toYaml .Values.agones.ping.udp.ipFamilies | nindent 4 }} +{{- end }} ports: - port: {{ .Values.agones.ping.udp.port }} name: udp diff --git a/install/helm/agones/templates/service/allocation.yaml b/install/helm/agones/templates/service/allocation.yaml index 8c538029f8..766f2fef78 100644 --- a/install/helm/agones/templates/service/allocation.yaml +++ b/install/helm/agones/templates/service/allocation.yaml @@ -33,6 +33,12 @@ metadata: spec: selector: multicluster.agones.dev/role: allocator +{{- if .Values.agones.allocator.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.agones.allocator.service.ipFamilyPolicy }} +{{- end }} +{{- if .Values.agones.allocator.service.ipFamilies }} + ipFamilies: {{ toYaml .Values.agones.allocator.service.ipFamilies | nindent 4 }} +{{- end }} ports: {{- if .Values.agones.allocator.service.http.enabled }} - port: {{ .Values.agones.allocator.service.http.port }} diff --git a/install/helm/agones/values.yaml b/install/helm/agones/values.yaml index 85d1ea9ac2..d2b9b5a3a1 100644 --- a/install/helm/agones/values.yaml +++ b/install/helm/agones/values.yaml @@ -186,6 +186,8 @@ agones: loadBalancerIP: "" loadBalancerSourceRanges: [] annotations: {} + ipFamilyPolicy: + ipFamilies: udp: expose: true rateLimit: 20 @@ -195,6 +197,8 @@ agones: loadBalancerIP: "" loadBalancerSourceRanges: [] annotations: {} + ipFamilyPolicy: + ipFamilies: healthCheck: initialDelaySeconds: 3 periodSeconds: 3 @@ -238,6 +242,8 @@ agones: loadBalancerIP: "" loadBalancerSourceRanges: [] annotations: {} + ipFamilyPolicy: + ipFamilies: http: enabled: true appProtocol: "" diff --git a/site/content/en/docs/Installation/Install Agones/helm.md b/site/content/en/docs/Installation/Install Agones/helm.md index a0223e0559..03d677055c 100644 --- a/site/content/en/docs/Installation/Install Agones/helm.md +++ b/site/content/en/docs/Installation/Install Agones/helm.md @@ -249,6 +249,8 @@ The following tables lists the configurable parameters of the Agones chart and t | `agones.ping.http.nodePort` | Static node port to use for HTTP ping service. (Only applies when `agones.ping.http.serviceType` is `NodePort`.) | `0` | | `agones.ping.http.loadBalancerIP` | The [Load Balancer IP][loadBalancer] of the HTTP Service load balancer. Only works if the Kubernetes provider supports this option. | \`\` | | `agones.ping.http.loadBalancerSourceRanges` | The [Load Balancer SourceRanges][loadBalancer] of the HTTP Service load balancer. Only works if the Kubernetes provider supports this option. | `[]` | +| `agones.ping.http.ipFamilyPolicy` | The `ipFamilyPolicy` setting for the Load Balancer. Kubernetes default is `SingleStack`. Set to `RequireDualStack` or `PreferDualStack` for dual-stack IPv4/IPv6 support if the Kubernetes provider supports this option. | `{}` | +| `agones.ping.http.ipFamilies` | The `ipFamilies` setting for the Load Balancer. Set to `IPv4` (default) or `IPv6` or both in combination with dual-stack `ipFamilyPolicy` setting. | `[]` | | `agones.ping.http.annotations` | [Annotations][annotations] added to the Agones ping http service | `{}` | | `agones.ping.udp.expose` | Expose the udp ping service via a Service | `true` | | `agones.ping.udp.rateLimit` | Number of UDP packets the ping service handles per instance, per second, per sender | `20` | @@ -258,6 +260,8 @@ The following tables lists the configurable parameters of the Agones chart and t | `agones.ping.udp.loadBalancerIP` | The [Load Balancer IP][loadBalancer] of the UDP Service load balancer. Only works if the Kubernetes provider supports this option. | \`\` | | `agones.ping.udp.loadBalancerSourceRanges` | The [Load Balancer SourceRanges][loadBalancer] of the UDP Service load balancer. Only works if the Kubernetes provider supports this option. | `[]` | | `agones.ping.udp.annotations` | [Annotations][annotations] added to the Agones ping udp service | `{}` | +| `agones.ping.udp.ipFamilyPolicy` | The `ipFamilyPolicy` setting for the Load Balancer. Kubernetes default is `SingleStack`. Set to `RequireDualStack` or `PreferDualStack` for dual-stack IPv4/IPv6 support if the Kubernetes provider supports this option. | `{}` | +| `agones.ping.udp.ipFamilies` | The `ipFamilies` setting for the Load Balancer. Set to `IPv4` (default) or `IPv6` or both in combination with dual-stack `ipFamilyPolicy` setting. | `[]` | | `agones.ping.healthCheck.initialDelaySeconds` | Initial delay before performing the first probe (in seconds) | `3` | | `agones.ping.healthCheck.periodSeconds` | Seconds between every liveness probe (in seconds) | `3` | | `agones.ping.healthCheck.failureThreshold` | Number of times before giving up (in seconds) | `3` | @@ -271,7 +275,7 @@ The following tables lists the configurable parameters of the Agones chart and t | `agones.ping.pdb.enabled` | Set to `true` to enable the creation of a [PodDisruptionBudget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for the ping deployment | `false` | | `agones.ping.pdb.minAvailable` | Description of the number of pods from that set that must still be available after the eviction, even in the absence of the evicted pod. Can be either an absolute number or a percentage. Mutually Exclusive with `maxUnavailable` | `1` | | `agones.ping.pdb.maxUnavailable` | Description of the number of pods from that set that can be unavailable after the eviction. It can be either an absolute number or a percentage Mutually Exclusive with `minAvailable` | \`\` | -| `agones.ping.topologySpreadConstraints` | Ensures better resource utilization and high availability by evenly distributing Pods in the agones-system namespace | `{}` | +| `agones.ping.topologySpreadConstraints` | Ensures better resource utilization and high availability by evenly distributing Pods in the agones-system namespace | `{}` | ### Allocator Service @@ -281,8 +285,8 @@ The following tables lists the configurable parameters of the Agones chart and t |----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| | `agones.allocator.apiServerQPS` | Maximum sustained queries per second that an allocator should be making against API Server | `400` | | `agones.allocator.apiServerQPSBurst` | Maximum burst queries per second that an allocator should be making against API Server | `500` | -| `agones.allocator.remoteAllocationTimeout` | Remote allocation call timeout. | `10s` | -| `agones.allocator.totalRemoteAllocationTimeout` | Total remote allocation timeout including retries. | `30s` | +| `agones.allocator.remoteAllocationTimeout` | Remote allocation call timeout. | `10s` | +| `agones.allocator.totalRemoteAllocationTimeout` | Total remote allocation timeout including retries. | `30s` | | `agones.allocator.logLevel` | Agones Allocator Log level. Log only entries with that severity and above | `info` | | `agones.allocator.install` | Whether to install the [allocator service][allocator] | `true` | | `agones.allocator.replicas` | The number of replicas to run in the deployment | `3` | @@ -292,17 +296,19 @@ The following tables lists the configurable parameters of the Agones chart and t | `agones.allocator.service.loadBalancerIP` | The [Load Balancer IP][loadBalancer] of the Agones allocator load balancer. Only works if the Kubernetes provider supports this option. | \`\` | | `agones.allocator.service.loadBalancerSourceRanges` | The [Load Balancer SourceRanges][loadBalancer] of the Agones allocator load balancer. Only works if the Kubernetes provider supports this option. | `[]` | | `agones.allocator.service.annotations` | [Annotations][annotations] added to the Agones allocator service | `{}` | +| `agones.allocator.service.ipFamilyPolicy` | The `ipFamilyPolicy` setting for the Load Balancer. Kubernetes default is `SingleStack`. Set to `RequireDualStack` or `PreferDualStack` for dual-stack IPv4/IPv6 support if the Kubernetes provider supports this option. | `{}` | +| `agones.allocator.service.ipFamilies` | The `ipFamilies` setting for the Load Balancer. Set to `IPv4` (default) or `IPv6` or both in combination with dual-stack `ipFamilyPolicy` setting. | `[]` | | `agones.allocator.service.http.enabled` | If true the [allocator service][allocator] will respond to [REST requests][rest-requests] | `true` | | `agones.allocator.service.http.appProtocol` | The `appProtocol` to set on the Service for the http allocation port. If left blank, no value is set. | `` | | `agones.allocator.service.http.port` | The port that is exposed externally by the [allocator service][allocator] for [REST requests][rest-requests] | `443` | | `agones.allocator.service.http.portName` | The name of exposed port | `http` | | `agones.allocator.service.http.targetPort` | The port that is used by the allocator pod to listen for [REST requests][rest-requests]. Note that the allocator server cannot bind to low numbered ports. | `8443` | | `agones.allocator.service.http.nodePort` | If the ServiceType is set to "NodePort", this is the NodePort that the allocator http service is exposed on. | `30000-32767` | -| `agones.allocator.service.http.unallocatedStatusCode` | HTTP status code to return when no GameServer is available for allocation. This setting allows for custom responses when a game server allocation fails, offering flexibility in handling these situations. | `429` | +| `agones.allocator.service.http.unallocatedStatusCode` | HTTP status code to return when no GameServer is available for allocation. This setting allows for custom responses when a game server allocation fails, offering flexibility in handling these situations. | `429` | | `agones.allocator.service.grpc.enabled` | If true the [allocator service][allocator] will respond to [gRPC requests][grpc-requests] | `true` | | `agones.allocator.service.grpc.port` | The port that is exposed externally by the [allocator service][allocator] for [gRPC requests][grpc-requests] | `443` | | `agones.allocator.service.grpc.portName` | The name of exposed port | `` | -| `agones.allocator.service.grpc.appProtocol` | The `appProtocol` to set on the Service for the gRPC allocation port. If left blank, no value is set. | `` | +| `agones.allocator.service.grpc.appProtocol` | The `appProtocol` to set on the Service for the gRPC allocation port. If left blank, no value is set. | `` | | `agones.allocator.service.grpc.nodePort` | If the ServiceType is set to "NodePort", this is the NodePort that the allocator gRPC service is exposed on. | `30000-32767` | | `agones.allocator.service.grpc.targetPort` | The port that is used by the allocator pod to listen for [gRPC requests][grpc-requests]. Note that the allocator server cannot bind to low numbered ports. | `8443` | | `agones.allocator.generateClientTLS` | Set to true to generate client TLS certificates or false to provide certificates in `certs/allocator/allocator-client.default/*` | `true` | @@ -331,7 +337,7 @@ The following tables lists the configurable parameters of the Agones chart and t | `agones.allocator.pdb.enabled` | Set to `true` to enable the creation of a [PodDisruptionBudget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for the allocator deployment | `false` | | `agones.allocator.pdb.minAvailable` | Description of the number of pods from that set that must still be available after the eviction, even in the absence of the evicted pod. Can be either an absolute number or a percentage. Mutually Exclusive with `maxUnavailable` | `1` | | `agones.allocator.pdb.maxUnavailable` | Description of the number of pods from that set that can be unavailable after the eviction. It can be either an absolute number or a percentage. Mutually Exclusive with `minAvailable` | \`\` | -| `agones.allocator.topologySpreadConstraints` | Ensures better resource utilization and high availability by evenly distributing Pods in the agones-system namespace | `{}` | +| `agones.allocator.topologySpreadConstraints` | Ensures better resource utilization and high availability by evenly distributing Pods in the agones-system namespace | `{}` | {{% /feature %}} {{% feature publishVersion="1.46.0" %}}