<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Agones – Getting Started</title>
    <link>/site/docs/getting-started/</link>
    <description>Recent content in Getting Started on Agones</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 05 Jan 2017 00:00:00 +0000</lastBuildDate>
    
	  <atom:link href="/site/docs/getting-started/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: Quickstart: Create a Game Server</title>
      <link>/site/docs/getting-started/create-gameserver/</link>
      <pubDate>Wed, 02 Jan 2019 06:35:31 +0000</pubDate>
      
      <guid>/site/docs/getting-started/create-gameserver/</guid>
      <description>
        
        
        &lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;

&lt;p&gt;The following prerequisites are required to create a GameServer:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A Kubernetes cluster with the UDP port range 7000-8000 open on each node.&lt;/li&gt;
&lt;li&gt;Agones controller installed in the targeted cluster&lt;/li&gt;
&lt;li&gt;kubectl properly configured&lt;/li&gt;
&lt;li&gt;Netcat which is already installed on most Linux/macOS distributions, for windows you can use &lt;a href=&#34;https://docs.microsoft.com/en-us/windows/wsl/install-win10&#34;&gt;WSL&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you don’t have a Kubernetes cluster you can follow &lt;a href=&#34;/site/site/docs/installation/&#34;&gt;these instructions&lt;/a&gt; to create a cluster on Google Kubernetes Engine (GKE), Minikube or Azure Kubernetes Service (AKS), and install Agones.&lt;/p&gt;
&lt;p&gt;For the purpose of this guide we’re going to use the
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.35.0/examples/simple-game-server/&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;simple-game-server&lt;/a&gt;
 example as the GameServer container. This example is a very simple UDP server written in Go. Don’t hesitate to look at the code of this example for more information.&lt;/p&gt;


&lt;h2 id=&#34;objectives&#34;&gt;Objectives&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Create a GameServer in Kubernetes using Agones custom resource.&lt;/li&gt;
&lt;li&gt;Get information about the GameServer such as IP address, port and state.&lt;/li&gt;
&lt;li&gt;Connect to the GameServer.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;1-create-a-gameserver&#34;&gt;1. Create a GameServer&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s create a GameServer using the following command :&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/gameserver.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see a successful output similar to this :&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;gameserver.agones.dev/simple-game-server-4ss4j created
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This has created a GameServer record inside Kubernetes, which has also created a backing &lt;a href=&#34;https://kubernetes.io/docs/concepts/workloads/pods/pod/&#34;&gt;Pod&lt;/a&gt; to run our simple udp game server code in.
If you want to see all your running GameServers you can run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gameservers
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should look something like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                       STATE     ADDRESS       PORT   NODE     AGE
simple-game-server-7pjrq   Ready   35.233.183.43   7190   agones   3m
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also see the &lt;a href=&#34;https://kubernetes.io/docs/concepts/workloads/pods/pod/&#34;&gt;Pod&lt;/a&gt; that got created by running &lt;code&gt;kubectl get pods&lt;/code&gt;, the Pod will be prefixed by &lt;code&gt;simple-game-server&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                        READY     STATUS    RESTARTS   AGE
simple-game-server-7pjrq    2/2       Running   0          5m
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As you can see above it says &lt;code&gt;READY: 2/2&lt;/code&gt; this means there are two containers running in this Pod, this is because Agones injected the &lt;a href=&#34;https://agones.dev/site/docs/guides/troubleshooting/#how-do-i-see-the-logs-for-agones&#34;&gt;SDK sidecar&lt;/a&gt; for readiness
and health checking of your Game Server.&lt;/p&gt;
&lt;p&gt;For the full details of the YAML file head to the &lt;a href=&#34;/site/site/docs/reference/gameserver/&#34;&gt;GameServer Specification Guide&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;2-fetch-the-gameserver-status&#34;&gt;2. Fetch the GameServer Status&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s wait for the GameServer state to become &lt;code&gt;Ready&lt;/code&gt;. You can use the &lt;code&gt;watch&lt;/code&gt;
tool to see the state change. If your operating system does not have &lt;code&gt;watch&lt;/code&gt;,
manually run &lt;code&gt;kubectl describe gameserver&lt;/code&gt; until the state changes.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;watch kubectl describe gameserver
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Name:         simple-game-server-7pjrq
Namespace:    default
Labels:       &amp;lt;none&amp;gt;
Annotations:  agones.dev/sdk-version: 0.9.0-764fa53
API Version:  agones.dev/v1
Kind:         GameServer
Metadata:
  Creation Timestamp:  2019-02-27T15:06:20Z
  Finalizers:
    agones.dev
  Generate Name:     simple-game-server-
  Generation:        1
  Resource Version:  30377
  Self Link:         /apis/agones.dev/v1/namespaces/default/gameservers/simple-game-server-7pjrq
  UID:               3d7ac3e1-3aa1-11e9-a4f5-42010a8a0019
Spec:
  Container:  simple-game-server
  Health:
    Failure Threshold:      3
    Initial Delay Seconds:  5
    Period Seconds:         5
  Ports:
    Container Port:  7654
    Host Port:       7190
    Name:            default
    Port Policy:     Dynamic
    Protocol:        UDP
  Scheduling:        Packed
  Template:
    Metadata:
      Creation Timestamp:  &amp;lt;nil&amp;gt;
    Spec:
      Containers:
        Image:  us-docker.pkg.dev/agones-images/examples/simple-game-server:0.21
        Name:   simple-game-server
        Resources:
          Limits:
            Cpu:     20m
            Memory:  32Mi
          Requests:
            Cpu:     20m
            Memory:  32Mi
Status:
  Address:    35.233.183.43
  Node Name:  agones
  Ports:
    Name:  default
    Port:  7190
  State:   Ready
Events:
  Type    Reason          Age   From                   Message
  ----    ------          ----  ----                   -------
  Normal  PortAllocation  34s   gameserver-controller  Port allocated
  Normal  Creating        34s   gameserver-controller  Pod simple-game-server-7pjrq created
  Normal  Scheduled       34s   gameserver-controller  Address and port populated
  Normal  Ready           27s   gameserver-controller  SDK.Ready() executed
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you look towards the bottom, you can see there is a &lt;code&gt;Status &amp;gt; State&lt;/code&gt; value. We are waiting for it to move to &lt;code&gt;Ready&lt;/code&gt;, which means that the game server is ready to accept connections.&lt;/p&gt;
&lt;p&gt;You might also be interested to see the &lt;code&gt;Events&lt;/code&gt; section, which outlines when various lifecycle events of the &lt;code&gt;GameServer&lt;/code&gt; occur. We can also see when the &lt;code&gt;GameServer&lt;/code&gt; is ready on the event stream as well - at which time the &lt;code&gt;Status &amp;gt; Address&lt;/code&gt; and &lt;code&gt;Status &amp;gt; Ports &amp;gt; Port&lt;/code&gt; have also been populated, letting us know what IP and port our client can now connect to!&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s retrieve the IP address and the allocated port of your Game Server :&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This should output your Game Server IP address and ports, eg:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                       STATE   ADDRESS         PORT   NODE     AGE
simple-game-server-7pjrq   Ready   35.233.183.43   7190   agones   4m
&lt;/code&gt;&lt;/pre&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;

    If you have Agones installed on minikube, or other local Kubernetes tooling, and you are having issues connecting
to the &lt;code&gt;GameServer&lt;/code&gt;, please check the
&lt;a href=&#34;/site/site/docs/installation/creating-cluster/minikube/#local-connection-workarounds&#34;&gt;Minikube local connection workarounds&lt;/a&gt;.

&lt;/div&gt;

&lt;h3 id=&#34;3-connect-to-the-gameserver&#34;&gt;3. Connect to the GameServer&lt;/h3&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;

    If you have Agones installed on Google Kubernetes Engine, and are using
Cloud Shell for your terminal, UDP is blocked. For this step, we recommend
SSH&amp;rsquo;ing into a running VM in your project, such as a Kubernetes node.
You can click the &amp;lsquo;SSH&amp;rsquo; button on the &lt;a href=&#34;https://console.cloud.google.com/compute/instances&#34;&gt;Google Compute Engine Instances&lt;/a&gt;
page to do this.
Run &lt;code&gt;toolbox&lt;/code&gt; on GKE Node to run docker container with tools and then &lt;code&gt;nc&lt;/code&gt; command would be available.

&lt;/div&gt;

&lt;p&gt;You can now communicate with the Game Server :&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;

    &lt;p&gt;If you do not have netcat installed
(i.e. you get a response of &lt;code&gt;nc: command not found&lt;/code&gt;),
you can install netcat by running &lt;code&gt;sudo apt install netcat&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you are on Windows, you can alternatively install netcat on
&lt;a href=&#34;https://docs.microsoft.com/en-us/windows/wsl/install-win10&#34;&gt;WSL&lt;/a&gt;,
or download a version of netcat for Windows from &lt;a href=&#34;https://nmap.org/ncat/&#34;&gt;nmap.org&lt;/a&gt;.&lt;/p&gt;


&lt;/div&gt;

