<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Agones – Advanced</title>
    <link>/site/docs/advanced/</link>
    <description>Recent content in Advanced on Agones</description>
    <generator>Hugo -- gohugo.io</generator>
    <lastBuildDate>Thu, 03 Jan 2019 05:44:55 +0000</lastBuildDate>
    
	  <atom:link href="/site/docs/advanced/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: Scheduling and Autoscaling</title>
      <link>/site/docs/advanced/scheduling-and-autoscaling/</link>
      <pubDate>Thu, 03 Jan 2019 05:45:05 +0000</pubDate>
      
      <guid>/site/docs/advanced/scheduling-and-autoscaling/</guid>
      <description>
        
        
        &lt;h2 id=&#34;cluster-autoscaler&#34;&gt;Cluster Autoscaler&lt;/h2&gt;
&lt;p&gt;Kubernetes has a &lt;a href=&#34;https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler&#34;&gt;cluster node autoscaler that works with a wide variety of cloud providers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The default scheduling strategy (&lt;code&gt;Packed&lt;/code&gt;) is designed to work with the Kubernetes autoscaler out of the box.&lt;/p&gt;
&lt;p&gt;The autoscaler will automatically add Nodes to the cluster when &lt;code&gt;GameServers&lt;/code&gt; don&amp;rsquo;t have room to be scheduled on the
clusters, and then scale down when there are empty Nodes with no &lt;code&gt;GameServers&lt;/code&gt; running on them.&lt;/p&gt;
&lt;p&gt;This means that scaling &lt;code&gt;Fleets&lt;/code&gt; up and down can be used to control the size of the cluster, as the cluster autoscaler
will adjust the size of the cluster to match the resource needs of one or more &lt;code&gt;Fleets&lt;/code&gt; running on it.&lt;/p&gt;
&lt;p&gt;To enable and configure autoscaling on your cloud provider, check their &lt;a href=&#34;https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider&#34;&gt;connector implementation&lt;/a&gt;,
or their cloud specific documentation.&lt;/p&gt;
&lt;h3 id=&#34;google-kubernetes-engine&#34;&gt;Google Kubernetes Engine&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-autoscaler&#34;&gt;Administering Clusters: Autoscaling a Cluster&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler&#34;&gt;Cluster Autoscaler&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;amazon-elastic-kubernetes-service&#34;&gt;Amazon Elastic Kubernetes Service&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.aws.amazon.com/eks/latest/userguide/cluster-autoscaler.html&#34;&gt;Cluster Autoscaler for EKS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;azure-kubernetes-service&#34;&gt;Azure Kubernetes Service&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.microsoft.com/en-us/azure/aks/autoscaler&#34;&gt;Cluster Autoscaler on Azure Kubernetes Service (AKS) - Preview&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;fleet-autoscaling&#34;&gt;Fleet Autoscaling&lt;/h2&gt;
&lt;p&gt;Fleet autoscaling is the only type of autoscaling that exists in Agones. It is currently available as a
buffer autoscaling strategy or as a webhook driven strategy, such that you can provide your own autoscaling logic.&lt;/p&gt;
&lt;p&gt;Have a look at the &lt;a href=&#34;/site/site/docs/getting-started/create-fleetautoscaler/&#34;&gt;Create a Fleet Autoscaler&lt;/a&gt; quickstart, the
&lt;a href=&#34;/site/site/docs/getting-started/create-webhook-fleetautoscaler/&#34;&gt;Create a Webhook Fleet Autoscaler&lt;/a&gt; quickstart,
and the &lt;a href=&#34;/site/site/docs/reference/fleetautoscaler/&#34;&gt;Fleet Autoscaler Specification&lt;/a&gt; for details.&lt;/p&gt;
&lt;h2 id=&#34;autoscaling-concepts&#34;&gt;Autoscaling Concepts&lt;/h2&gt;
&lt;p&gt;To facilitate autoscaling, we need to combine several concepts and functionality, as described below.&lt;/p&gt;
&lt;h3 id=&#34;allocation-scheduling&#34;&gt;Allocation Scheduling&lt;/h3&gt;
&lt;p&gt;Allocation scheduling refers to the order in which &lt;code&gt;GameServers&lt;/code&gt;, and specifically their backing &lt;code&gt;Pods&lt;/code&gt; are chosen
from across the Kubernetes cluster within a given &lt;code&gt;Fleet&lt;/code&gt; when &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/#4-allocate-a-game-server-from-the-fleet&#34;&gt;allocation&lt;/a&gt; occurs.&lt;/p&gt;
&lt;h3 id=&#34;pod-scheduling&#34;&gt;Pod Scheduling&lt;/h3&gt;
&lt;p&gt;Each &lt;code&gt;GameServer&lt;/code&gt; is backed by a Kubernetes &lt;a href=&#34;https://kubernetes.io/docs/concepts/workloads/pods/pod/&#34;&gt;&lt;code&gt;Pod&lt;/code&gt;&lt;/a&gt;. Pod scheduling
refers to the strategy that is in place that determines which node in the Kubernetes cluster the Pod is assigned to,
when it is created.&lt;/p&gt;
&lt;h3 id=&#34;fleet-scale-down-strategy&#34;&gt;Fleet Scale Down Strategy&lt;/h3&gt;
&lt;p&gt;Fleet Scale Down strategy refers to the order in which the &lt;code&gt;GameServers&lt;/code&gt; that belong to a &lt;code&gt;Fleet&lt;/code&gt; are deleted,
when Fleets are shrunk in size.&lt;/p&gt;
&lt;h2 id=&#34;fleet-scheduling&#34;&gt;Fleet Scheduling&lt;/h2&gt;
&lt;p&gt;There are two scheduling strategies for Fleets - each designed for different types of Kubernetes Environments.&lt;/p&gt;
&lt;h3 id=&#34;packed&#34;&gt;Packed&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;apiVersion&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;agones.dev/v1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;kind&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;Fleet&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;metadata&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;simple-game-server&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;replicas&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;scheduling&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;Packed&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;template&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;ports&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containerPort&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;7654&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;template&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;          &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containers&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;          &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;simple-game-server&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;image&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;us-docker.pkg.dev/agones-images/examples/simple-game-server:0.15&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is the &lt;em&gt;default&lt;/em&gt; Fleet scheduling strategy. It is designed for dynamic Kubernetes environments, wherein you wish
to scale up and down as load increases or decreases, such as in a Cloud environment where you are paying
for the infrastructure you use.&lt;/p&gt;
&lt;p&gt;It attempts to &lt;em&gt;pack&lt;/em&gt; as much as possible into the smallest set of nodes, to make
scaling infrastructure down as easy as possible.&lt;/p&gt;
&lt;p&gt;This affects the Cluster autoscaler, Allocation Scheduling, Pod Scheduling and Fleet Scale Down Scheduling.&lt;/p&gt;
&lt;h4 id=&#34;cluster-autoscaler-1&#34;&gt;Cluster Autoscaler&lt;/h4&gt;
&lt;p&gt;When using the &amp;ldquo;Packed&amp;rdquo; strategy, Agones will ensure that the Cluster Autoscaler doesn&amp;rsquo;t attempt to evict and move &lt;code&gt;GameServer&lt;/code&gt; &lt;code&gt;Pods&lt;/code&gt; onto new Nodes during
gameplay.&lt;/p&gt;

&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
    &lt;h4 class=&#34;alert-heading&#34;&gt;Warning&lt;/h4&gt;
    &lt;p&gt;The &lt;code&gt;eviction&lt;/code&gt; API feature is currently &lt;strong&gt;&lt;a href=&#34;/site/site/docs/guides/feature-stages/#beta&#34;&gt;Beta&lt;/a&gt;&lt;/strong&gt;,
        and while it is enabled by default it may change in the future.&lt;/p&gt;
    &lt;p&gt;Use the Feature Gate &lt;code&gt;SafeToEvict&lt;/code&gt; to disable this feature.&lt;/p&gt;
    &lt;p&gt;See the &lt;a href=&#34;/site/site/docs/guides/feature-stages/#feature-gates&#34;&gt;Feature Gate documentation&lt;/a&gt; for details on how to disable features.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;If a gameserver can tolerate &lt;a href=&#34;https://kubernetes.io/docs/concepts/scheduling-eviction/api-eviction/#how-api-initiated-eviction-works&#34;&gt;being evicted&lt;/a&gt;
