<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;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;apiVersion&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;kind&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;Fleet&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;metadata&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;name&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;simple-udp&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;spec&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;replicas&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;scheduling&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;Packed&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;template&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;spec&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;ports&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;containerPort&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;template&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;spec&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;containers&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;name&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;simple-udp&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;image&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;gcr.io/agones-images/udp-server&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;0.21&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;To 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, Agones adds the annotation &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;&lt;code&gt;&amp;quot;cluster-autoscaler.kubernetes.io/safe-to-evict&amp;quot;: &amp;quot;false&amp;quot;&lt;/code&gt;&lt;/a&gt;
to the backing Pod.&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;apiVersion&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;kind&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;Fleet&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;metadata&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;name&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;simple-udp&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;spec&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;replicas&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;scheduling&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;Distributed&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;template&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;spec&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;ports&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;containerPort&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;template&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;spec&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;containers&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;name&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;simple-udp&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;image&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;gcr.io/agones-images/udp-server&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;0.21&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: 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-15.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#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;apiVersion&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;kind&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;GameServer&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;metadata&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;name&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-udp&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;spec&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;ports&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;name&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;default&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;containerPort&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;template&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;spec&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;containers&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;name&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;simple-udp&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;image&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;gcr.io/agones-images/udp-server&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;0.21&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;resources&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;limit&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;cpu&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;/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 in addition to 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/master/pkg/apis/allocation/v1/gameserverallocation.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;GameServerAllocations&lt;/a&gt;
, provides a gRPC service with mTLS authentication, called agones-allocator, which is on 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/master/proto/allocation&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;stable version&lt;/a&gt;
, starting on agones v1.6.&lt;/p&gt;

&lt;p&gt;The gRPC service is accessible through a Kubernetes service that is externalized using a load balancer. For the gRPC request to succeed, a client certificate must be provided that is in the authorization list of the allocator service.&lt;/p&gt;

&lt;p&gt;The remainder of this article describes how to manually make a successful allocation request using the gRPC API.&lt;/p&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;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 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 configure a &lt;code&gt;Certificate&lt;/code&gt; resource to manage allocator-tls &lt;code&gt;Secret&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/v1alpha2
&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:#4e9a06&#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:#4e9a06&#34;&gt;`&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/v1alpha2
&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-selfsigned-cert
&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;# Optional: Store the secret ca.crt in a file to be used by the client for the server authentication&lt;/span&gt;
&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:#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:#4e9a06&#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:#4e9a06&#34;&gt;`&lt;/span&gt;
&lt;span style=&#34;color:#204a87&#34;&gt;echo&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:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -d &amp;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:#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; ${TLS_CA_FILE}&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;/code&gt;&lt;/pre&gt;&lt;/div&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, client must provide a certificate that is accepted by the server. Here is an example of generating a client certificate. For the agones-allocator service to accept the newly generate client certificate, the generated client certificate CA or public portion of the certificate must be added to a kubernetes secret called &lt;code&gt;allocator-client-ca&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:#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

openssl req -x509 -nodes -days &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;365&lt;/span&gt; -newkey rsa:2048 -keyout &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; -out &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:#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:#4e9a06&#34;&gt;`&lt;/span&gt;cat &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:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; base64 -w &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#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 ${CERT_FILE} | base64`&lt;/span&gt;

&lt;span style=&#34;color:#8f5902;font-style:italic&#34;&gt;# white-list 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 called &lt;code&gt;client_trial.crt&lt;/code&gt; for &lt;code&gt;allocator-client-ca&lt;/code&gt; and stores it. You can also achieve this by &lt;code&gt;kubectl edit secret allocator-client-ca -n agones-system&lt;/code&gt;, and then add the entry.&lt;/p&gt;

&lt;h2 id=&#34;restart-pods&#34;&gt;Restart pods&lt;/h2&gt;

&lt;p&gt;Restart pods to get the new TLS certificate loaded to the agones-allocator service.&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 pods -n agones-system -o&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;name &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; grep agones-allocator &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; xargs kubectl delete -n agones-system&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;send-allocation-request&#34;&gt;Send allocation request&lt;/h2&gt;

&lt;p&gt;Now the service is ready to accept requests from the client with the generated certificates. Create a &lt;a href=&#34;https://agones.dev/site/docs/getting-started/create-fleet/#1-create-a-fleet&#34;&gt;fleet&lt;/a&gt; and send a gRPC request to agones-allocator. To start, take a look at the allocation gRPC client examples in 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/master/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/master/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/master/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 default 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;
&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:#4e9a06&#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:#4e9a06&#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

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;p&gt;If your matchmaker is external to the cluster on which your game servers are hosted, the &lt;code&gt;agones-allocator&lt;/code&gt; provides the gRPC API to allocate game services using mTLS authentication, which can scale independently to the Agones controller.&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;div class=&#34;alert alert-warning&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;alert-heading&#34;&gt;Beta&lt;/h4&gt;
This feature is in a pre-release state and might change.
&lt;/div&gt;


&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/master/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/master/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. 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. For clusters with the same priority, the cluster is chosen with a probability relative to its weight.&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, similarly, an allocation rule should be defined, while leaving allocationEndpoints unset. 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;&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 the &lt;code&gt;ca.crt&lt;/code&gt; field of the client secret (i.e. 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/master/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/master/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.&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:#4e9a06&#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:#4e9a06&#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;

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 true&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;apiVersion&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;kind&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;GameServer&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;metadata&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;generateName&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-udp-&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;spec&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;ports&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;name&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;default&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;containerPort&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;template&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;spec&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;serviceAccountName&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;my-special-service-account&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;containers&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:#f8f8f8;text-decoration:underline&#34;&gt; &lt;/span&gt;name&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;simple-udp&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;image&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;gcr.io/agones-images/udp-server&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;0.21&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>