&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nc -u {IP} {PORT}
Hello World !
ACK: Hello World !
EXIT
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can finally type &lt;code&gt;EXIT&lt;/code&gt; which tells the SDK to run the &lt;a href=&#34;/site/site/docs/guides/client-sdks/#shutdown&#34;&gt;Shutdown command&lt;/a&gt;, and therefore shuts down the &lt;code&gt;GameServer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you run &lt;code&gt;kubectl describe gameserver&lt;/code&gt; again - either the GameServer will be gone completely, or it will be in &lt;code&gt;Shutdown&lt;/code&gt; state, on the way to being deleted.&lt;/p&gt;
&lt;h2 id=&#34;next-step&#34;&gt;Next Step&lt;/h2&gt;
&lt;p&gt;If you want to use your own GameServer container make sure you have properly integrated the &lt;a href=&#34;/site/site/docs/guides/client-sdks/&#34;&gt;Agones SDK&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Quickstart: Create a Game Server Fleet</title>
      <link>/site/docs/getting-started/create-fleet/</link>
      <pubDate>Wed, 02 Jan 2019 06:42:20 +0000</pubDate>
      
      <guid>/site/docs/getting-started/create-fleet/</guid>
      <description>
        
        
        &lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;

&lt;p&gt;The following prerequisites are required to create a GameServer:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A Kubernetes cluster with the UDP port range 7000-8000 open on each node.&lt;/li&gt;
&lt;li&gt;Agones controller installed in the targeted cluster&lt;/li&gt;
&lt;li&gt;kubectl properly configured&lt;/li&gt;
&lt;li&gt;Netcat which is already installed on most Linux/macOS distributions, for windows you can use &lt;a href=&#34;https://docs.microsoft.com/en-us/windows/wsl/install-win10&#34;&gt;WSL&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you don’t have a Kubernetes cluster you can follow &lt;a href=&#34;/site/site/docs/installation/&#34;&gt;these instructions&lt;/a&gt; to create a cluster on Google Kubernetes Engine (GKE), Minikube or Azure Kubernetes Service (AKS), and install Agones.&lt;/p&gt;
&lt;p&gt;For the purpose of this guide we’re going to use the
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.35.0/examples/simple-game-server/&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;simple-game-server&lt;/a&gt;
 example as the GameServer container. This example is a very simple UDP server written in Go. Don’t hesitate to look at the code of this example for more information.&lt;/p&gt;


&lt;p&gt;While not required, you may wish to go through the &lt;a href=&#34;/site/site/docs/getting-started/create-gameserver/&#34;&gt;Create a Game Server&lt;/a&gt; quickstart before this one.&lt;/p&gt;
&lt;h2 id=&#34;objectives&#34;&gt;Objectives&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Create a &lt;a href=&#34;https://agones.dev/site/docs/reference/fleet/&#34;&gt;Fleet&lt;/a&gt; in Kubernetes using an Agones custom resource.&lt;/li&gt;
&lt;li&gt;Scale the Fleet up from its initial configuration.&lt;/li&gt;
&lt;li&gt;Request a GameServer allocation from the Fleet to play on.&lt;/li&gt;
&lt;li&gt;Connect to the allocated GameServer.&lt;/li&gt;
&lt;li&gt;Deploy a new GameServer configuration to the Fleet.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;1-create-a-fleet&#34;&gt;1. Create a Fleet&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s create a Fleet using the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/fleet.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see a successful output similar to this :&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fleet.agones.dev/simple-game-server created
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This has created a Fleet record inside Kubernetes, which in turn creates two warm &lt;a href=&#34;/site/site/docs/reference/gameserver/&#34;&gt;GameServers&lt;/a&gt;
that are available to be allocated for a game session.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get fleet
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should look something like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                 SCHEDULING   DESIRED   CURRENT   ALLOCATED   READY     AGE
simple-game-server   Packed       2         3         0           2         9m
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can also see the GameServers that have been created by the Fleet by running &lt;code&gt;kubectl get gameservers&lt;/code&gt;,
the GameServer will be prefixed by &lt;code&gt;simple-game-server&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE     ADDRESS            PORT   NODE      AGE
simple-game-server-llg4x-rx6rc   Ready     192.168.122.205    7752   minikube   9m
simple-game-server-llg4x-v6g2r   Ready     192.168.122.205    7623   minikube   9m
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For the full details of the YAML file head to the &lt;a href=&#34;/site/site/docs/reference/fleet/&#34;&gt;Fleet Specification Guide&lt;/a&gt;&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 game servers deployed from a &lt;code&gt;Fleet&lt;/code&gt; resource will be deployed in the same namespace. The above example omits specifying a namespace, which implies both the &lt;code&gt;Fleet&lt;/code&gt; and the associated &lt;code&gt;GameServer&lt;/code&gt; resources will be deployed to the &lt;code&gt;default&lt;/code&gt; namespace.

&lt;/div&gt;