(generally in combination with setting an appropriate graceful termination period on the gameserver pod) and you
want the Cluster Autoscaler to compact your cluster by evicting game servers when it would allow the Cluster
Autoscaler to reduce the number of nodes in the cluster, &lt;a href=&#34;/site/site/docs/advanced/controlling-disruption/&#34;&gt;Controlling Disruption&lt;/a&gt; describes
how to choose the &lt;code&gt;.eviction&lt;/code&gt; setting appropriate for your &lt;code&gt;GameServer&lt;/code&gt; or &lt;code&gt;Fleet&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&#34;allocation-scheduling-strategy&#34;&gt;Allocation Scheduling Strategy&lt;/h4&gt;
&lt;p&gt;Under the &amp;ldquo;Packed&amp;rdquo; strategy, allocation will prioritise allocating &lt;code&gt;GameServers&lt;/code&gt; to nodes that are running on
Nodes that already have allocated &lt;code&gt;GameServers&lt;/code&gt; running on them.&lt;/p&gt;
&lt;h4 id=&#34;pod-scheduling-strategy&#34;&gt;Pod Scheduling Strategy&lt;/h4&gt;
&lt;p&gt;Under the &amp;ldquo;Packed&amp;rdquo; strategy, Pods will be scheduled using the &lt;a href=&#34;https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature&#34;&gt;&lt;code&gt;PodAffinity&lt;/code&gt;&lt;/a&gt;
with a &lt;code&gt;preferredDuringSchedulingIgnoredDuringExecution&lt;/code&gt; affinity with &lt;a href=&#34;https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels&#34;&gt;hostname&lt;/a&gt;
topology. This attempts to group together &lt;code&gt;GameServer&lt;/code&gt; Pods within as few nodes in the cluster as it can.&lt;/p&gt;


&lt;div class=&#34;alert alert-info&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Note&lt;/h4&gt;

    The default Kubernetes scheduler doesn&amp;rsquo;t do a perfect job of packing, but it&amp;rsquo;s a good enough job for what we need -
at least at this stage.

&lt;/div&gt;

&lt;h4 id=&#34;fleet-scale-down-strategy-1&#34;&gt;Fleet Scale Down Strategy&lt;/h4&gt;
&lt;p&gt;With the &amp;ldquo;Packed&amp;rdquo; strategy, Fleets will remove &lt;code&gt;Ready&lt;/code&gt; &lt;code&gt;GameServers&lt;/code&gt; from Nodes with the &lt;em&gt;least&lt;/em&gt; number of &lt;code&gt;Ready&lt;/code&gt; and
&lt;code&gt;Allocated&lt;/code&gt; &lt;code&gt;GameServers&lt;/code&gt; on them. Attempting to empty Nodes so that they can be safely removed.&lt;/p&gt;
&lt;h3 id=&#34;distributed&#34;&gt;Distributed&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;apiVersion&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;agones.dev/v1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;kind&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;Fleet&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;metadata&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;simple-game-server&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;replicas&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;100&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;scheduling&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;Distributed&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;template&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;ports&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containerPort&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;7654&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;template&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;          &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containers&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;          &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;simple-game-server&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;image&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;us-docker.pkg.dev/agones-images/examples/simple-game-server:0.15&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This Fleet scheduling strategy is designed for static Kubernetes environments, such as when you are running Kubernetes
on bare metal, and the cluster size rarely changes, if at all.&lt;/p&gt;
&lt;p&gt;This attempts to distribute the load across the entire cluster as much as possible, to take advantage of the static
size of the cluster.&lt;/p&gt;
&lt;p&gt;This affects Allocation Scheduling, Pod Scheduling and Fleet Scale Down Scheduling.&lt;/p&gt;
&lt;h4 id=&#34;cluster-autoscaler-2&#34;&gt;Cluster Autoscaler&lt;/h4&gt;
&lt;p&gt;Since this strategy is not aimed at clusters that autoscale, this strategy does nothing for the cluster autoscaler.&lt;/p&gt;
&lt;h4 id=&#34;allocation-scheduling-strategy-1&#34;&gt;Allocation Scheduling Strategy&lt;/h4&gt;
&lt;p&gt;Under the &amp;ldquo;Distributed&amp;rdquo; strategy, allocation will prioritise allocating &lt;code&gt;GameServers&lt;/code&gt; to nodes that have the least
number of allocated &lt;code&gt;GameServers&lt;/code&gt; on them.&lt;/p&gt;
&lt;h4 id=&#34;pod-scheduling-strategy-1&#34;&gt;Pod Scheduling Strategy&lt;/h4&gt;
&lt;p&gt;Under the &amp;ldquo;Distributed&amp;rdquo; strategy, &lt;code&gt;Pod&lt;/code&gt; scheduling is provided by the default Kubernetes scheduler, which will attempt
to distribute the &lt;code&gt;GameServer&lt;/code&gt; &lt;code&gt;Pods&lt;/code&gt; across as many nodes as possible.&lt;/p&gt;
&lt;h4 id=&#34;fleet-scale-down-strategy-2&#34;&gt;Fleet Scale Down Strategy&lt;/h4&gt;
&lt;p&gt;With the &amp;ldquo;Distributed&amp;rdquo; strategy, Fleets will remove &lt;code&gt;Ready&lt;/code&gt; &lt;code&gt;GameServers&lt;/code&gt; from Nodes with at random, to ensure
a distributed load is maintained.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: High Availability Agones</title>
      <link>/site/docs/advanced/high-availability-agones/</link>
      <pubDate>Fri, 10 Feb 2023 00:00:00 +0000</pubDate>
      
      <guid>/site/docs/advanced/high-availability-agones/</guid>
      <description>
        
        
        
&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
    &lt;h4 class=&#34;alert-heading&#34;&gt;Warning&lt;/h4&gt;
    &lt;p&gt;The split controller and extensions feature is currently &lt;strong&gt;&lt;a href=&#34;/site/site/docs/guides/feature-stages/#alpha&#34;&gt;Alpha&lt;/a&gt;&lt;/strong&gt;,
        not enabled by default, and may change in the future.&lt;/p&gt;
&lt;p&gt;Use the FeatureGate  &lt;code&gt;SplitControllerAndExtensions&lt;/code&gt;
to enable and test this feature.&lt;/p&gt;
    &lt;p&gt;See the &lt;a href=&#34;/site/site/docs/guides/feature-stages/#feature-gates&#34;&gt;Feature Gate documentation&lt;/a&gt; for details on how to enable features.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&#34;high-availability-for-agones-controller&#34;&gt;High Availability for Agones Controller&lt;/h2&gt;
&lt;p&gt;When &lt;code&gt;SplitControllerAndExtensions&lt;/code&gt; is enabled, the &lt;code&gt;agones-controller&lt;/code&gt; responsibility is split up into &lt;code&gt;agones-controller&lt;/code&gt;, which enacts the Agones control loop, and &lt;code&gt;agones-extensions&lt;/code&gt;, which acts as a service endpoint for webhooks and the allocation extension API. Splitting these responsibilities allows the &lt;code&gt;agones-extensions&lt;/code&gt; pod to be &lt;strong&gt;horizontally scaled&lt;/strong&gt;, making the Agones control plane &lt;strong&gt;highly available&lt;/strong&gt; and more &lt;strong&gt;resiliant to disruption&lt;/strong&gt;.&lt;/p&gt;


&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;GKE Autopilot Clusters&lt;/h4&gt;

    &lt;code&gt;SplitControllerAndExtensions&lt;/code&gt; must be enabled for GKE Autopilot.

&lt;/div&gt;

&lt;h2 id=&#34;extension-pod-configrations&#34;&gt;Extension Pod Configrations&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;agones-extensions&lt;/code&gt; binary has a similar &lt;code&gt;helm&lt;/code&gt; configuration to &lt;code&gt;agones-controller&lt;/code&gt;, see &lt;a href=&#34;/site/site/docs/installation/install-agones/helm/&#34;&gt;here&lt;/a&gt;. If you previously overrode &lt;code&gt;agones.controller.*&lt;/code&gt; settings, you may need to override the same &lt;code&gt;agones.extensions.*&lt;/code&gt; setting.&lt;/p&gt;
&lt;p&gt;To change &lt;code&gt;controller.numWorkers&lt;/code&gt; to 200 from 100 values and through the use of &lt;code&gt;helm --set&lt;/code&gt;, add the follow to the &lt;code&gt;helm&lt;/code&gt; command:&lt;/p&gt;


