Skip to content

Commit

Permalink
Added option to hardcode load balancer IP for allocator. (#1766)
Browse files Browse the repository at this point in the history
* Added option to hardcode load balancer IP for allocator.

* Updated documentation and manually tested change.

Co-authored-by: Nikhil Athreya <[email protected]>
  • Loading branch information
devloop0 and nathreya-google authored Aug 21, 2020
1 parent 861c4f7 commit 638a7fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion install/helm/agones/templates/service/allocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions install/helm/agones/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ agones:
http:
port: 443
serviceType: LoadBalancer
loadBalancerIP: ""
annotations: {}
generateTLS: true
generateClientTLS: true
Expand Down
4 changes: 3 additions & 1 deletion site/content/en/docs/Installation/Install Agones/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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,

Expand Down

0 comments on commit 638a7fd

Please sign in to comment.