From 638a7fddecd23ec24881a738a59c45e0f8b0db7d Mon Sep 17 00:00:00 2001 From: Nikhil Athreya Date: Thu, 20 Aug 2020 23:55:10 -0700 Subject: [PATCH] Added option to hardcode load balancer IP for allocator. (#1766) * Added option to hardcode load balancer IP for allocator. * Updated documentation and manually tested change. Co-authored-by: Nikhil Athreya --- install/helm/agones/templates/service/allocation.yaml | 6 +++++- install/helm/agones/values.yaml | 1 + site/content/en/docs/Installation/Install Agones/helm.md | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/install/helm/agones/templates/service/allocation.yaml b/install/helm/agones/templates/service/allocation.yaml index bb11626586..fe5ef422c8 100644 --- a/install/helm/agones/templates/service/allocation.yaml +++ b/install/helm/agones/templates/service/allocation.yaml @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +{{- $useLoadBalancerIP := and (ne .Values.agones.allocator.http.loadBalancerIP "") (eq .Values.agones.allocator.http.serviceType "LoadBalancer") }} {{- if .Values.agones.allocator.install }} # Define a Service for the agones-allocator apiVersion: v1 @@ -38,6 +39,9 @@ spec: targetPort: 8443 protocol: TCP type: {{ .Values.agones.allocator.http.serviceType }} +{{- if $useLoadBalancerIP }} + loadBalancerIP: {{ .Values.agones.allocator.http.loadBalancerIP }} +{{- end }} --- # Deploy a pod to run the agones-allocator code @@ -241,7 +245,7 @@ data: --- # Allocation TLS certs -{{- $cert := genSignedCert "" nil nil 3650 $ca }} +{{- $cert := genSignedCert "" ($useLoadBalancerIP | ternary (list .Values.agones.allocator.http.loadBalancerIP) nil) nil 3650 $ca }} apiVersion: v1 kind: Secret type: kubernetes.io/tls diff --git a/install/helm/agones/values.yaml b/install/helm/agones/values.yaml index 6364bca432..f6e25d30ed 100644 --- a/install/helm/agones/values.yaml +++ b/install/helm/agones/values.yaml @@ -124,6 +124,7 @@ agones: http: port: 443 serviceType: LoadBalancer + loadBalancerIP: "" annotations: {} generateTLS: true generateClientTLS: true diff --git a/site/content/en/docs/Installation/Install Agones/helm.md b/site/content/en/docs/Installation/Install Agones/helm.md index d68569216a..979d1d67e7 100644 --- a/site/content/en/docs/Installation/Install Agones/helm.md +++ b/site/content/en/docs/Installation/Install Agones/helm.md @@ -228,7 +228,8 @@ The following tables lists the configurable parameters of the Agones chart and t | Parameter | Description | Default | | --------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ---------------------- | -| | | | +| `agones.allocator.http.loadBalancerIP` | The [Load Balancer IP][loadBalancerIP] of the Agones allocator load balancer. Only works if the Kubernetes provider supports this option. | "" | + {{% /feature %}} [toleration]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ @@ -239,6 +240,7 @@ The following tables lists the configurable parameters of the Agones chart and t [ping]: {{< ref "/docs/Guides/ping-service.md" >}} [service]: https://kubernetes.io/docs/concepts/services-networking/service/ [allocator]: {{< ref "/docs/advanced/allocator-service.md" >}} +[loadBalancerIP]: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,