&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;


    Important: This will not have any effect on any &lt;code&gt;extensions&lt;/code&gt; values!

&lt;/div&gt;

&lt;pre&gt;&lt;code&gt; ...
 --set agones.controller.numWorkers=200
 ...
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;An important configuration to note is the PodDisruptionBudget fields, &lt;code&gt;agones.extensions.pdb.minAvailable&lt;/code&gt; and &lt;code&gt;agones.extensions.pdb.maxUnavailable&lt;/code&gt;. Currently, the &lt;code&gt;agones.extensions.pdb.minAvailable&lt;/code&gt; field is set to 1.&lt;/p&gt;
&lt;h2 id=&#34;deployment-considerations&#34;&gt;Deployment Considerations&lt;/h2&gt;
&lt;p&gt;When &lt;code&gt;SplitControllerAndExtensions&lt;/code&gt; is enabled, what was previously a single &lt;code&gt;agones-controller&lt;/code&gt; pod is deployed as &lt;code&gt;agones-controller&lt;/code&gt; and 2 &lt;code&gt;agones-extensions&lt;/code&gt; pods. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NAME                                 READY   STATUS    RESTARTS   AGE
agones-allocator-78c6b8c79-h9nqc     1/1     Running   0          23h
agones-allocator-78c6b8c79-l2bzp     1/1     Running   0          23h
agones-allocator-78c6b8c79-rw75j     1/1     Running   0          23h
agones-controller-fbf944f4-vs9xx     1/1     Running   0          23h
agones-extensions-5648fc7dcf-hm6lk   1/1     Running   0          23h
agones-extensions-5648fc7dcf-qbc6h   1/1     Running   0          23h
agones-ping-5b9647874-2rrl6          1/1     Running   0          27h
agones-ping-5b9647874-rksgg          1/1     Running   0          27h
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The number of replicas for &lt;code&gt;agones-extensions&lt;/code&gt; can be set using helm variable &lt;a href=&#34;/site/site/docs/installation/install-agones/helm/#configuration&#34;&gt;&lt;code&gt;agones.extensions.replicas&lt;/code&gt;&lt;/a&gt;, but the default is &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We expect the aggregate memory consumption of the pods will be slightly higher than the previous singleton pod, but as the responsibilities are now split across the pods, the aggregate CPU consumption should also be similar.&lt;/p&gt;
&lt;h2 id=&#34;feature-design&#34;&gt;Feature Design&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;SplitControllerAndExtensions&lt;/code&gt; represents phase 1 of &lt;a href=&#34;https://github.com/googleforgames/agones/issues/2797&#34;&gt;HA Agones&lt;/a&gt;. The remaining phases are not yet implemented.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Controlling Disruption</title>
      <link>/site/docs/advanced/controlling-disruption/</link>
      <pubDate>Tue, 24 Jan 2023 20:15:26 +0000</pubDate>
      
      <guid>/site/docs/advanced/controlling-disruption/</guid>
      <description>
        
        
        &lt;h2 id=&#34;disruption-in-kubernetes&#34;&gt;Disruption in Kubernetes&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#voluntary-and-involuntary-disruptions&#34;&gt;A &lt;code&gt;Pod&lt;/code&gt; in Kubernetes may be disrupted&lt;/a&gt; for involuntary reasons, e.g. hardware failure, or voluntary reasons, such as when nodes are drained for upgrades.&lt;/p&gt;
&lt;p&gt;By default, Agones assumes your game server should never be disrupted voluntarily and configures the &lt;code&gt;Pod&lt;/code&gt; appropriately - but this isn&amp;rsquo;t always the ideal setting. Here we discuss how Agones allows you to control the two most significant sources of voluntary &lt;code&gt;Pod&lt;/code&gt; evictions, node upgrades and Cluster Autoscaler, using the &lt;code&gt;eviction&lt;/code&gt; API on the &lt;code&gt;GameServer&lt;/code&gt; object.&lt;/p&gt;

&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
    &lt;h4 class=&#34;alert-heading&#34;&gt;Warning&lt;/h4&gt;
    &lt;p&gt;The &lt;code&gt;eviction&lt;/code&gt; API feature is currently &lt;strong&gt;&lt;a href=&#34;/site/site/docs/guides/feature-stages/#beta&#34;&gt;Beta&lt;/a&gt;&lt;/strong&gt;,
        and while it is enabled by default it may change in the future.&lt;/p&gt;
    &lt;p&gt;Use the Feature Gate &lt;code&gt;SafeToEvict&lt;/code&gt; to disable this feature.&lt;/p&gt;
    &lt;p&gt;See the &lt;a href=&#34;/site/site/docs/guides/feature-stages/#feature-gates&#34;&gt;Feature Gate documentation&lt;/a&gt; for details on how to disable features.&lt;/p&gt;
&lt;/div&gt;