&lt;h3 id=&#34;2-fetch-the-fleet-status&#34;&gt;2. Fetch the Fleet status&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s wait for the two &lt;code&gt;GameServers&lt;/code&gt; to become ready.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;watch kubectl describe fleet simple-game-server
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Name:         simple-game-server
Namespace:    default
Labels:       &amp;lt;none&amp;gt;
Annotations:  kubectl.kubernetes.io/last-applied-configuration={&amp;#34;apiVersion&amp;#34;:&amp;#34;agones.dev/v1&amp;#34;,&amp;#34;kind&amp;#34;:&amp;#34;Fleet&amp;#34;,&amp;#34;metadata&amp;#34;:{&amp;#34;annotations&amp;#34;:{},&amp;#34;name&amp;#34;:&amp;#34;simple-game-server&amp;#34;,&amp;#34;namespace&amp;#34;:&amp;#34;default&amp;#34;},&amp;#34;spec&amp;#34;:{&amp;#34;replicas&amp;#34;:2,...
API Version:  agones.dev/v1
Kind:         Fleet
Metadata:
  Cluster Name:
  Creation Timestamp:  2018-07-01T18:55:35Z
  Generation:          1
  Resource Version:    24685
  Self Link:           /apis/agones.dev/v1/namespaces/default/fleets/simple-game-server
  UID:                 56710a91-7d60-11e8-b2dd-08002703ef08
Spec:
  Replicas:  2
  Strategy:
    Rolling Update:
      Max Surge:        25%
      Max Unavailable:  25%
    Type:               RollingUpdate
  Template:
    Metadata:
      Creation Timestamp:  &amp;lt;nil&amp;gt;
    Spec:
      Health:
      Ports:
        Container Port:  7654
        Name:            default
        Port Policy:     Dynamic
      Template:
        Metadata:
          Creation Timestamp:  &amp;lt;nil&amp;gt;
        Spec:
          Containers:
            Image:  us-docker.pkg.dev/agones-images/examples/simple-game-server:0.21
            Name:   simple-game-server
            Resources:
Status:
  Allocated Replicas:  0
  Ready Replicas:      2
  Replicas:            2
Events:
  Type    Reason                 Age   From              Message
  ----    ------                 ----  ----              -------
  Normal  CreatingGameServerSet  13s   fleet-controller  Created GameServerSet simple-game-server-wlqnd
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you look towards the bottom, you can see there is a section of &lt;code&gt;Status &amp;gt; Ready Replicas&lt;/code&gt; which will tell you
how many &lt;code&gt;GameServers&lt;/code&gt; are currently in a Ready state. After a short period, there should be 2 &lt;code&gt;Ready Replicas&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;3-scale-up-the-fleet&#34;&gt;3. Scale up the Fleet&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s scale up the &lt;code&gt;Fleet&lt;/code&gt; from 2 &lt;code&gt;replicates&lt;/code&gt; to 5.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;kubectl scale fleet simple-game-server --replicas=5&lt;/code&gt; to change Replicas count from 2 to 5.&lt;/p&gt;
&lt;p&gt;If we now run &lt;code&gt;kubectl get gameservers&lt;/code&gt; we should see 5 &lt;code&gt;GameServers&lt;/code&gt; prefixed by &lt;code&gt;simple-game-server&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE    ADDRESS           PORT    NODE       AGE
simple-game-server-sdhzn-kcmh6   Ready    192.168.122.205   7191    minikube   52m
simple-game-server-sdhzn-pdpk5   Ready    192.168.122.205   7752    minikube   53m
simple-game-server-sdhzn-r4d6x   Ready    192.168.122.205   7623    minikube   52m
simple-game-server-sdhzn-wng5k   Ready    192.168.122.205   7709    minikube   53m
simple-game-server-sdhzn-wnhsw   Ready    192.168.122.205   7478    minikube   52m
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;4-allocate-a-game-server-from-the-fleet&#34;&gt;4. Allocate a Game Server from the Fleet&lt;/h3&gt;
&lt;p&gt;Since we have a fleet of warm gameservers, we need a way to request one of them for usage, and mark that it has
players accessing it (and therefore, it should not be deleted until they are finished with it).&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;

    In production, you would likely do the following through a &lt;a href=&#34;/site/site/docs/guides/access-api/&#34;&gt;Kubernetes API call&lt;/a&gt;, but we can also
do this through &lt;code&gt;kubectl&lt;/code&gt; as well, and ask it to return the response in yaml so that we can see what has happened.

&lt;/div&gt;

&lt;p&gt;We can do the allocation of a GameServer for usage through a &lt;code&gt;GameServerAllocation&lt;/code&gt;, which will both
return to us the details of a &lt;code&gt;GameServer&lt;/code&gt; (assuming one is available), and also move it to the &lt;code&gt;Allocated&lt;/code&gt; state,
which demarcates that it has players on it, and should not be removed until &lt;code&gt;SDK.Shutdown()&lt;/code&gt; is called, or it is manually deleted.&lt;/p&gt;
&lt;p&gt;It is worth noting that there is nothing specific that ties a &lt;code&gt;GameServerAllocation&lt;/code&gt; to a fleet.
A &lt;code&gt;GameServerAllocation&lt;/code&gt; uses a &lt;a href=&#34;https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/&#34;&gt;label selector&lt;/a&gt;
to determine what group of &lt;code&gt;GameServers&lt;/code&gt; it will attempt to allocate out of. That being said, a &lt;code&gt;Fleet&lt;/code&gt; and &lt;code&gt;GameServerAllocation&lt;/code&gt;
are often used in conjunction.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.35.0//examples/simple-game-server/gameserverallocation.yaml&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;This example&lt;/a&gt;
 uses the label selector to specifically target the &lt;code&gt;simple-game-server&lt;/code&gt; fleet that we just created.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/gameserverallocation.yaml -o yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For the full details of the YAML file head to the &lt;a href=&#34;/site/site/docs/reference/gameserverallocation/&#34;&gt;GameServerAllocation Specification Guide&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should get back a response that looks like the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&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:#000&#34;&gt;allocation.agones.dev/v1&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;GameServerAllocation&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;creationTimestamp&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;2019-02-19T02:13:12Z&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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-dph9b-hfk24&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;namespace&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;required&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;matchLabels&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;agones.dev/fleet&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;status&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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;address&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;192.168.122.152&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;gameServerName&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-dph9b-hfk24&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;nodeName&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;minikube&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;port&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;7714&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;state&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;Allocated&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you look at the &lt;code&gt;status&lt;/code&gt; section, there are several things to take note of. The &lt;code&gt;state&lt;/code&gt; value will tell if
a &lt;code&gt;GameServer&lt;/code&gt; was allocated or not. If a &lt;code&gt;GameServer&lt;/code&gt; could not be found, this will be set to &lt;code&gt;UnAllocated&lt;/code&gt;.
If there are too many concurrent requests overwhelmed the system, &lt;code&gt;state&lt;/code&gt; will be set to
&lt;code&gt;Contention&lt;/code&gt; even though there are available &lt;code&gt;GameServers&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;However, we see that the &lt;code&gt;status.state&lt;/code&gt; value was set to &lt;code&gt;Allocated&lt;/code&gt;.
This means you have been successfully allocated a &lt;code&gt;GameServer&lt;/code&gt; out of the fleet, and you can now connect your players to it!&lt;/p&gt;
&lt;p&gt;You can see various immutable details of the &lt;code&gt;GameServer&lt;/code&gt; in the status - the &lt;code&gt;address&lt;/code&gt;, &lt;code&gt;ports&lt;/code&gt; and the name
of the &lt;code&gt;GameServer&lt;/code&gt;, in case you want to use it to retrieve more details.&lt;/p&gt;
&lt;p&gt;We can also check to see how many &lt;code&gt;GameServers&lt;/code&gt; you have &lt;code&gt;Allocated&lt;/code&gt; vs &lt;code&gt;Ready&lt;/code&gt; with the following command
(&amp;ldquo;gs&amp;rdquo; is shorthand for &amp;ldquo;gameserver&amp;rdquo;).&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will get you a list of all the current &lt;code&gt;GameServers&lt;/code&gt; and their &lt;code&gt;Status.State&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE       ADDRESS           PORT   NODE      AGE
simple-game-server-sdhzn-kcmh6   Ready       192.168.122.205   7191   minikube  52m
simple-game-server-sdhzn-pdpk5   Ready       192.168.122.205   7752   minikube  53m
simple-game-server-sdhzn-r4d6x   Allocated   192.168.122.205   7623   minikube  52m
simple-game-server-sdhzn-wng5k   Ready       192.168.122.205   7709   minikube  53m
simple-game-server-sdhzn-wnhsw   Ready       192.168.122.205   7478   minikube  52m
&lt;/code&gt;&lt;/pre&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;

    &lt;code&gt;GameServerAllocations&lt;/code&gt; are create only and not stored for performance reasons, so you won&amp;rsquo;t be able to list
them after they have been created - but you can see their effects on &lt;code&gt;GameServers&lt;/code&gt;

&lt;/div&gt;

&lt;p&gt;A handy trick for checking to see how many &lt;code&gt;GameServers&lt;/code&gt; you have &lt;code&gt;Allocated&lt;/code&gt; vs &lt;code&gt;Ready&lt;/code&gt;, run the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will get you a list of all the current &lt;code&gt;GameServers&lt;/code&gt; and their &lt;code&gt;Status &amp;gt; State&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE       ADDRESS          PORT   NODE        AGE
simple-game-server-tfqn7-c9tqz   Ready       192.168.39.150   7136   minikube    52m
simple-game-server-tfqn7-g8fhq   Allocated   192.168.39.150   7148   minikube    53m
simple-game-server-tfqn7-p8wnl   Ready       192.168.39.150   7453   minikube    52m
simple-game-server-tfqn7-t6bwp   Ready       192.168.39.150   7228   minikube    53m
simple-game-server-tfqn7-wkb7b   Ready       192.168.39.150   7226   minikube    52m
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;5-scale-down-the-fleet&#34;&gt;5. Scale down the Fleet&lt;/h3&gt;
&lt;p&gt;Not only can we scale our fleet up, but we can scale it down as well.&lt;/p&gt;
&lt;p&gt;The nice thing about Agones is that it is smart enough to know when &lt;code&gt;GameServers&lt;/code&gt; have been moved to &lt;code&gt;Allocated&lt;/code&gt;
and will automatically leave them running on scale down &amp;ndash; as we assume that players are playing on this game server,
and we shouldn&amp;rsquo;t disconnect them!&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s scale down our Fleet to 0 (yep! you can do that!), and watch what happens.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;kubectl scale fleet simple-game-server --replicas=0&lt;/code&gt; to change Replicas count from 5 to 0.&lt;/p&gt;
&lt;p&gt;It may take a moment for all the &lt;code&gt;GameServers&lt;/code&gt; to shut down, so let&amp;rsquo;s watch them all and see what happens:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;watch kubectl get gs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Eventually, one by one they will be removed from the list, and you should simply see:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATUS      ADDRESS          PORT    NODE       AGE
simple-game-server-tfqn7-g8fhq   Allocated   192.168.39.150   7148    minikube   55m
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;That lone &lt;code&gt;Allocated&lt;/code&gt; &lt;code&gt;GameServer&lt;/code&gt; is left all alone, but still running!&lt;/p&gt;
&lt;p&gt;If you would like, try editing the &lt;code&gt;Fleet&lt;/code&gt; configuration &lt;code&gt;replicas&lt;/code&gt; field and watch the list of &lt;code&gt;GameServers&lt;/code&gt;
grow and shrink.&lt;/p&gt;
&lt;h3 id=&#34;6-connect-to-the-gameserver&#34;&gt;6. Connect to the GameServer&lt;/h3&gt;
&lt;p&gt;Since we&amp;rsquo;ve only got one allocation, we&amp;rsquo;ll just grab the details of the IP and port of the
only allocated &lt;code&gt;GameServer&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gameservers &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; grep Allocated &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; awk &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{print $3&amp;#34;:&amp;#34;$4 }&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This should output your Game Server IP address and port. (eg &lt;code&gt;10.130.65.208:7936&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;You can now communicate with the &lt;code&gt;GameServer&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nc -u {IP} {PORT}
Hello World !
ACK: Hello World !
EXIT
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can finally type &lt;code&gt;EXIT&lt;/code&gt; which tells the SDK to run the &lt;a href=&#34;/site/site/docs/guides/client-sdks/#shutdown&#34;&gt;Shutdown command&lt;/a&gt;, and therefore shuts down the &lt;code&gt;GameServer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you run &lt;code&gt;kubectl describe gs | grep State&lt;/code&gt; again - either the GameServer will be replaced with a new, &lt;code&gt;Ready&lt;/code&gt; &lt;code&gt;GameServer&lt;/code&gt;
, or it will be in &lt;code&gt;Shutdown&lt;/code&gt; state, on the way to being deleted.&lt;/p&gt;
&lt;p&gt;Since we are running a &lt;code&gt;Fleet&lt;/code&gt;, Agones will always do it&amp;rsquo;s best to ensure there are always the configured number
of &lt;code&gt;GameServers&lt;/code&gt; in the pool in either a &lt;code&gt;Ready&lt;/code&gt; or &lt;code&gt;Allocated&lt;/code&gt; state.&lt;/p&gt;
&lt;h3 id=&#34;7-deploy-a-new-version-of-the-gameserver-on-the-fleet&#34;&gt;7. Deploy a new version of the GameServer on the Fleet&lt;/h3&gt;
&lt;p&gt;We can also change the configuration of the &lt;code&gt;GameServer&lt;/code&gt; of the running &lt;code&gt;Fleet&lt;/code&gt;, and have the changes
roll out, without interrupting the currently &lt;code&gt;Allocated&lt;/code&gt; &lt;code&gt;GameServers&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s take this for a spin! Run &lt;code&gt;kubectl scale fleet simple-game-server --replicas=5&lt;/code&gt; to return Replicas count back to 5.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s also allocate ourselves a &lt;code&gt;GameServer&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/gameserverallocation.yaml -o yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We should now have four &lt;code&gt;Ready&lt;/code&gt; &lt;code&gt;GameServers&lt;/code&gt; and one &lt;code&gt;Allocated&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can check this by running &lt;code&gt;kubectl get gs&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE       ADDRESS          PORT   NODE       AGE
simple-game-server-tfqn7-c9tz7   Ready       192.168.39.150   7136   minikube   5m
simple-game-server-tfqn7-g8fhq   Allocated   192.168.39.150   7148   minikube   5m
simple-game-server-tfqn7-n0wnl   Ready       192.168.39.150   7453   minikube   5m
simple-game-server-tfqn7-hiiwp   Ready       192.168.39.150   7228   minikube   5m
simple-game-server-tfqn7-w8z7b   Ready       192.168.39.150   7226   minikube   5m
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In production, we&amp;rsquo;d likely be changing a &lt;code&gt;containers &amp;gt; image&lt;/code&gt; configuration to update our &lt;code&gt;Fleet&lt;/code&gt;
to run a new game server process, but to make this example simple, change &lt;code&gt;containerPort&lt;/code&gt; from &lt;code&gt;7654&lt;/code&gt;
to &lt;code&gt;6000&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;kubectl edit fleet simple-game-server&lt;/code&gt;, and make the necessary changes, and then save and exit your editor.&lt;/p&gt;
&lt;p&gt;This will start the deployment of a new set of &lt;code&gt;GameServers&lt;/code&gt; running
with a Container Port of &lt;code&gt;6000&lt;/code&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;

    This will make it such that you can no longer connect to the simple-game-server game server.

&lt;/div&gt;

&lt;p&gt;Run &lt;code&gt;kubectl describe gs | grep &amp;quot;Container Port&amp;quot;&lt;/code&gt;
until you can see that there is
one with a containerPort of &lt;code&gt;7654&lt;/code&gt;, which is the &lt;code&gt;Allocated&lt;/code&gt; &lt;code&gt;GameServer&lt;/code&gt;, and four instances with a containerPort of &lt;code&gt;6000&lt;/code&gt; which
is the new configuration. You can also run &lt;code&gt;kubectl get gs&lt;/code&gt; and look at the &lt;strong&gt;Age&lt;/strong&gt; column to see that one &lt;code&gt;GameServer&lt;/code&gt; is much
older than the other four.&lt;/p&gt;
&lt;p&gt;You have now deployed a new version of your game!&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next Steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Have a look at the &lt;a href=&#34;/site/site/docs/reference/gameserverallocation/&#34;&gt;GameServerAllocation specification&lt;/a&gt;, and see
how the extra functionality can enable smoke testing, server information communication, and more.&lt;/li&gt;
&lt;li&gt;You can now create a fleet autoscaler to automatically resize your fleet based on the actual usage.
See &lt;a href=&#34;/site/site/docs/getting-started/create-fleetautoscaler/&#34;&gt;Create a Fleet Autoscaler&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Have a look at the &lt;a href=&#34;/site/site/docs/integration-patterns/&#34;&gt;GameServer Integration Patterns&lt;/a&gt;,
to give you a set of examples on how all the pieces fit together with your matchmaker and other systems.&lt;/li&gt;
&lt;li&gt;Or if you want to try to use your own GameServer container make sure you have properly integrated the &lt;a href=&#34;/site/site/docs/guides/client-sdks/&#34;&gt;Agones SDK&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you would like to learn how to programmatically allocate a Game Server from the fleet, see how to &lt;a href=&#34;/site/site/docs/guides/access-api/&#34;&gt;Access Agones via the Kubernetes API&lt;/a&gt; or alternatively use the &lt;a href=&#34;/site/site/docs/advanced/allocator-service/&#34;&gt;Allocator Service&lt;/a&gt;, depending on your needs.&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Quickstart: Create a Fleet Autoscaler</title>
      <link>/site/docs/getting-started/create-fleetautoscaler/</link>
      <pubDate>Wed, 02 Jan 2019 06:42:33 +0000</pubDate>
      
      <guid>/site/docs/getting-started/create-fleetautoscaler/</guid>
      <description>
        
        
        &lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;It is assumed that you have followed the instructions to &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/&#34;&gt;Create a Game Server Fleet&lt;/a&gt;
and you have a running fleet of game servers.&lt;/p&gt;
&lt;h2 id=&#34;objectives&#34;&gt;Objectives&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Create a Fleet Autoscaler in Kubernetes using Agones custom resource.&lt;/li&gt;
&lt;li&gt;Watch the Fleet scale up when allocating GameServers&lt;/li&gt;
&lt;li&gt;Watch the Fleet scale down when shutting down allocated GameServers&lt;/li&gt;
&lt;li&gt;Edit the autoscaler specification to apply live changes&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;1-create-a-fleet-autoscaler&#34;&gt;1. Create a Fleet Autoscaler&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s create a Fleet Autoscaler using the following command :&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/fleetautoscaler.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see a successful output similar to this :&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fleetautoscaler.autoscaling.agones.dev/simple-game-server-autoscaler created
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This has created a FleetAutoscaler record inside Kubernetes.&lt;/p&gt;
&lt;h3 id=&#34;2-see-the-autoscaler-status&#34;&gt;2. See the autoscaler status.&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler simple-game-server-autoscaler
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should look something like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Name:         simple-game-server-autoscaler
Namespace:    default
Labels:       &amp;lt;none&amp;gt;
Annotations:  kubectl.kubernetes.io/last-applied-configuration={&amp;#34;apiVersion&amp;#34;:&amp;#34;au
toscaling.agones.dev/v1&amp;#34;,&amp;#34;kind&amp;#34;:&amp;#34;FleetAutoscaler&amp;#34;,&amp;#34;metadata&amp;#34;:{&amp;#34;annotations&amp;#34;:{},
&amp;#34;name&amp;#34;:&amp;#34;simple-game-server-autoscaler&amp;#34;,&amp;#34;namespace&amp;#34;:&amp;#34;default&amp;#34;},...
API Version:  autoscaling.agones.dev/v1
Kind:         FleetAutoscaler
Metadata:
  Cluster Name:
  Creation Timestamp:  2018-10-02T15:19:58Z
  Generation:          1
  Owner References:
    API Version:           autoscaling.agones.dev/v1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Fleet
    Name:                  simple-game-server
    UID:                   9960762e-c656-11e8-933e-fa163e07a1d4
  Resource Version:        6123197
  Self Link:               /apis/autoscaling.agones.dev/v1/namespaces/default/fleetautoscalers/simple-game-server-autoscaler
  UID:                     9fd0efa1-c656-11e8-933e-fa163e07a1d4
Spec:
  Fleet Name:  simple-game-server
  Policy:
    Buffer:
      Buffer Size:   2
      Max Replicas:  10
      Min Replicas:  2
    Type:            Buffer
Status:
  Able To Scale:     true
  Current Replicas:  2
  Desired Replicas:  2
  Last Scale Time:   &amp;lt;nil&amp;gt;
  Scaling Limited:   false
Events:              &amp;lt;none&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see the status (able to scale, not limited), the last time the fleet was scaled (nil for never)
and the current and desired fleet size.&lt;/p&gt;
&lt;p&gt;The autoscaler works by changing the desired size, and the fleet creates/deletes game server instances
to achieve that number. The convergence is achieved in time, which is usually measured in seconds.&lt;/p&gt;
&lt;h3 id=&#34;3-allocate-a-game-server-from-the-fleet&#34;&gt;3. Allocate a Game Server from the Fleet&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re interested in more details for game server allocation, you should consult the &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/&#34;&gt;Create a Game Server Fleet&lt;/a&gt; page.
In here we are only interested in triggering allocations to see the autoscaler in action.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/gameserverallocation.yaml -o yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should get in return the allocated game server details, which should end with something like:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;status:
  address: 34.94.118.237
  gameServerName: simple-game-server-v6jwb-6bzkz
  nodeName: gke-test-cluster-default-f11755a7-5km3
  ports:
  - name: default
    port: 7832
  state: Allocated
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note the address and port, you might need them later to connect to the server.&lt;/p&gt;
&lt;h3 id=&#34;4-see-the-autoscaler-in-action&#34;&gt;4. See the autoscaler in action&lt;/h3&gt;
&lt;p&gt;Now let&amp;rsquo;s wait a few seconds to allow the autoscaler to detect the change in the fleet and check again its status&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler simple-game-server-autoscaler
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last part should look something like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Spec:
  Fleet Name:  simple-game-server
  Policy:
    Buffer:
      Buffer Size:   2
      Max Replicas:  10
      Min Replicas:  2
    Type:            Buffer
Status:
  Able To Scale:     true
  Current Replicas:  3
  Desired Replicas:  3
  Last Scale Time:   2018-10-02T16:00:02Z
  Scaling Limited:   false
Events:
  Type    Reason            Age   From                        Message
  ----    ------            ----  ----                        -------
  Normal  AutoScalingFleet  2m    fleetautoscaler-controller  Scaling fleet simple-game-server from 2 to 3
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see that the fleet size has increased, the autoscaler having compensated for the allocated instance.
Last Scale Time has been updated, and a scaling event has been logged.&lt;/p&gt;
&lt;p&gt;Double-check the actual number of game server instances and status by running&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will get you a list of all the current &lt;code&gt;GameServers&lt;/code&gt; and their &lt;code&gt;Status &amp;gt; State&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE       ADDRESS        PORT     NODE        AGE
simple-game-server-mzhrl-hz8wk   Allocated   10.30.64.99    7131     minikube    5m
simple-game-server-mzhrl-k6jg5   Ready       10.30.64.100   7243     minikube    5m  
simple-game-server-mzhrl-n2sk2   Ready       10.30.64.168   7658     minikube    5m
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;5-shut-the-allocated-instance-down&#34;&gt;5. Shut the allocated instance down&lt;/h3&gt;
&lt;p&gt;Since we&amp;rsquo;ve only got one allocation, we&amp;rsquo;ll just grab the details of the IP and port of the
only allocated &lt;code&gt;GameServer&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gameservers &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; grep Allocated &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;|&lt;/span&gt; awk &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;{print $3&amp;#34;:&amp;#34;$4 }&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This should output your Game Server IP address and port. (eg &lt;code&gt;10.130.65.208:7936&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;You can now communicate with the &lt;code&gt;GameServer&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nc -u {IP} {PORT}
Hello World !
ACK: Hello World !
EXIT
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can finally type &lt;code&gt;EXIT&lt;/code&gt; which tells the SDK to run the &lt;a href=&#34;/site/site/docs/guides/client-sdks/#shutdown&#34;&gt;Shutdown command&lt;/a&gt;, and therefore shuts down the &lt;code&gt;GameServer&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;6-see-the-fleet-scaling-down&#34;&gt;6. See the fleet scaling down&lt;/h3&gt;
&lt;p&gt;Now let&amp;rsquo;s wait a few seconds to allow the autoscaler to detect the change in the fleet and check again its status&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler simple-game-server-autoscaler
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should look something like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Spec:
  Fleet Name:  simple-game-server
  Policy:
    Buffer:
      Buffer Size:   2
      Max Replicas:  10
      Min Replicas:  2
    Type:            Buffer
Status:
  Able To Scale:     true
  Current Replicas:  3
  Desired Replicas:  2
  Last Scale Time:   2018-10-02T16:09:02Z
  Scaling Limited:   false
Events:
  Type    Reason            Age   From                        Message
  ----    ------            ----  ----                        -------
  Normal  AutoScalingFleet  9m    fleetautoscaler-controller  Scaling fleet simple-game-server from 2 to 3
  Normal  AutoScalingFleet  45s   fleetautoscaler-controller  Scaling fleet simple-game-server from 3 to 2
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see that the fleet size has decreased, the autoscaler adjusting to game server instance being de-allocated,
the Last Scale Time and the events have been updated. Note that simple-game-server game server instance you just closed earlier
might stay a bit in &amp;lsquo;Unhealthy&amp;rsquo; state (and its pod in &amp;lsquo;Terminating&amp;rsquo; until it gets removed.&lt;/p&gt;
&lt;p&gt;Double-check the actual number of game server instances and status by running&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gs
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will get you a list of all the current &lt;code&gt;GameServers&lt;/code&gt; and their &lt;code&gt;Status &amp;gt; State&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE     ADDRESS        PORT    NODE       AGE
simple-game-server-mzhrl-k6jg5   Ready     10.30.64.100   7243    minikube   5m
simple-game-server-mzhrl-t7944   Ready     10.30.64.168   7561    minikube   5m
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;7-change-autoscaling-parameters&#34;&gt;7. Change autoscaling parameters&lt;/h3&gt;
&lt;p&gt;We can also change the configuration of the &lt;code&gt;FleetAutoscaler&lt;/code&gt; of the running &lt;code&gt;Fleet&lt;/code&gt;, and have the changes
applied live, without interruptions of service.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;kubectl edit fleetautoscaler simple-game-server-autoscaler&lt;/code&gt; and set the &lt;code&gt;bufferSize&lt;/code&gt; field to &lt;code&gt;5&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s look at the list of game servers again. Run &lt;code&gt;watch kubectl get gs&lt;/code&gt;
until you can see that are 5 ready server instances:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE     ADDRESS        PORT    NODE         AGE
simple-game-server-mzhrl-7jpkp   Ready     10.30.64.100   7019    minikube     5m
simple-game-server-mzhrl-czt8v   Ready     10.30.64.168   7556    minikube     5m
simple-game-server-mzhrl-k6jg5   Ready     10.30.64.100   7243    minikube     5m
simple-game-server-mzhrl-nb8h2   Ready     10.30.64.168   7357    minikube     5m
simple-game-server-mzhrl-qspb6   Ready     10.30.64.99    7859    minikube     5m
simple-game-server-mzhrl-zg9rq   Ready     10.30.64.99    7745    minikube     5m
&lt;/code&gt;&lt;/pre&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;

    &lt;p&gt;If you want to update a &lt;code&gt;Fleet&lt;/code&gt; which has &lt;code&gt;RollingUpdate&lt;/code&gt; replacement strategy and is controlled by a &lt;code&gt;FleetAutoscaler&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;With &lt;code&gt;kubectl apply&lt;/code&gt;: you should omit &lt;code&gt;replicas&lt;/code&gt; parameter in a &lt;code&gt;Fleet&lt;/code&gt; Spec before re-applying the &lt;code&gt;Fleet&lt;/code&gt; configuration.&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;kubectl edit&lt;/code&gt;: you should not change the &lt;code&gt;replicas&lt;/code&gt; parameter in the &lt;code&gt;Fleet&lt;/code&gt; Spec when updating other field parameters.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you follow the rules above, then the &lt;code&gt;maxSurge&lt;/code&gt; and &lt;code&gt;maxUnavailable&lt;/code&gt; parameters will be used as the RollingUpdate strategy updates your Fleet.
Otherwise the Fleet would be scaled according to Fleet &lt;code&gt;replicas&lt;/code&gt; parameter first and only after a certain amount of time it would be rescaled to fit &lt;code&gt;FleetAutoscaler&lt;/code&gt; &lt;code&gt;BufferSize&lt;/code&gt; parameter.&lt;/p&gt;
&lt;p&gt;You could also check the behaviour of the Fleet with Fleetautoscaler on a test &lt;code&gt;Fleet&lt;/code&gt; to preview what would occur in your production environment.&lt;/p&gt;


&lt;/div&gt;

&lt;h2 id=&#34;next-steps&#34;&gt;Next Steps&lt;/h2&gt;
&lt;p&gt;Read the advanced &lt;a href=&#34;/site/site/docs/advanced/scheduling-and-autoscaling/&#34;&gt;Scheduling and Autoscaling&lt;/a&gt; guide, for more details on autoscaling.&lt;/p&gt;
&lt;p&gt;If you want to use your own GameServer container make sure you have properly integrated the &lt;a href=&#34;/site/site/docs/guides/client-sdks/&#34;&gt;Agones SDK&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Quickstart: Create a Fleet Autoscaler with Webhook Policy</title>
      <link>/site/docs/getting-started/create-webhook-fleetautoscaler/</link>
      <pubDate>Wed, 02 Jan 2019 06:42:44 +0000</pubDate>
      
      <guid>/site/docs/getting-started/create-webhook-fleetautoscaler/</guid>
      <description>
        
        
        &lt;p&gt;In some cases, your game servers may need to use custom logic for scaling your fleet that is more complex than what
can be expressed using the Buffer policy in the fleetautoscaler. This guide shows how you can extend Agones
with an autoscaler webhook to implement a custom autoscaling policy.&lt;/p&gt;
&lt;p&gt;When you use an autoscaler webhook the logic computing the number of target replicas is delegated to an external
HTTP/S endpoint, such as one provided by a Kubernetes deployment and service in the same cluster (as shown in the
examples below). The fleetautoscaler will send a request to the webhook autoscaler&amp;rsquo;s &lt;code&gt;/scale&lt;/code&gt; endpoint every sync
period (currently 30s) with a JSON body, and scale the target fleet based on the data that is returned.&lt;/p&gt;
&lt;h2 id=&#34;chapter-1-configuring-http-fleetautoscaler-webhook&#34;&gt;Chapter 1 Configuring HTTP fleetautoscaler webhook&lt;/h2&gt;
&lt;h3 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h3&gt;
&lt;p&gt;It is assumed that you have completed the instructions to &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/&#34;&gt;Create a Game Server Fleet&lt;/a&gt; and have a running fleet of game servers.&lt;/p&gt;
&lt;h3 id=&#34;objectives&#34;&gt;Objectives&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Run a fleet&lt;/li&gt;
&lt;li&gt;Deploy the Webhook Pod and service for autoscaling&lt;/li&gt;
&lt;li&gt;Create a Fleet Autoscaler with Webhook policy type in Kubernetes using Agones custom resource&lt;/li&gt;
&lt;li&gt;Watch the Fleet scales up when allocating GameServers&lt;/li&gt;
&lt;li&gt;Watch the Fleet scales down after GameServer shutdown&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;1-deploy-the-fleet&#34;&gt;1. Deploy the fleet&lt;/h4&gt;
&lt;p&gt;Run a fleet in a cluster:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/fleet.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;2-deploy-a-webhook-service-for-autoscaling&#34;&gt;2. Deploy a Webhook service for autoscaling&lt;/h4&gt;
&lt;p&gt;In this step we would deploy an example webhook that will control the size of the fleet based on allocated gameservers
portion in a fleet. You can see the source code for this example webhook server 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.35.0/examples/autoscaler-webhook/main.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;here&lt;/a&gt;
.
The fleetautoscaler would trigger this endpoint every 30 seconds. More details could be found 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.35.0/examples/autoscaler-webhook/&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;also here&lt;/a&gt;
.
We need to create a pod which will handle HTTP requests with json payload
&lt;a href=&#34;/site/site/docs/reference/fleetautoscaler/#webhook-endpoint-specification&#34;&gt;&lt;code&gt;FleetAutoscaleReview&lt;/code&gt;&lt;/a&gt; and return back it
with &lt;a href=&#34;/site/site/docs/reference/fleetautoscaler/#webhook-endpoint-specification&#34;&gt;&lt;code&gt;FleetAutoscaleResponse&lt;/code&gt;&lt;/a&gt; populated.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Scale&lt;/code&gt; flag and &lt;code&gt;Replicas&lt;/code&gt; values returned in the &lt;code&gt;FleetAutoscaleResponse&lt;/code&gt; tells the FleetAutoscaler what target size the backing Fleet should be scaled up or down to. If &lt;code&gt;Scale&lt;/code&gt; is false - no scaling occurs.&lt;/p&gt;
&lt;p&gt;Run next command to create a service and a Webhook pod in a cluster:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/autoscaler-webhook/autoscaler-service.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To check that it is running and liveness probe is fine:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe pod autoscaler-webhook
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Name:           autoscaler-webhook-86944884c4-sdtqh
Namespace:      default
Node:           gke-test-cluster-default-1c5dec79-h0tq/10.138.0.2
...
Status:         Running
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;3-create-a-fleet-autoscaler&#34;&gt;3. Create a Fleet Autoscaler&lt;/h4&gt;
&lt;p&gt;Let&amp;rsquo;s create a Fleet Autoscaler using the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/webhookfleetautoscaler.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see a successful output similar to this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fleetautoscaler.autoscaling.agones.dev &amp;#34;webhook-fleet-autoscaler&amp;#34; created
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This has created a FleetAutoscaler record inside Kubernetes.
It has the link to Webhook service we deployed above.&lt;/p&gt;
&lt;h4 id=&#34;4-see-the-fleet-and-autoscaler-status&#34;&gt;4. See the fleet and autoscaler status.&lt;/h4&gt;
&lt;p&gt;In order to track the list of gameservers which run in your fleet you can run this command in a separate terminal tab:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt; watch &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;kubectl get gs -n default&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In order to get autoscaler status use the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler webhook-fleet-autoscaler
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It should look something like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Name:         webhook-fleet-autoscaler
Namespace:    default
Labels:       &amp;lt;none&amp;gt;
Annotations:  kubectl.kubernetes.io/last-applied-configuration={&amp;#34;apiVersion&amp;#34;:
&amp;#34;autoscaling.agones.dev/v1&amp;#34;,&amp;#34;kind&amp;#34;:&amp;#34;FleetAutoscaler&amp;#34;,&amp;#34;metadata&amp;#34;:{&amp;#34;annotations&amp;#34;
:{},&amp;#34;name&amp;#34;:&amp;#34;webhook-fleet-autoscaler&amp;#34;,&amp;#34;namespace&amp;#34;:&amp;#34;default...
API Version:  autoscaling.agones.dev/v1
Kind:         FleetAutoscaler
etadata:
  Cluster Name:
  Creation Timestamp:  2018-12-22T12:52:23Z
  Generation:          1
  Resource Version:    2274579
  Self Link:           /apis/autoscaling.agones.dev/v1/namespaces/default/fleet
autoscalers/webhook-fleet-autoscaler
  UID:                 6d03eae4-05e8-11e9-84c2-42010a8a01c9
Spec:
  Fleet Name:  simple-game-server
  Policy:
    Type:  Webhook
    Webhook:
      Service:
        Name:       autoscaler-webhook-service
        Namespace:  default
        Path:       scale
      URL:
Status:
  Able To Scale:     true
  Current Replicas:  2
  Desired Replicas:  2
  Last Scale Time:   &amp;lt;nil&amp;gt;
  Scaling Limited:   false
Events:              &amp;lt;none&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see the status (able to scale, not limited), the last time the fleet was scaled (nil for never), current and desired fleet size.&lt;/p&gt;
&lt;p&gt;The autoscaler makes a query to a webhoook service deployed on step 1 and on response changing the target Replica size, and the fleet creates/deletes game server instances
to achieve that number. The convergence is achieved in time, which is usually measured in seconds.&lt;/p&gt;
&lt;h4 id=&#34;5-allocate-game-servers-from-the-fleet-to-trigger-scale-up&#34;&gt;5. Allocate Game Servers from the Fleet to trigger scale up&lt;/h4&gt;
&lt;p&gt;If you&amp;rsquo;re interested in more details for game server allocation, you should consult the &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/&#34;&gt;Create a Game Server Fleet&lt;/a&gt; page.
Here we only interested in triggering allocations to see the autoscaler in action.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/gameserverallocation.yaml -o yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should get in return the allocated game server details, which should end with something like:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;status:
  address: 34.94.118.237
  gameServerName: simple-game-server-v6jwb-6bzkz
  nodeName: gke-test-cluster-default-f11755a7-5km3
  ports:
  - name: default
    port: 7832
  state: Allocated
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Note the address and port, you might need them later to connect to the server.&lt;/p&gt;
&lt;p&gt;Run the kubectl command one more time so that we have both servers allocated:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/gameserverallocation.yaml -o yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;6-check-new-autoscaler-and-fleet-status&#34;&gt;6. Check new Autoscaler and Fleet status&lt;/h4&gt;
&lt;p&gt;Now let&amp;rsquo;s wait a few seconds to allow the autoscaler to detect the change in the fleet and check again its status&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler webhook-fleet-autoscaler
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last part should look similar to this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Spec:
  Fleet Name:  simple-game-server
  Policy:
    Type:  Webhook
    Webhook:
      Service:
        Name:       autoscaler-webhook-service
        Namespace:  default
        Path:       scale
      URL:
Status:
  Able To Scale:     true
  Current Replicas:  4
  Desired Replicas:  4
  Last Scale Time:   2018-12-22T12:53:47Z
  Scaling Limited:   false
Events:
  Type    Reason            Age   From                        Message
  ----    ------            ----  ----                        -------
  Normal  AutoScalingFleet  35s   fleetautoscaler-controller  Scaling fleet simple-game-server from 2 to 4
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see that the fleet size has increased in particular case doubled to 4 gameservers (based on our custom logic in our webhook), the autoscaler having compensated for the two allocated instances.
Last Scale Time has been updated and a scaling event has been logged.&lt;/p&gt;
&lt;p&gt;Double-check the actual number of game server instances and status by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt; kubectl get gs -n default
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will get you a list of all the current &lt;code&gt;GameServers&lt;/code&gt; and their &lt;code&gt;Status &amp;gt; State&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                     STATE       ADDRESS         PORT     NODE        AGE
simple-game-server-dmkp4-8pkk2   Ready       35.247.13.175   7386     minikube     5m
simple-game-server-dmkp4-b7x87   Allocated   35.247.13.175   7219     minikube     5m
simple-game-server-dmkp4-r4qtt   Allocated   35.247.13.175   7220     minikube     5m
simple-game-server-dmkp4-rsr6n   Ready       35.247.13.175   7297     minikube     5m
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;7-check-downscaling-using-webhook-autoscaler-policy&#34;&gt;7. Check downscaling using Webhook Autoscaler policy&lt;/h4&gt;
&lt;p&gt;Based on our custom webhook deployed earlier, if the fraction of allocated replicas in whole Replicas count would be less than threshold (0.3) then the fleet would scale down by scaleFactor, in our example by 2.&lt;/p&gt;
&lt;p&gt;Note that the example webhook server has a limitation that it would not decrease fleet replica count under &lt;code&gt;minReplicasCount&lt;/code&gt;, which is equal to 2.&lt;/p&gt;
&lt;p&gt;We need to run EXIT command on one gameserver (Use IP address and port of the allocated gameserver from the previous step) in order to decrease the number of allocated gameservers in a fleet (&amp;lt;0.3).&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nc -u 35.247.13.175 7220
EXIT
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Server would be in shutdown state.
Wait about 30 seconds.
Then you should see scaling down event in the output of next command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler webhook-fleet-autoscaler
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see these lines in events:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  Normal   AutoScalingFleet  11m                fleetautoscaler-controller  Scaling fleet simple-game-server from 2 to 4
  Normal   AutoScalingFleet  1m                 fleetautoscaler-controller  Scaling fleet simple-game-server from 4 to 2
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And get gameservers command output:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gs -n default
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATUS      ADDRESS          PORT     NODE       AGE
simple-game-server-884fg-6q5sk   Ready       35.247.117.202   7373     minikube   5m
simple-game-server-884fg-b7l58   Allocated   35.247.117.202   7766     minikube   5m
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;8-cleanup&#34;&gt;8. Cleanup&lt;/h4&gt;
&lt;p&gt;You can delete the autoscaler service and associated resources with the following commands.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/autoscaler-webhook/autoscaler-service.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Removing the fleet:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/fleet.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;chapter-2-configuring-https-fleetautoscaler-webhook-with-ca-bundle&#34;&gt;Chapter 2 Configuring HTTPS fleetautoscaler webhook with CA Bundle&lt;/h2&gt;
&lt;h3 id=&#34;objectives-1&#34;&gt;Objectives&lt;/h3&gt;
&lt;p&gt;Using TLS and a certificate authority (CA) bundle we can establish trusted communication between Fleetautoscaler and
an HTTPS server running the autoscaling webhook that controls the size of the fleet (Replicas count). The certificate of the
autoscaling webhook must be signed by the CA provided in fleetautoscaler yaml configuration file. Using TLS eliminates
the possibility of a man-in-the-middle attack between the fleetautoscaler and the autoscaling webhook.&lt;/p&gt;
&lt;h4 id=&#34;1-deploy-the-fleet-1&#34;&gt;1. Deploy the fleet&lt;/h4&gt;
&lt;p&gt;Run a fleet in a cluster:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/fleet.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;2-create-x509-root-and-webhook-certificates&#34;&gt;2. Create X509 Root and Webhook certificates&lt;/h4&gt;
&lt;p&gt;The procedure of generating a Self-signed CA certificate is as follows:&lt;/p&gt;
&lt;p&gt;The first step is to create the private root key:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;openssl genrsa -out rootCA.key &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;2048&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The next step is to self-sign this certificate:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;openssl req -x509 -new -nodes -key rootCA.key -sha256 -days &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1024&lt;/span&gt; -out rootCA.pem
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will start an interactive script that will ask you for various bits of information. Fill it out as you see fit.&lt;/p&gt;
&lt;p&gt;Every webhook that you wish to install a trusted certificate will need to go through this process. First, just like with the root CA step, you’ll need to create a private key (different from the root CA):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;openssl genrsa -out webhook.key &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;2048&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next create configuration file &lt;code&gt;cert.conf&lt;/code&gt; for the certificate signing request:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-none&#34; data-lang=&#34;none&#34;&gt;[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = autoscaler-tls-service.default.svc
[v3_req]
keyUsage = digitalSignature
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = autoscaler-tls-service.default.svc
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Generate the certificate signing request, use valid hostname which in this case will be &lt;code&gt;autoscaler-tls-service.default.svc&lt;/code&gt; as &lt;code&gt;Common Name (eg, fully qualified host name)&lt;/code&gt; as well as &lt;code&gt;DNS.1&lt;/code&gt; in the &lt;code&gt;alt_names&lt;/code&gt; section of the config file.&lt;/p&gt;
&lt;p&gt;Check the &lt;a href=&#34;https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records&#34;&gt;Kubernetes documentation&lt;/a&gt; to see how Services get assigned DNS entries.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;openssl req -new -out webhook.csr -key webhook.key -config cert.conf
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once that’s done, you’ll sign the CSR, which requires the CA root key:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;openssl x509 -req -in webhook.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out webhook.crt -days &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;500&lt;/span&gt; -sha256 -extfile cert.conf -extensions v3_req
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This would generate webhook.crt certificate&lt;/p&gt;
&lt;p&gt;Add secret which later would be mounted to autoscaler-webhook-tls pod.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl create secret tls autoscalersecret --cert&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;webhook.crt --key&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;webhook.key
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You need to put Base64-encoded string into caBundle field in your fleetautoscaler yaml configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;base64 -i ./rootCA.pem
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Copy the output of the command above and replace the caBundle field in your text editor (say vim) with the new value:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;wget https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/webhookfleetautoscalertls.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;vim ./webhookfleetautoscalertls.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;3-deploy-a-webhook-service-for-autoscaling&#34;&gt;3. Deploy a Webhook service for autoscaling&lt;/h4&gt;
&lt;p&gt;Run next command to create a service and a Webhook pod in a cluster:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/autoscaler-webhook/autoscaler-service-tls.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To check that it is running and liveness probe is fine:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe pod autoscaler-webhook-tls
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Wait for the Running status results:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Name:               autoscaler-webhook-tls-f74c9bff7-ssrsc
Namespace:          default
...
Status:         Running
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;4-create-a-fleet-autoscaler&#34;&gt;4. Create a Fleet Autoscaler&lt;/h4&gt;
&lt;p&gt;Let&amp;rsquo;s create a Fleet Autoscaler using the following command (caBundle should be set properly on Step 2):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f ./webhookfleetautoscalertls.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;5-see-the-fleet-and-autoscaler-status&#34;&gt;5. See the fleet and autoscaler status.&lt;/h4&gt;
&lt;p&gt;In order to track the list of gameservers which run in your fleet you can run this command in a separate terminal tab:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt; watch &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;kubectl get gs -n default&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;6-allocate-two-game-servers-from-the-fleet-to-trigger-scale-up&#34;&gt;6. Allocate two Game Servers from the Fleet to trigger scale up&lt;/h4&gt;
&lt;p&gt;If you&amp;rsquo;re interested in more details for game server allocation, you should consult the &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/&#34;&gt;Create a Game Server Fleet&lt;/a&gt; page.
Here we only interested in triggering allocations to see the autoscaler in action.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; i in &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;{&lt;/span&gt;0..1&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;}&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;do&lt;/span&gt; kubectl create -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/gameserverallocation.yaml -o yaml &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;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;7-check-new-autoscaler-and-fleet-status&#34;&gt;7. Check new Autoscaler and Fleet status&lt;/h4&gt;
&lt;p&gt;Now let&amp;rsquo;s wait a few seconds to allow the autoscaler to detect the change in the fleet and check again its status&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler  webhook-fleetautoscaler-tls
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The last part should look similar to this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Spec:
  Fleet Name:  simple-game-server
  Policy:
    Type:  Webhook
    Webhook:
      Ca Bundle:  LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN1RENDQWFBQ0NRQ29kcEFNbTlTd0pqQU5CZ2txaGtpRzl3MEJBUXNGQURBZU1Rc3dDUVlEVlFRR0V3SlYKVXpFUE1BMEdBMVVFQ3d3R1FXZHZibVZ6TUI0WERURTVNREV3TkRFeE5URTBORm9YRFRJeE1UQXlOREV4TlRFMApORm93SGpFTE1Ba0dBMVVFQmhNQ1ZWTXhEekFOQmdOVkJBc01Ca0ZuYjI1bGN6Q0NBU0l3RFFZSktvWklodmNOCkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFOQ0h5dndDOTZwZDlTdkFhMUIvRWg2ekcxeDBLS1dPaVhtNzhJcngKKzZ5WHd5YVpsMVo1cVExbUZoOThMSGVZUmQwWVgzRTJnelZ5bFpvUlUra1ZESzRUc0VzV0tNUFVpdVo0MUVrdApwbythbEN6alAyaXZzRGZaOGEvdnByL3dZZ2FrWGtWalBUaGpKUk9xTnFIdWROMjZVcUFJYnNOTVpoUkxkOVFFCnFLSjRPNmFHNVMxTVNqZFRGVHFlbHJiZitDcXNKaHltZEIzZmxGRUVvdXExSmoxS0RoQjRXWlNTbS9VSnpCNkcKNHUzY3BlQm1jTFVRR202ZlFHb2JFQSt5SlpMaEVXcXBrd3ZVZ2dCNmRzWE8xZFNIZXhhZmlDOUVUWGxVdFRhZwo1U2JOeTVoYWRWUVV3Z253U0J2djR2R0t1UUxXcWdXc0JyazB5Wll4Sk5Bb0V5RUNBd0VBQVRBTkJna3Foa2lHCjl3MEJBUXNGQUFPQ0FRRUFRMkgzaWJRcWYzQTNES2l1eGJISURkbll6TlZ2Z0dhRFpwaVZyM25ocm55dmxlNVgKR09hRm0rMjdRRjRWV29FMzZDTGhYZHpEWlM4bEpIY09YUW5KOU83Y2pPYzkxVmh1S2NmSHgwS09hU1oweVNrVAp2bEtXazlBNFdoNGE0QXFZSlc3Z3BUVHR1UFpydnc4VGsvbjFaWEZOYVdBeDd5RU5OdVdiODhoNGRBRDVaTzRzCkc5SHJIdlpuTTNXQzFBUXA0Q3laRjVyQ1I2dkVFOWRkUmlKb3IzM3pLZTRoRkJvN0JFTklZZXNzZVlxRStkcDMKK0g4TW5LODRXeDFUZ1N5Vkp5OHlMbXFpdTJ1aThjaDFIZnh0OFpjcHg3dXA2SEZLRlRsTjlBeXZUaXYxYTBYLwpEVTk1eTEwdi9oTlc0WHpuMDJHNGhrcjhzaUduSEcrUEprT3hBdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
      Service:    &amp;lt;nil&amp;gt;
      URL:        https://autoscaler-tls-service.default.svc:8000/scale
Events:
  Type    Reason            Age   From                        Message
  ----    ------            ----  ----                        -------
  Normal  AutoScalingFleet  5s   fleetautoscaler-controller  Scaling fleet simple-game-server from 2 to 4
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see that the fleet size has increased in particular case doubled to 4 gameservers (based on our custom logic in our webhook), the autoscaler having compensated for the two allocated instances.
Last Scale Time has been updated and a scaling event has been logged.&lt;/p&gt;
&lt;p&gt;Double-check the actual number of game server instances and status by running:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt; kubectl get gs -n default
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will get you a list of all the current &lt;code&gt;GameServers&lt;/code&gt; and their &lt;code&gt;Status &amp;gt; State&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                     STATE       ADDRESS         PORT      NODE      AGE
simple-game-server-njmr7-2t4nx   Ready       35.203.159.68   7330      minikube   1m
simple-game-server-njmr7-65rp6   Allocated   35.203.159.68   7294      minikube   4m
&lt;/code&gt;&lt;/pre&gt;&lt;h4 id=&#34;8-cleanup-1&#34;&gt;8. Cleanup&lt;/h4&gt;
&lt;p&gt;You can delete the autoscaler service and associated resources with the following commands.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/autoscaler-webhook/autoscaler-service-tls.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Removing x509 key secret:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl delete secret autoscalersecret
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Removing the fleet:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl delete -f https://raw.githubusercontent.com/googleforgames/agones/release-1.35.0/examples/simple-game-server/fleet.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;comments&#34;&gt;Comments&lt;/h3&gt;
&lt;p&gt;Note that secure communication has been established and we can trust that communication between the fleetautoscaler and
the autoscaling webhook. If you need to run the autoscaling webhook outside of the Kubernetes cluster, you can use
another root certificate authority as long as you put it into the caBundle parameter in fleetautoscaler configuration
(in pem format, base64-encoded).&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting-guide&#34;&gt;Troubleshooting Guide&lt;/h2&gt;
&lt;p&gt;If you run into problems with the configuration of your fleetautoscaler and webhook service the easiest way to debug
them is to run:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe fleetautoscaler &amp;lt;FleetAutoScalerName&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and inspect the events at the bottom of the output.&lt;/p&gt;
&lt;h3 id=&#34;common-error-messages&#34;&gt;Common error messages.&lt;/h3&gt;
&lt;p&gt;If you have configured the wrong service Path for the FleetAutoscaler you will see a message like&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Error calculating desired fleet size on FleetAutoscaler simple-fleet-r7fdv-autoscaler. Error: bad status code 404 from the server: https://autoscaler-tls-service.default.svc:8000/scale
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you are using a hostname other than &lt;code&gt;autoscaler-tls-service.default.svc&lt;/code&gt; as the
&lt;code&gt;Common Name (eg, fully qualified host name)&lt;/code&gt; when creating a certificate using &lt;code&gt;openssl&lt;/code&gt; tool you will see a
message like&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Post https://autoscaler-tls-service.default.svc:8000/scale: x509: certificate is not valid for any names, but wanted to match autoscaler-tls-service.default.svc
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you see errors like the following in &lt;code&gt;autoscaler-webhook-tls&lt;/code&gt; pod logs:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;http: TLS handshake error from 10.48.3.125:33374: remote error: tls: bad certificate
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then there could be an issue with your &lt;code&gt;./rootCA.pem&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can repeat the process from step 2, in order to fix your certificates setup.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next Steps&lt;/h2&gt;
&lt;p&gt;Read the advanced &lt;a href=&#34;/site/site/docs/advanced/scheduling-and-autoscaling/&#34;&gt;Scheduling and Autoscaling&lt;/a&gt; guide, for more details on autoscaling.&lt;/p&gt;
&lt;p&gt;If you want to use your own GameServer container make sure you have properly integrated the &lt;a href=&#34;/site/site/docs/guides/client-sdks/&#34;&gt;Agones SDK&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Quickstart: Edit a Game Server</title>
      <link>/site/docs/getting-started/edit-first-gameserver-go/</link>
      <pubDate>Wed, 02 Jan 2019 06:42:56 +0000</pubDate>
      
      <guid>/site/docs/getting-started/edit-first-gameserver-go/</guid>
      <description>
        
        
        &lt;p&gt;This guide addresses Google Kubernetes Engine and Minikube.  We would welcome a Pull Request to expand this to include other platforms as well.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;A &lt;a href=&#34;https://golang.org/dl/&#34;&gt;Go&lt;/a&gt; environment&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.docker.com/get-started/&#34;&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Agones installed on GKE or Minikube&lt;/li&gt;
&lt;li&gt;kubectl properly configured&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To install on GKE, follow the install instructions (if you haven&amp;rsquo;t already) at
&lt;a href=&#34;/site/site/docs/installation/creating-cluster/gke/&#34;&gt;Setting up a Google Kubernetes Engine (GKE) cluster&lt;/a&gt;.
Also complete the &amp;ldquo;Enabling creation of RBAC resources&amp;rdquo; and &amp;ldquo;Installing Agones&amp;rdquo; sets of instructions on the same page.&lt;/p&gt;
&lt;p&gt;To install locally on Minikube, read &lt;a href=&#34;/site/site/docs/installation/creating-cluster/minikube/&#34;&gt;Setting up a Minikube cluster&lt;/a&gt;.
Also complete the &amp;ldquo;Enabling creation of RBAC resources&amp;rdquo; and &amp;ldquo;Installing Agones&amp;rdquo; sets of instructions on the same page.&lt;/p&gt;
&lt;h2 id=&#34;modify-the-code-and-push-another-new-image&#34;&gt;Modify the code and push another new image&lt;/h2&gt;
&lt;h3 id=&#34;modify-the-simple-game-server-example-source-code&#34;&gt;Modify the simple-game-server example source code&lt;/h3&gt;
&lt;p&gt;Modify the 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.35.0/examples/simple-game-server/main.go&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;main.go&lt;/a&gt;
 file. For example:&lt;/p&gt;
&lt;p&gt;Change the following line in &lt;code&gt;main.go&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;From:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;respond&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;conn&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;sender&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;ACK: &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;txt&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;#34;\n&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;respond&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;conn&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;sender&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;ACK: Echo says &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;txt&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;#34;\n&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;build-server&#34;&gt;Build Server&lt;/h3&gt;
&lt;p&gt;Since Docker image is using Alpine Linux, the &amp;ldquo;go build&amp;rdquo; command has to include few more environment variables.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;go get agones.dev/agones/pkg/sdk
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;GOOS&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;linux &lt;span style=&#34;color:#000&#34;&gt;GOARCH&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;amd64 &lt;span style=&#34;color:#000&#34;&gt;CGO_ENABLED&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt; go build -o bin/server -a -v main.go
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;using-docker-file&#34;&gt;Using Docker File&lt;/h2&gt;
&lt;h3 id=&#34;create-a-new-docker-image&#34;&gt;Create a new docker image&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;docker build -t gcr.io/&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;[&lt;/span&gt;PROJECT_ID&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;]&lt;/span&gt;/agones-simple-game-server:modified .
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note: you can change the image name &amp;ldquo;agones-simple-game-server&amp;rdquo; to something else.&lt;/p&gt;
&lt;h3 id=&#34;if-using-gke-push-the-image-to-gcp-registry&#34;&gt;If using GKE, push the image to GCP Registry&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;docker push gcr.io/&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;[&lt;/span&gt;PROJECT_ID&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;]&lt;/span&gt;/agones-simple-game-server:modified
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note: Review &lt;a href=&#34;https://cloud.google.com/container-registry/docs/advanced-authentication&#34;&gt;Authentication Methods&lt;/a&gt;
for additional information regarding use of gcloud as a Docker credential helper
and advanced authentication methods to the Google Container Registry.&lt;/p&gt;
&lt;h3 id=&#34;if-using-minikube-load-the-image-into-minikube&#34;&gt;If using Minikube, load the image into Minikube&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;minikube cache add gcr.io/&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;[&lt;/span&gt;PROJECT_ID&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;]&lt;/span&gt;/agones-agones-simple-game-server:modified
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;modify-gameserveryaml&#34;&gt;Modify gameserver.yaml&lt;/h3&gt;
&lt;p&gt;Modify the following line from gameserver.yaml to use the new configuration.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;agones-simple-game-server&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#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;gcr.io/[PROJECT_ID]/agones-simple-game-server:modified&lt;/span&gt;&lt;span style=&#34;color:#f8f8f8;text-decoration:underline&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;if-using-gke-deploy-server-to-gke&#34;&gt;If using GKE, deploy Server to GKE&lt;/h3&gt;
&lt;p&gt;Apply the latest settings to the Kubernetes container.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;gcloud config &lt;span style=&#34;color:#204a87&#34;&gt;set&lt;/span&gt; container/cluster &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;[&lt;/span&gt;CLUSTER_NAME&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;gcloud container clusters get-credentials &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;[&lt;/span&gt;CLUSTER_NAME&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f gameserver.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;if-using-minikube-deploy-the-server-to-minikube&#34;&gt;If using Minikube, deploy the Server to Minikube&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl apply -f gameserver.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;check-the-gameserver-status&#34;&gt;Check the GameServer Status&lt;/h3&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl describe gameserver
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;verify&#34;&gt;Verify&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s retrieve the IP address and the allocated port of your Game Server:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; 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;display:flex;&#34;&gt;&lt;span&gt;kubectl get gs simple-game-server -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.address}:{.status.ports[0].port}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can now communicate with the Game Server :&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;

    If you do not have netcat installed
(i.e. you get a response of &lt;code&gt;nc: command not found&lt;/code&gt;),
you can install netcat by running &lt;code&gt;sudo apt install netcat&lt;/code&gt;.

&lt;/div&gt;

&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;nc -u {IP} {PORT}
Hello World!
ACK:  Echo says  Hello World!
EXIT
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can finally type &lt;code&gt;EXIT&lt;/code&gt; which tells the SDK to run the &lt;a href=&#34;/site/site/docs/guides/client-sdks/#shutdown&#34;&gt;Shutdown command&lt;/a&gt;, and therefore shuts down the &lt;code&gt;GameServer&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you run &lt;code&gt;kubectl describe gameserver&lt;/code&gt; again - either the GameServer will be gone completely, or it will be in &lt;code&gt;Shutdown&lt;/code&gt; state, on the way to being deleted.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next Steps&lt;/h2&gt;
&lt;p&gt;If you want to perform rolling updates of modified game servers, see &lt;a href=&#34;/site/site/docs/getting-started/create-fleet/&#34;&gt;Quickstart Create a Game Server Fleet&lt;/a&gt;.&lt;/p&gt;

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