&lt;h2 id=&#34;benefits-of-allowing-voluntary-disruption&#34;&gt;Benefits of Allowing Voluntary Disruption&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s not always easy to write your game server in a way that allows for disruption, but it can have major benefits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compaction of your cluster using &lt;a href=&#34;https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler&#34;&gt;Cluster Autoscaler&lt;/a&gt; can lead to considerable cost savings for your infrastructure.&lt;/li&gt;
&lt;li&gt;Allowing automated node upgrades can save you management toil, and lowers the time it takes to patch security vulnerabilites.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;considerations&#34;&gt;Considerations&lt;/h2&gt;
&lt;p&gt;When discussing game server pod disruption, it&amp;rsquo;s important to keep two factors in mind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;TERM&lt;/code&gt; signal:&lt;/strong&gt; Is your game server tolerant of graceful termination? If you wish to support voluntary disruption, your game server must handle the &lt;code&gt;TERM&lt;/code&gt; signal (even if it runs to completion after receiving &lt;code&gt;TERM&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Termination Grace Period:&lt;/strong&gt; After receiving &lt;code&gt;TERM&lt;/code&gt;, how long does your game server need to run? If you run to completion after receiving &lt;code&gt;TERM&lt;/code&gt;, this is equivalent to the session length - if not, you can think of this as the cleanup time. In general, we bucket the grace period into &amp;ldquo;less than 10 minutes&amp;rdquo;, &amp;ldquo;10 minutes to an hour&amp;rdquo;, and &amp;ldquo;greater than an hour&amp;rdquo;. (See &lt;a href=&#34;#whats-special-about-ten-minutes-and-one-hour&#34;&gt;below&lt;/a&gt; if you are curious about grace period considerations.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;eviction-api&#34;&gt;&lt;code&gt;eviction&lt;/code&gt; API&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;eviction&lt;/code&gt; API is specified as part of the &lt;code&gt;GameServerSpec&lt;/code&gt;, like:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;apiVersion&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;agones.dev/v1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;kind&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;GameServer&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;metadata&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;simple-game-server&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;eviction&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;safe&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;Always&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;template&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;...]&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can set &lt;code&gt;eviction.safe&lt;/code&gt; based on your game server&amp;rsquo;s tolerance for disruption and session length, based on the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../diagrams/eviction-decision.dot.png&#34; alt=&#34;Eviction Decision Diagram&#34;&gt;&lt;/p&gt;
&lt;p&gt;In words:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Does the game server support &lt;code&gt;TERM&lt;/code&gt; and terminate within ten minutes?
&lt;ul&gt;
&lt;li&gt;Yes to both: Set &lt;code&gt;safe: Always&lt;/code&gt;, and set &lt;a href=&#34;https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution&#34;&gt;terminationGracePeriodSeconds&lt;/a&gt; to the session length or cleanup time.&lt;/li&gt;
&lt;li&gt;No to either: Does the game server support &lt;code&gt;TERM&lt;/code&gt; and terminate within an hour?
&lt;ul&gt;
&lt;li&gt;Yes to both: Set &lt;code&gt;safe: OnUpgrade&lt;/code&gt;, and configure &lt;a href=&#34;https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution&#34;&gt;terminationGracePeriodSeconds&lt;/a&gt; to the session length or cleanup time.&lt;/li&gt;
&lt;li&gt;No to either: Set &lt;code&gt;safe: Never&lt;/code&gt;. If your game server does not terminate within an hour, see &lt;a href=&#34;#considerations-for-long-sessions&#34;&gt;below&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;alert alert-info&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Note&lt;/h4&gt;

    To maintain backward compatibility with Agones prior to the introduction of the &lt;code&gt;SafeToEvict&lt;/code&gt; feature gate, if your game server previously configured the &lt;code&gt;cluster-autoscaler.kubernetes.io/safe-to-evict: true&lt;/code&gt; annotation, we assume &lt;code&gt;eviction.safe: Always&lt;/code&gt; is intended.

&lt;/div&gt;



&lt;div class=&#34;alert alert-info&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Note&lt;/h4&gt;

    GKE Autopilot supports only &lt;code&gt;Never&lt;/code&gt; and &lt;code&gt;Always&lt;/code&gt;, not &lt;code&gt;OnUpgrade&lt;/code&gt;.

&lt;/div&gt;

&lt;h2 id=&#34;whats-special-about-ten-minutes-and-one-hour&#34;&gt;What&amp;rsquo;s special about ten minutes and one hour?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Ten minutes:&lt;/strong&gt; Cluster Autoscaler respects &lt;a href=&#34;https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#does-ca-respect-gracefultermination-in-scale-down&#34;&gt;ten minutes of graceful termination&lt;/a&gt; on scale-down. On some cloud products, you can configure &lt;code&gt;--max-graceful-termination-sec&lt;/code&gt; to change this, but it is not advised: Cluster Autoscaler is currently only capable of scaling down one node at a time, and larger graceful termination windows slow this down farther (see &lt;a href=&#34;https://github.com/kubernetes/autoscaler/issues/5079&#34;&gt;autoscaler#5079&lt;/a&gt;). If the ten minute limit does not apply to you, generally you should choose between &lt;code&gt;safe: Always&lt;/code&gt; (for sessions less than an hour), or see &lt;a href=&#34;#considerations-for-long-sessions&#34;&gt;below&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;One hour:&lt;/strong&gt; On many cloud products, &lt;code&gt;PodDisruptionBudget&lt;/code&gt; can only block node upgrade evictions for a certain period of time - on GKE this is 1h. After that, the PDB is ignored, or the node upgrade fails with an error. Controlling &lt;code&gt;Pod&lt;/code&gt; disruption for longer than one hour requires cluster configuration changes outside of Agones - see &lt;a href=&#34;#considerations-for-long-sessions&#34;&gt;below&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;considerations-for-long-sessions&#34;&gt;Considerations for long sessions&lt;/h2&gt;
&lt;p&gt;Outside of Cluster Autoscaler, the main source of disruption for long sessions is node upgrade. On some cloud products, such as GKE Standard, node upgrades are entirely within your control. On others, such as GKE Autopilot, node upgrade is automatic. Typical node upgrades use an eviction based, rolling recreate strategy, and may not honor &lt;code&gt;PodDisruptionBudget&lt;/code&gt; for longer than an hour. Here we document strategies you can use for your cloud product to support long sessions.&lt;/p&gt;
&lt;h3 id=&#34;on-gke&#34;&gt;On GKE&lt;/h3&gt;
&lt;p&gt;On GKE, there are currently two possible approaches to manage disruption for session lengths longer than an hour:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;(GKE Standard/Autopilot) &lt;a href=&#34;https://martinfowler.com/bliki/BlueGreenDeployment.html&#34;&gt;Blue/green deployment&lt;/a&gt; at the cluster level: If you are using an automated deployment process, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create a new, &lt;code&gt;green&lt;/code&gt; cluster within a release channel e.g. every week,&lt;/li&gt;
&lt;li&gt;use &lt;a href=&#34;https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#exclusions&#34;&gt;maintenance exclusions&lt;/a&gt; to prevent node upgrades for 30d, and&lt;/li&gt;
&lt;li&gt;scale the &lt;code&gt;Fleet&lt;/code&gt; on the old, &lt;code&gt;blue&lt;/code&gt; cluster down to 0, and&lt;/li&gt;
&lt;li&gt;use &lt;a href=&#34;/site/site/docs/advanced/multi-cluster-allocation/&#34;&gt;multi-cluster allocation&lt;/a&gt; on Agones, which will then direct new allocations to the new &lt;code&gt;green&lt;/code&gt; cluster (since &lt;code&gt;blue&lt;/code&gt; has 0 desired), then&lt;/li&gt;
&lt;li&gt;delete the old, &lt;code&gt;blue&lt;/code&gt; cluster when the &lt;code&gt;Fleet&lt;/code&gt; successfully scales down.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(GKE Standard only) Use &lt;a href=&#34;https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies#blue-green-upgrade-strategy&#34;&gt;node pool blue/green upgrades&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;other-cloud-products&#34;&gt;Other cloud products&lt;/h3&gt;
&lt;p&gt;The blue/green cluster strategy described for GKE is likely applicable to your cloud product.&lt;/p&gt;
&lt;p&gt;We welcome contributions to this section for other products!&lt;/p&gt;
&lt;h2 id=&#34;implementation--under-the-hood&#34;&gt;Implementation / Under the hood&lt;/h2&gt;
&lt;p&gt;Each option uses a slightly different permutation of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the &lt;code&gt;safe-to-evict&lt;/code&gt; annotation to block &lt;a href=&#34;https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node&#34;&gt;Cluster Autoscaler based eviction&lt;/a&gt;, and&lt;/li&gt;
&lt;li&gt;the &lt;code&gt;agones.dev/safe-to-evict&lt;/code&gt; label selector to select the &lt;code&gt;agones-gameserver-safe-to-evict-false&lt;/code&gt; &lt;code&gt;PodDisruptionBudget&lt;/code&gt;. This blocks &lt;a href=&#34;https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node&#34;&gt;Cluster Autoscaler&lt;/a&gt; and (for a limited time) &lt;a href=&#34;https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets&#34;&gt;disruption from node upgrades&lt;/a&gt;.
&lt;ul&gt;
&lt;li&gt;Note that PDBs do influence pod preemption as well, but it&amp;rsquo;s not guaranteed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As a quick reference:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;evictions.safe setting&lt;/th&gt;
&lt;th&gt;&lt;code&gt;safe-to-evict&lt;/code&gt; pod annotation&lt;/th&gt;
&lt;th&gt;&lt;code&gt;agones.dev/safe-to-evict&lt;/code&gt; label&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Never&lt;/code&gt; (default)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt; (matches PDB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;OnUpdate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt; (does not match PDB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Always&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt; (does not match PDB)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&#34;further-reading&#34;&gt;Further Reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/googleforgames/agones/issues/2794&#34;&gt;&lt;code&gt;eviction&lt;/code&gt; design&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Limiting CPU &amp; Memory</title>
      <link>/site/docs/advanced/limiting-resources/</link>
      <pubDate>Thu, 03 Jan 2019 05:45:15 +0000</pubDate>
      
      <guid>/site/docs/advanced/limiting-resources/</guid>
      <description>
        
        
        &lt;p&gt;As a short description:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CPU &lt;code&gt;Requests&lt;/code&gt; are limits that are applied when there is CPU congestion, and as such can burst above their set limits.&lt;/li&gt;
&lt;li&gt;CPU &lt;code&gt;Limits&lt;/code&gt; are hard limits on how much CPU time the particular container gets access to.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is useful for game servers, not just as a mechanism to distribute compute resources evenly, but also as a way
to advice the Kubernetes scheduler how many game server processes it is able to fit into a given node in the cluster.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s worth reading the &lt;a href=&#34;https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/&#34;&gt;Managing Compute Resources for Containers&lt;/a&gt;
Kubernetes documentation for more details on &amp;ldquo;requests&amp;rdquo; and &amp;ldquo;limits&amp;rdquo; to both CPU and Memory, and how to configure them.&lt;/p&gt;
&lt;h2 id=&#34;gameservers&#34;&gt;GameServers&lt;/h2&gt;
&lt;p&gt;Since the &lt;code&gt;GameServer&lt;/code&gt; specification provides a full &lt;a href=&#34;https://v1-24.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#podtemplatespec-v1-core&#34;&gt;&lt;code&gt;PodSpecTemplate&lt;/code&gt;&lt;/a&gt;,
we can take advantage of both resource limits and requests in our &lt;code&gt;GameServer&lt;/code&gt; configurations.&lt;/p&gt;
&lt;p&gt;For example, to set a CPU limit on our &lt;code&gt;GameServer&lt;/code&gt; configuration of &lt;code&gt;250m/0.25&lt;/code&gt; of a CPU,
we could do so as followed:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;apiVersion&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;agones.dev/v1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;kind&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;GameServer&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;metadata&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;simple-game-server&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;ports&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;default&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containerPort&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;7654&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;template&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containers&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;simple-game-server&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;image&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;us-docker.pkg.dev/agones-images/examples/simple-game-server:0.15&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;resources&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;          &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;limits&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;cpu&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;250m&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#this is our limit here&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you do not set a limit or request, the default is set by Kubernetes at a 100m CPU request.&lt;/p&gt;
&lt;h2 id=&#34;sdk-gameserver-sidecar&#34;&gt;SDK GameServer sidecar&lt;/h2&gt;
&lt;p&gt;You may also want to tweak the CPU request or limits on the SDK &lt;code&gt;GameServer&lt;/code&gt; sidecar process that spins up alongside
each game server container.&lt;/p&gt;
&lt;p&gt;You can do this through the &lt;a href=&#34;/site/site/docs/installation/install-agones/helm/&#34;&gt;Helm configuration&lt;/a&gt; when installing Agones.&lt;/p&gt;
&lt;p&gt;By default, this is set to having a CPU request value of 30m, with no hard CPU limit. This ensures that the sidecar always has enough CPU
to function, but it is configurable in case a lower, or higher value is required on your clusters, or if you desire
hard limit.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Allocator Service</title>
      <link>/site/docs/advanced/allocator-service/</link>
      <pubDate>Tue, 19 May 2020 05:45:05 +0000</pubDate>
      
      <guid>/site/docs/advanced/allocator-service/</guid>
      <description>
        
        
        &lt;p&gt;To allocate a game server, Agones provides a gRPC and REST service with mTLS authentication, called &lt;code&gt;agones-allocator&lt;/code&gt; that can be used instead of 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/pkg/apis/allocation/v1/gameserverallocation.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;GameServerAllocations&lt;/a&gt;
.&lt;/p&gt;
&lt;p&gt;Both gRPC and REST are accessible through a Kubernetes service that can be externalized using a load balancer. By default, gRPC and REST are served from the same port. However, either service can be disabled or the services can be served from separate ports using the &lt;a href=&#34;/site/site/docs/installation/install-agones/helm/&#34;&gt;helm configuration&lt;/a&gt;.&lt;/p&gt;


&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Warning&lt;/h4&gt;

    &lt;p&gt;If gRPC and REST are served using the same port, then an http multi-plexer is used along with an &lt;a href=&#34;https://github.com/grpc/grpc-go/blob/2608e38e6386be7400720fecf2ece176c4cbc1b2/server.go#L933-L960&#34;&gt;experimental gRPC server&lt;/a&gt; which has &lt;a href=&#34;https://github.com/grpc/grpc-go/issues/586#issuecomment-286257439&#34;&gt;noticeably worse performance&lt;/a&gt; than using the standard gRPC server.&lt;/p&gt;
&lt;p&gt;If you require a fully compatible or feature compatible gRPC server implementation, you must separate the gRPC port from the REST port or disable the REST service.&lt;/p&gt;


&lt;/div&gt;

&lt;p&gt;For requests to either service to succeed, a client certificate must be provided that is in the authorization list of the allocator service.
The remainder of this article describes how to manually make a successful allocation request using the API.&lt;/p&gt;
&lt;p&gt;The guide assumes you have command line tools installed for &lt;a href=&#34;https://stedolan.github.io/jq/&#34;&gt;jq&lt;/a&gt;, &lt;a href=&#34;https://golang.org/&#34;&gt;go&lt;/a&gt; and &lt;a href=&#34;https://www.openssl.org/&#34;&gt;openssl&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;gameserverallocation-vs-allocator-service&#34;&gt;&lt;code&gt;GameServerAllocation&lt;/code&gt; vs Allocator Service&lt;/h2&gt;
&lt;p&gt;There are several reasons you may prefer to use the Allocator Service over the &lt;code&gt;GameServerAllocation&lt;/code&gt; custom resource
definition, depending on your architecture and requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A requirement to do &lt;a href=&#34;/site/site/docs/advanced/multi-cluster-allocation/&#34;&gt;multi-cluster allocation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Want to create Allocations from outside the Agones Kubernetes cluster.&lt;/li&gt;
&lt;li&gt;Prefer SSL based authentication over Kubernetes &lt;a href=&#34;https://kubernetes.io/docs/reference/access-authn-authz/rbac/&#34;&gt;RBAC&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Prefer a &lt;a href=&#34;https://grpc.github.io/&#34;&gt;gRPC&lt;/a&gt; or REST based API over an integration with the
&lt;a href=&#34;/site/site/docs/guides/access-api/&#34;&gt;Kubernetes API&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;find-the-external-ip&#34;&gt;Find the external IP&lt;/h2&gt;
&lt;p&gt;The service is hosted under the same namespace as the Agones controller. To find the external IP of your allocator service, replace agones-system namespace with the namespace to which Agones is deployed and execute the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;kubectl get service agones-allocator -n agones-system
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The output of the command should look like:&lt;/p&gt;
&lt;pre&gt;
NAME                        TYPE           CLUSTER-IP      &lt;b&gt;EXTERNAL-IP&lt;/b&gt;     PORT(S)            AGE
agones-allocator            LoadBalancer   10.55.251.73    &lt;b&gt;34.82.195.204&lt;/b&gt;   443:30250/TCP      7d22h
&lt;/pre&gt;
&lt;h2 id=&#34;server-tls-certificate&#34;&gt;Server TLS certificate&lt;/h2&gt;
&lt;p&gt;If the &lt;code&gt;agones-allocator&lt;/code&gt; service is installed as a &lt;code&gt;LoadBalancer&lt;/code&gt; &lt;a href=&#34;/site/site/docs/installation/install-agones/helm/#reserved-allocator-load-balancer-ip&#34;&gt;using a reserved IP&lt;/a&gt;, a valid self-signed server TLS certificate is generated using the IP provided. Otherwise, the server TLS certificate should be replaced. If you installed Agones using &lt;a href=&#34;/site/site/docs/installation/install-agones/helm/&#34;&gt;helm&lt;/a&gt;, you can easily reconfigure the allocator service with a preset IP address by setting the &lt;code&gt;agones.allocator.service.loadBalancerIP&lt;/code&gt; parameter to the address that was automatically assigned to the service and &lt;code&gt;helm upgrade&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;kubectl get services agones-allocator -n agones-system -o &lt;span style=&#34;color:#000&#34;&gt;jsonpath&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{.status.loadBalancer.ingress[0].ip}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;
helm upgrade my-release agones/agones -n agones-system --wait &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;   --set agones.allocator.service.loadBalancerIP&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;   ...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Warning&lt;/h4&gt;

    The parameter used to automatically
replace the certifate changed in Agones 1.18.0. If you are using an older
version of Agones you should pass the parameter
&lt;code&gt;agones.allocator.http.loadBalancerIP&lt;/code&gt; instead. If you need your script to work
with both older and newer versions of Agones, you can pass both parameters as
only one of them will effect the helm chart templates.

&lt;/div&gt;

&lt;p&gt;Another approach is to replace the default server TLS certificate with a certificate with CN and subjectAltName. There are multiple approaches to generate a certificate. Agones recommends using &lt;a href=&#34;https://cert-manager.io/&#34;&gt;cert-manager.io&lt;/a&gt; solution for cluster level certificate management.&lt;/p&gt;
&lt;p&gt;In order to use the cert-manager solution, first &lt;a href=&#34;https://cert-manager.io/docs/installation/kubernetes/&#34;&gt;install cert-manager&lt;/a&gt; on the cluster.
Then, &lt;a href=&#34;https://cert-manager.io/docs/configuration/&#34;&gt;configure&lt;/a&gt; an &lt;code&gt;Issuer&lt;/code&gt;/&lt;code&gt;ClusterIssuer&lt;/code&gt; resource and
last &lt;a href=&#34;https://cert-manager.io/docs/usage/certificate/&#34;&gt;configure&lt;/a&gt; a &lt;code&gt;Certificate&lt;/code&gt; resource to manage allocator-tls &lt;code&gt;Secret&lt;/code&gt;.
Make sure to configure the &lt;code&gt;Certificate&lt;/code&gt; based on your system&amp;rsquo;s requirements, including the validity &lt;code&gt;duration&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here is an example of using a self-signed &lt;code&gt;ClusterIssuer&lt;/code&gt; for configuring allocator-tls &lt;code&gt;Secret&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# Create a self-signed ClusterIssuer&lt;/span&gt;
cat &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;lt;&amp;lt;EOF | kubectl apply -f -
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;apiVersion: cert-manager.io/v1
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;kind: ClusterIssuer
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;metadata:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  name: selfsigned
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;spec:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  selfSigned: {}
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;EOF&lt;/span&gt;

&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;kubectl get services agones-allocator -n agones-system -o &lt;span style=&#34;color:#000&#34;&gt;jsonpath&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{.status.loadBalancer.ingress[0].ip}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# for EKS use hostname&lt;/span&gt;
&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# HOST_NAME=$(kubectl get services agones-allocator -n agones-system -o jsonpath=&amp;#39;{.status.loadBalancer.ingress[0].hostname}&amp;#39;)&lt;/span&gt;

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# Create a Certificate with IP for the allocator-tls secret&lt;/span&gt;
cat &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;lt;&amp;lt;EOF | kubectl apply -f -
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;apiVersion: cert-manager.io/v1
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;kind: Certificate
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;metadata:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  name: allocator-tls
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  namespace: agones-system
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;spec:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  commonName: ${EXTERNAL_IP}
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  ipAddresses:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    - ${EXTERNAL_IP}
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  secretName: allocator-tls
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  issuerRef:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    name: selfsigned
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    kind: ClusterIssuer
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;EOF&lt;/span&gt;

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# Wait for the allocator-tls Secret&lt;/span&gt;
sleep &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt;
&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_VALUE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;kubectl get secret allocator-tls -n agones-system -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{.data.ca\.crt}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# Add ca.crt to the allocator-tls-ca Secret&lt;/span&gt;
kubectl get secret allocator-tls-ca -o json -n agones-system &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; jq &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;.data[&amp;#34;tls-ca.crt&amp;#34;]=&amp;#34;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_VALUE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;&amp;#34;&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; kubectl apply -f -
&lt;span style=&#34;color:#204a87&#34;&gt;echo&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;$TLS_CA_VALUE&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; ca.crt
&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# In case of MacOS&lt;/span&gt;
&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# echo $TLS_CA_VALUE | base64 -D &amp;gt; ca.crt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;bring-your-own-certificates-advanced&#34;&gt;Bring Your Own Certificates (advanced)&lt;/h3&gt;
&lt;p&gt;If you would like to completely manage the tls secrets outside of helm, you can create them in the namespace where agones is going to be installed, and then set the helm value &lt;code&gt;agones.allocator.disableSecretCreation&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;. This method will also work with the cert-manager method, as long as your certificate and secret are created ahead of time, and you populate the &lt;code&gt;allocator-tls-ca&lt;/code&gt; and &lt;code&gt;allocator-client-ca&lt;/code&gt; yourself.&lt;/p&gt;
&lt;h2 id=&#34;client-certificate&#34;&gt;Client Certificate&lt;/h2&gt;
&lt;p&gt;Because agones-allocator uses an mTLS authentication mechanism, a client must provide a certificate that is accepted by the server.&lt;/p&gt;
&lt;p&gt;If Agones is installed using Helm, you can leverage a default client secret, &lt;code&gt;allocator-client.default&lt;/code&gt;, created in the game server namespace and allowlisted in &lt;code&gt;allocator-client-ca&lt;/code&gt; Kubernetes secret. You can extract and use that secret for client side authentication, by following &lt;a href=&#34;#send-allocation-request&#34;&gt;the allocation example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Otherwise, here is an example of generating a client certificate using openssl.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;kubectl get services agones-allocator -n agones-system -o &lt;span style=&#34;color:#000&#34;&gt;jsonpath&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{.status.loadBalancer.ingress[0].ip}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;

openssl req -x509 -nodes -days &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;365&lt;/span&gt; -newkey rsa:2048 -keyout client.key -out client.crt -addext &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;subjectAltName=IP:&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;

&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE_VALUE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;cat client.crt &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -w 0&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# In case of MacOS&lt;/span&gt;
&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# CERT_FILE_VALUE=$(cat client.crt | base64)&lt;/span&gt;

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# allowlist client certificate&lt;/span&gt;
kubectl get secret allocator-client-ca -o json -n agones-system &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; jq &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;.data[&amp;#34;client_trial.crt&amp;#34;]=&amp;#34;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE_VALUE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;&amp;#34;&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; kubectl apply -f -
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last command creates a new entry in the secret data map for &lt;code&gt;allocator-client-ca&lt;/code&gt; for the client CA. This is for the &lt;code&gt;agones-allocator&lt;/code&gt; service to accept the newly generated client certificate.&lt;/p&gt;
&lt;h2 id=&#34;send-allocation-request&#34;&gt;Send allocation request&lt;/h2&gt;
&lt;p&gt;After setting up &lt;code&gt;agones-allocator&lt;/code&gt; with server certificate and allowlisting the client certificate, the service can be used to allocate game servers. Make sure you have a &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/&#34;&gt;fleet&lt;/a&gt; with ready game servers in the game server namespace.&lt;/p&gt;
&lt;p&gt;Set the environment variables and store the client secrets before allocating using gRPC or REST APIs:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;default &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# replace with any namespace&lt;/span&gt;
&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;kubectl get services agones-allocator -n agones-system -o &lt;span style=&#34;color:#000&#34;&gt;jsonpath&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{.status.loadBalancer.ingress[0].ip}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;client.key
&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;client.crt
&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;ca.crt

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# allocator-client.default secret is created only when using helm installation. Otherwise generate the client certificate and replace the following.&lt;/span&gt;
&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# In case of MacOS replace &amp;#34;base64 -d&amp;#34; with &amp;#34;base64 -D&amp;#34;&lt;/span&gt;
kubectl get secret allocator-client.default -n &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt; -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;{.data.tls\.crt}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;
kubectl get secret allocator-client.default -n &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt; -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;{.data.tls\.key}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;
kubectl get secret allocator-tls-ca -n agones-system -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;{.data.tls-ca\.crt}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;using-grpc&#34;&gt;Using gRPC&lt;/h3&gt;
&lt;p&gt;To start, take a look at the allocation gRPC client examples in 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/examples/allocator-client/main.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;golang&lt;/a&gt;
 and 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/examples/allocator-client-csharp/Program.cs&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;C#&lt;/a&gt;
 languages. In the following, the 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/examples/allocator-client/main.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;golang gRPC client example&lt;/a&gt;
 is used to allocate a Game Server in the &lt;code&gt;default&lt;/code&gt; namespace.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
go run examples/allocator-client/main.go --ip &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --port &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --namespace &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --key &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --cert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --cacert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;using-rest&#34;&gt;Using REST&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
curl --key &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     --cert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     --cacert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     -H &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Content-Type: application/json&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     --data &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{&amp;#34;namespace&amp;#34;:&amp;#34;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;&amp;#34;}&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     https://&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;/gameserverallocation &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     -X POST

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should expect to see the following output:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;{&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;&amp;#34;gameServerName&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;game-server-name&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;&amp;#34;ports&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:[{&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;default&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;&amp;#34;port&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;7463&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}],&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;&amp;#34;address&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;1.2.3.4&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;&amp;#34;nodeName&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;node-name&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;sending-data-to-the-game-server&#34;&gt;Sending Data to the Game Server&lt;/h3&gt;
&lt;p&gt;The service accepts a &lt;code&gt;metadata&lt;/code&gt; field, which can be used to apply &lt;code&gt;labels&lt;/code&gt; and &lt;code&gt;annotations&lt;/code&gt; to the allocated &lt;code&gt;GameServer&lt;/code&gt;. The old &lt;code&gt;metaPatch&lt;/code&gt; fields is now deprecated, but can still be used for compatibility. If both &lt;code&gt;metadata&lt;/code&gt; and &lt;code&gt;metaPatch&lt;/code&gt; fields are set, &lt;code&gt;metaPatch&lt;/code&gt; is ignored.&lt;/p&gt;
&lt;h2 id=&#34;secrets-explained&#34;&gt;Secrets Explained&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;agones-allocator&lt;/code&gt; has a dependency on three Kubernetes secrets:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;allocator-tls&lt;/code&gt; - stores the server certificate.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;allocator-client-ca&lt;/code&gt; - stores the allocation authorized client CA for mTLS to allowlist client certificates.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;allocator-tls-ca&lt;/code&gt; (optional) - stores &lt;code&gt;allocator-tls&lt;/code&gt; CA.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The separation of CA secret from the private secret is for the security reason to avoid reading the private secret, while retrieving the allocator CA that is used by the allocation client to validate the server. It is optional to set or maintain the &lt;code&gt;allocator-tls-ca&lt;/code&gt; secret.&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If you encounter problems, explore the following potential root causes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Check server certificate - Using openssl you can get the certificate chain for the server.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;kubectl get services agones-allocator -n agones-system -o &lt;span style=&#34;color:#000&#34;&gt;jsonpath&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{.status.loadBalancer.ingress[0].ip}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;
openssl s_client -connect &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;:443
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Inspect the server certificate by storing the certificate returned, under &lt;code&gt;Server certificate&lt;/code&gt; and validating using &lt;code&gt;openssl x509 -in tls.crt -text -noout&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Make sure the certificate is not expired and the Subject Alternative Name is set.&lt;/li&gt;
&lt;li&gt;If the issuer is &lt;code&gt;CN = allocation-ca&lt;/code&gt;, the certificate is generated using Agones helm installation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check client certificate&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You may get an error such as &lt;code&gt;rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection closed&lt;/code&gt;, make sure your client certificate is allowlisted by being added to &lt;code&gt;allocator-client-ca&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;kubectl get secret allocator-client-ca -o json -n agones-system
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;If the server certificate is not accepted by the client, you may get an error such as &lt;code&gt;rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = &amp;quot;transport: authentication handshake failed: x509: certificate signed by unknown authority&amp;quot;&lt;/code&gt;, depending on the client. In this case, verify that the TLS CA file matches the server certificate.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;kubectl get secret allocator-tls -n agones-system -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;{.data.tls\.crt}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; tls.crt
openssl verify -verbose -CAfile ca.crt tls.crt
tls.crt: OK
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make sure the service is up and running.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;kubectl get pod -n agones-system &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; grep agones-allocator
agones-allocator-59b4f6b5c6-86j62      1/1     Running     &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;          6m36s
agones-allocator-59b4f6b5c6-kbqrq      1/1     Running     &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;          6m45s
agones-allocator-59b4f6b5c6-trbkl      1/1     Running     &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;          6m28s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;kubectl get service agones-allocator -n agones-system
agones-allocator   LoadBalancer   10.55.248.14   34.82.195.204    443:32468/TCP   6d23h
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;api-reference&#34;&gt;API Reference&lt;/h2&gt;
&lt;p&gt;The AllocationService API is located as a gRPC service 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/proto/allocation/allocation.proto&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;here&lt;/a&gt;
. Additionally, the REST API is available as a 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/pkg/allocation/go/allocation.swagger.json&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;Swagger API&lt;/a&gt;
.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Multi-cluster Allocation</title>
      <link>/site/docs/advanced/multi-cluster-allocation/</link>
      <pubDate>Fri, 25 Oct 2019 05:45:05 +0000</pubDate>
      
      <guid>/site/docs/advanced/multi-cluster-allocation/</guid>
      <description>
        
        
        &lt;p&gt;There may be different types of clusters, such as on-premise, and Google Kubernetes Engine (GKE), used by a game to help with the cost-saving and availability.
For this purpose, Agones provides a mechanism to define priorities on the clusters. Priorities are defined on 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/pkg/apis/multicluster/v1/gameserverallocationpolicy.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;GameServerAllocationPolicy&lt;/a&gt;
 agones CRD. A matchmaker can enable the multi-cluster rules on a request and target &lt;a href=&#34;/site/site/docs/advanced/allocator-service/&#34;&gt;agones-allocator&lt;/a&gt; endpoint in any of the clusters and get resources allocated on the cluster with the highest priority. If the cluster with the highest priority is overloaded, the allocation request is redirected to the cluster with the next highest priority.&lt;/p&gt;
&lt;p&gt;The remainder of this article describes how to enable multi-cluster allocation.&lt;/p&gt;
&lt;h2 id=&#34;define-cluster-priority&#34;&gt;Define Cluster Priority&lt;/h2&gt;
&lt;p&gt;
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/pkg/apis/multicluster/v1/gameserverallocationpolicy.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;GameServerAllocationPolicy&lt;/a&gt;
 is the CRD defined by Agones for setting multi-cluster allocation rules. In addition to cluster priority, it describes the connection information for the target cluster, including the game server namespace, agones-allocator endpoint and client K8s secrets name for redirecting the allocation request. Game servers will be allocated from clusters with the lowest &lt;code&gt;priority&lt;/code&gt; number. If there are no available game servers available in clusters with the lowest &lt;code&gt;priority&lt;/code&gt; number, they will be allocated from clusters with the next lowest &lt;code&gt;priority&lt;/code&gt; number. For clusters with the same priority, the cluster is chosen with a probability relative to its weight.&lt;/p&gt;
&lt;p&gt;Here is an example of setting the priority for a cluster and it&amp;rsquo;s connection rules. One such resource should be defined per cluster.&lt;/p&gt;
&lt;p&gt;In the following example the policy is defined for cluster B in cluster A.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;cat &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;lt;&amp;lt;EOF | kubectl apply -f -
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;apiVersion: multicluster.agones.dev/v1
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;kind: GameServerAllocationPolicy
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;metadata:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  name: allocator-cluster-b
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  namespace: cluster-a-ns
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;spec:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  connectionInfo:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    allocationEndpoints:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    - 34.82.195.204
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    clusterName: &amp;#34;clusterB&amp;#34;
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    namespace: cluster-b-ns
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    secretName: allocator-client-to-cluster-b
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;    serverCa: c2VydmVyQ0E=
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  priority: 1
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  weight: 100
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To define the local cluster priority a GameServerAllocationPolicy should be defined &lt;em&gt;without&lt;/em&gt; an &lt;code&gt;allocationEndpoints&lt;/code&gt; field. If the local cluster priority is not defined, the allocation from the local cluster happens only if allocation from other clusters with the existing allocation rules is unsuccessful.&lt;/p&gt;
&lt;p&gt;Allocation requests with multi-cluster allocation enabled but with only the local cluster available (e.g. in development) &lt;em&gt;must&lt;/em&gt; have a local cluster priority defined, or the request fails with the error &amp;ldquo;no multi-cluster allocation policy is specified&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;namespace&lt;/code&gt; field in &lt;code&gt;connectionInfo&lt;/code&gt; is the namespace that the game servers will be allocated in, and must be a namespace in the target cluster that has been previously defined as allowed to host game servers. The &lt;code&gt;Namespace&lt;/code&gt; specified in the allocation request (below) is used to refer to the namespace that the GameServerAllocationPolicy itself is located in.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;serverCa&lt;/code&gt; is the server TLS CA public certificate, set only if the remote server certificate is not signed by a public CA (e.g. self-signed). If this field is not specified, the certificate can also be specified in a field named &lt;code&gt;ca.crt&lt;/code&gt; of the client secret (the secret referred to in the &lt;code&gt;secretName&lt;/code&gt; field).&lt;/p&gt;
&lt;h2 id=&#34;establish-trust&#34;&gt;Establish trust&lt;/h2&gt;
&lt;p&gt;To accept allocation requests from other clusters, agones-allocator for cluster B should be configured to accept the client&amp;rsquo;s certificate from cluster A and the cluster A&amp;rsquo;s client should be configured to accept the server TLS certificate, if it is not signed by a public Certificate Authority (CA).&lt;/p&gt;
&lt;p&gt;Follow the steps to configure the &lt;a href=&#34;/site/site/docs/advanced/allocator-service/&#34;&gt;agones allocator gRPC service&lt;/a&gt;. The client certificate pair in the mentioned document is stored as a K8s secret. Here are the secrets to set:&lt;/p&gt;
&lt;p&gt;1.Client certificate to talk to other clusters:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;cat &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;lt;&amp;lt;EOF | kubectl apply -f -
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;apiVersion: v1
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;kind: Secret
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;metadata:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  name: allocator-client-to-cluster-b
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  namespace: cluster-a-ns
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;type: Opaque
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;data:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  tls.crt: &amp;lt;REDACTED&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  tls.key: &amp;lt;REDACTED&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  ca.crt: &amp;lt;REDACTED&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The certificates are base 64 string of the certificate file e.g. &lt;code&gt;cat ${CERT_FILE} | base64 -w 0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Agones recommends using &lt;a href=&#34;https://cert-manager.io/&#34;&gt;cert-manager.io&lt;/a&gt; solution for generating client certificates.&lt;/p&gt;
&lt;p&gt;2.Add client CA to the list of authorized client certificates by agones-allocator in the targeted cluster.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;cat &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;lt;&amp;lt;EOF | kubectl apply -f -
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;apiVersion: v1
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;kind: Secret
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;metadata:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  name: allocator-client-ca
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  namespace: agones-system
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;type: Opaque
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;data:
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  client1.crt: &amp;lt;REDACTED&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  client2.crt: &amp;lt;REDACTED&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  …
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;  clientN.crt: &amp;lt;REDACTED&amp;gt;
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;EOF&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;allocate-multi-cluster&#34;&gt;Allocate multi-cluster&lt;/h2&gt;
&lt;p&gt;To enable multi-cluster allocation, set &lt;code&gt;multiClusterSetting.enabled&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/proto/allocation/allocation.proto&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;allocation.proto&lt;/a&gt;
 and send allocation requests. For more information visit &lt;a href=&#34;/site/site/docs/advanced/allocator-service/&#34;&gt;agones-allocator&lt;/a&gt;. In the following, using 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/examples/allocator-client/main.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;allocator-client sample&lt;/a&gt;
, a multi-cluster allocation request is sent to the agones-allocator service. If the allocation succeeds, the AllocationResponse will contain a 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.30.0/proto/allocation/allocation.proto&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;Source&lt;/a&gt;
 field which indicates the endpoint of the remote agones-allocator.&lt;/p&gt;
&lt;p&gt;Set the environment variables and store the client secrets before allocating using gRPC or REST APIs&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;default &lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# replace with any namespace&lt;/span&gt;
&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;$(&lt;/span&gt;kubectl get services agones-allocator -n agones-system -o &lt;span style=&#34;color:#000&#34;&gt;jsonpath&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{.status.loadBalancer.ingress[0].ip}&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;client.key
&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;client.crt
&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;ca.crt

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# allocator-client.default secret is created only when using helm installation. Otherwise generate the client certificate and replace the following.&lt;/span&gt;
&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# In case of MacOS replace &amp;#34;base64 -d&amp;#34; with &amp;#34;base64 -D&amp;#34;&lt;/span&gt;
kubectl get secret allocator-client.default -n &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt; -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;{.data.tls\.crt}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;
kubectl get secret allocator-client.default -n &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt; -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;{.data.tls\.key}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;
kubectl get secret allocator-tls-ca -n agones-system -ojsonpath&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;{.data.tls-ca\.crt}&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
go run examples/allocator-client/main.go --ip &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --namespace &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --key &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --cert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --cacert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --multicluster &lt;span style=&#34;color:#204a87&#34;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If using REST use&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
curl --key &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     --cert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     --cacert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     -H &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Content-Type: application/json&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     --data &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{&amp;#34;namespace&amp;#34;:&amp;#34;&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;&amp;#34;, &amp;#34;multiClusterSetting&amp;#34;:{&amp;#34;enabled&amp;#34;:true}}&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     https://&lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;/gameserverallocation &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;     -X POST
     
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;If you encounter problems, explore the following potential root causes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Make sure single cluster allocation works for each cluster using &lt;a href=&#34;/site/site/docs/advanced/allocator-service/#troubleshooting&#34;&gt;this troubleshooting&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For each cluster, make sure there is a &lt;code&gt;GameServerAllocationPolicy&lt;/code&gt; resource defined in the game server cluster.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Inspect the &lt;code&gt;.spec.connectionInfo&lt;/code&gt; for &lt;code&gt;GameServerAllocationPolicy&lt;/code&gt; for each cluster. Use the cluster connection information in that field to verify that single cluster allocation works. Use the information to verify the connection:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&#34;language-none&#34; data-lang=&#34;none&#34;&gt;POLICY_NAME=&amp;lt;policy-name&amp;gt;
POLICY_NAMESPACE=&amp;lt;policy-namespace&amp;gt;

NAMESPACE=$(kubectl get gameserverallocationpolicy ${POLICY_NAME} -n ${POLICY_NAMESPACE} -ojsonpath={.spec.connectionInfo.namespace})
EXTERNAL_IP=$(kubectl get gameserverallocationpolicy ${POLICY_NAME} -n ${POLICY_NAMESPACE} -ojsonpath={.spec.connectionInfo.allocationEndpoints\[0\]})
CLIENT_SECRET_NAME=$(kubectl get gameserverallocationpolicy ${POLICY_NAME} -n ${POLICY_NAMESPACE} -ojsonpath={.spec.connectionInfo.secretName})

KEY_FILE=client.key
CERT_FILE=client.crt
TLS_CA_FILE=ca.crt

# In case of MacOS replace &amp;quot;base64 -d&amp;quot; with &amp;quot;base64 -D&amp;quot;
kubectl get secret &amp;quot;${CLIENT_SECRET_NAME}&amp;quot; -n &amp;quot;${POLICY_NAMESPACE}&amp;quot; -ojsonpath=&amp;quot;{.data.tls\.crt}&amp;quot; | base64 -d &amp;gt; &amp;quot;${CERT_FILE}&amp;quot;
kubectl get secret &amp;quot;${CLIENT_SECRET_NAME}&amp;quot; -n &amp;quot;${POLICY_NAMESPACE}&amp;quot; -ojsonpath=&amp;quot;{.data.tls\.key}&amp;quot; | base64 -d &amp;gt; &amp;quot;${KEY_FILE}&amp;quot;
kubectl get secret &amp;quot;${CLIENT_SECRET_NAME}&amp;quot; -n &amp;quot;${POLICY_NAMESPACE}&amp;quot; -ojsonpath=&amp;quot;{.data.ca\.crt}&amp;quot; | base64 -d &amp;gt; &amp;quot;${TLS_CA_FILE}&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;#!/bin/bash
&lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;&lt;/span&gt;
go run examples/allocator-client/main.go --ip &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;EXTERNAL_IP&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --port &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;443&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --namespace &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;NAMESPACE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --key &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;KEY_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --cert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;CERT_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;\
&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&lt;/span&gt;    --cacert &lt;span style=&#34;color:#4e9a06&#34;&gt;${&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;TLS_CA_FILE&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
      </description>
    </item>
    
    <item>
      <title>Docs: GameServer Pod Service Accounts</title>
      <link>/site/docs/advanced/service-accounts/</link>
      <pubDate>Thu, 14 Mar 2019 04:30:37 +0000</pubDate>
      
      <guid>/site/docs/advanced/service-accounts/</guid>
      <description>
        
        
        &lt;h2 id=&#34;default-settings&#34;&gt;Default Settings&lt;/h2&gt;
&lt;p&gt;By default, Agones sets up service accounts and sets them appropriately for the &lt;code&gt;Pods&lt;/code&gt; that are created for &lt;code&gt;GameServers&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Since Agones provides &lt;code&gt;GameServer&lt;/code&gt; &lt;code&gt;Pods&lt;/code&gt; with a sidecar container that needs access to Agones Custom Resource Definitions,
&lt;code&gt;Pods&lt;/code&gt; are configured with a service account with extra RBAC permissions to ensure that it can read and modify the resources it needs.&lt;/p&gt;
&lt;p&gt;Since service accounts apply to all containers in a &lt;code&gt;Pod&lt;/code&gt;, Agones will automatically overwrite the mounted key for the
service account in the container that is running the dedicated game server in the backing &lt;code&gt;Pod&lt;/code&gt;. This is done
since game server containers are exposed publicly, and generally don&amp;rsquo;t require the extra permissions to access aspects
of the Kubernetes API.&lt;/p&gt;
&lt;h2 id=&#34;bringing-your-own-service-account&#34;&gt;Bringing your own Service Account&lt;/h2&gt;
&lt;p&gt;If needed, you can provide your own service account on the &lt;code&gt;Pod&lt;/code&gt; specification in the &lt;code&gt;GameServer&lt;/code&gt; configuration.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;apiVersion&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;agones.dev/v1&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;kind&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;GameServer&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;metadata&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;generateName&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;simple-game-server-&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;ports&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;default&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containerPort&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;7654&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;  &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;template&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;spec&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;serviceAccountName&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;my-special-service-account&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# a custom service account&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;containers&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;      &lt;/span&gt;- &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;simple-game-server&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;image&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;us-docker.pkg.dev/agones-images/examples/simple-game-server:0.15&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If a service account is configured, the mounted key is not overwritten, as it assumed that you want to have full control
of the service account and underlying RBAC permissions.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
