<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Agones – Examples</title>
    <link>/site/docs/examples/</link>
    <description>Recent content in Examples on Agones</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 03 Jan 2019 05:05:47 +0000</lastBuildDate>
    
	  <atom:link href="/site/docs/examples/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Docs: Custom Controller for Agones Game Servers</title>
      <link>/site/docs/examples/custom-controller/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/site/docs/examples/custom-controller/</guid>
      <description>
        
        
        &lt;h2 id=&#34;prerequisite&#34;&gt;Prerequisite&lt;/h2&gt;
&lt;p&gt;To get started, ensure the following prerequisites are met:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You have a running Kubernetes cluster.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Agones is installed on your cluster. Refer &lt;a href=&#34;https://agones.dev/site/docs/installation/install-agones/&#34;&gt;Agones guide&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Review 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.39.0/examples/custom-controller&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;Custom Controller code&lt;/a&gt;
 to see the details of this example.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-a-custom-controller&#34;&gt;Create a Custom Controller&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s create a custom controller on your cluster 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.39.0/examples/custom-controller/deployment.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When you run this command, it quickly sets up your controller by doing four things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sets up the appropriate &lt;a href=&#34;https://kubernetes.io/docs/reference/access-authn-authz/rbac/&#34;&gt;RBAC&lt;/a&gt; permissions for the custom controller&lt;/li&gt;
&lt;li&gt;Launching two controllers for reliability, with leader election setup between them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;verify-the-controller&#34;&gt;Verify the Controller&lt;/h2&gt;
&lt;p&gt;To ensure the custom controller is operational, execute the following command. You should see two instances of the controller actively running with the prefix &lt;code&gt;custom-controller&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 pods -n agones-system
&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;NAME                                 READY   STATUS    RESTARTS   AGE
custom-controller-74c798cfd8-ld6wk   1/1     Running   0          84s
custom-controller-74c798cfd8-whpp2   1/1     Running   0          84s
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;create-a-fleet&#34;&gt;Create a Fleet&lt;/h2&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.39.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 ready &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;h2 id=&#34;monitor-the-log-events-for-the-custom-controller-pod&#34;&gt;Monitor the log events for the custom controller pod&lt;/h2&gt;
&lt;p&gt;To monitor the logs of the custom controller during the creation, modification, and deletion of game servers, 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 logs -f deployments/custom-controller -n agones-system
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If this controller fails for any reason, we&amp;rsquo;ve also implemented leader election such that the backup controller will automatically assume the leadership role, ensuring uninterrupted logging of event details.&lt;/p&gt;
&lt;h2 id=&#34;cleaning-up&#34;&gt;Cleaning Up&lt;/h2&gt;
&lt;p&gt;When you&amp;rsquo;re done with the Agones fleet and the custom controller, it&amp;rsquo;s a good practice to clean up the resources to prevent unnecessary resource consumption. Follow these steps to remove them:&lt;/p&gt;
&lt;h3 id=&#34;remove-the-fleet&#34;&gt;Remove the Fleet&lt;/h3&gt;
&lt;p&gt;To delete the Agones fleet you deployed, execute the following command. This will remove the fleet along with all the game server instances it manages:&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.39.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;remove-the-custom-controller&#34;&gt;Remove the Custom Controller&lt;/h3&gt;
&lt;p&gt;To remove the custom controller from your cluster, execute the following command. This will delete the deployment that you created earlier.&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.39.0/examples/custom-controller/deployment.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
      </description>
    </item>
    
    <item>
      <title>Docs: Build and Run a Simple Game Server that Connects to an Inference Server</title>
      <link>/site/docs/examples/simple-genai-gameserver/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/site/docs/examples/simple-genai-gameserver/</guid>
      <description>
        
        
        &lt;h2 id=&#34;setting-up-the-genai-inference-server&#34;&gt;Setting up the GenAI Inference Server&lt;/h2&gt;
&lt;p&gt;You will need a separate GenAI inference server. This example uses the
&lt;a href=&#34;https://github.com/googleforgames/GenAI-quickstart&#34;&gt;Google for Games GenAI&lt;/a&gt; as its inference server.
This particular inference server has the request structure for the /chat endpoint:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;type GenAIRequest struct {
	Context         string  `json:&amp;#34;context,omitempty&amp;#34;`
	Prompt          string  `json:&amp;#34;prompt&amp;#34;`
}
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;optional-modify-the-genairequest-structure&#34;&gt;(Optional) Modify the GenAIRequest Structure&lt;/h3&gt;
&lt;p&gt;If you need a different request structure for your GenAI endpoint, you will need to clone or fork the Agones repository and
modify the above &lt;code&gt;GenAIRequest struct&lt;/code&gt; in &lt;a href=&#34;https://github.com/googleforgames/agones/blob/main/examples/simple-genai-server/main.go&#34;&gt;main.go&lt;/a&gt;. Update &lt;code&gt;REPOSITORY&lt;/code&gt; in the
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/main/examples/simple-genai-server/Makefile&#34;&gt;agones/examples/simple-genai-server/Makefile&lt;/a&gt;
to your own container registry and run &lt;code&gt;make build &amp;amp;&amp;amp; make push&lt;/code&gt; from within the
&lt;code&gt;agones/examples/simple-genai-server&lt;/code&gt; path. Then modify the &lt;code&gt;gameserver_*.yaml&lt;/code&gt; to pull the image from
your container registry. If you are making a series of changes you may also want to add
&lt;code&gt;imagePullPolicy: Always&lt;/code&gt; to the container image in &lt;code&gt;gameserver_*.yaml&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;setting-up-agones&#34;&gt;Setting up Agones&lt;/h2&gt;
&lt;p&gt;To set up the Game Servers on a different cluster than the GenAI inference server follow the
instructions for &lt;a href=&#34;https://agones.dev/site/docs/installation/creating-cluster/&#34;&gt;creating a cluster&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you set up a separate cluster for your game servers &lt;a href=&#34;https://agones.dev/site/docs/installation/install-agones/&#34;&gt;install Agones&lt;/a&gt;.
on that cluster, otherwise install Agones into your GenAI inference server cluster.&lt;/p&gt;
&lt;h2 id=&#34;setting-up-the-game-server&#34;&gt;Setting up the Game Server&lt;/h2&gt;
&lt;p&gt;To manually interact with &lt;code&gt;GenAiEndpoint&lt;/code&gt; via netcat, change the &lt;code&gt;GEN_AI_ENDPOINT&lt;/code&gt; value in the
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/main/examples/simple-genai-server/gameserver_manualchat.yaml&#34;&gt;gameserver_manualchat.yaml&lt;/a&gt; file
to your inference server’s endpoint. Optionally, include the &lt;code&gt;GEN_AI_CONTEXT&lt;/code&gt; in the same file that will include the context with
each chat (post request) that you make to the GenAI endpoint.&lt;/p&gt;
&lt;p&gt;To make two clients &amp;ldquo;chat&amp;rdquo; to each other, change the &lt;code&gt;GEN_AI_ENDPOINT&lt;/code&gt; and &lt;code&gt;SIM_ENDPOINT&lt;/code&gt; values in the &lt;a href=&#34;https://github.com/googleforgames/agones/blob/main/examples/simple-genai-server/gameserver_autochat.yaml&#34;&gt;gameserver_autochat.yaml&lt;/a&gt; file
to your inference server&amp;rsquo;s address. You could also create a basic http server that receives requests in the structure noted in the above section,
and returns a predetermined set of responses for the chat. When sending requests, &lt;code&gt;GEN_AI_CONTEXT&lt;/code&gt; is sent to the &lt;code&gt;GEN_AI_ENDPOINT&lt;/code&gt;
and &lt;code&gt;SIM_CONTEXT&lt;/code&gt; is sent to the &lt;code&gt;SIM_ENDPOINT&lt;/code&gt; as part of the GenAIRequest structure. The default values for &lt;code&gt;GEN_AI_CONTEXT&lt;/code&gt; and &lt;code&gt;SIM_CONTEXT&lt;/code&gt;
are empty strings. The conversation starts with a &lt;code&gt;PROMPT&lt;/code&gt; that is sent to the GenAI endpoint, which is also an empty string by default.
&lt;code&gt;NUM_CHATS&lt;/code&gt; determines how many times messages are sent back and forth, with a default value of 1.
It&amp;rsquo;s important to note that the chat between two clients is a rolling conversation, meaning that after completing a conversation of length set by &lt;code&gt;NUM_CHATS&lt;/code&gt;, a new conversation starts. This cycle continues until the game server is deleted using the &lt;code&gt;kubectl delete&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;If you want to set up the chat with the npc-chat-api from the &lt;a href=&#34;https://github.com/googleforgames/GenAI-quickstart/tree/main/genai/api/npc_chat_api&#34;&gt;Google for Games GenAI&lt;/a&gt;,
update the &lt;a href=&#34;https://github.com/googleforgames/agones/blob/main/examples/simple-genai-server/gameserver_npcchat.yaml&#34;&gt;gameserver_npcchat.yaml&lt;/a&gt; file.
Choose between &lt;code&gt;GEN_AI_ENDPOINT&lt;/code&gt; or &lt;code&gt;SIM_ENDPOINT&lt;/code&gt; and set it to &lt;code&gt;http://genai-api.genai.svc/genai/npc_chat&lt;/code&gt; for the NPC service.
Mark either &lt;code&gt;GEN_AI_NPC&lt;/code&gt; or &lt;code&gt;SIM_NPC&lt;/code&gt; as &amp;ldquo;true&amp;rdquo; to indicate it&amp;rsquo;s connected to the NPC service. The &lt;code&gt;NPCRequest&lt;/code&gt; to the NPC endpoint only sends
the message (prompt), so any additional context outside of the prompt is ignored. FROM_ID is the entity sending messages to NPC, and
TO_ID is the entity receiving the message (the NPC ID). A new conversation begins either when it reaches the length &lt;code&gt;NUM_CHATS&lt;/code&gt; or when it reaches the &lt;code&gt;STOP_PHRASE&lt;/code&gt;, whichever happens first.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;type NPCRequest struct {
	Msg    string `json:&amp;#34;message,omitempty&amp;#34;`
	FromId int `json:&amp;#34;from_id,omitempty&amp;#34;`
	ToId   int `json:&amp;#34;to_id,omitempty&amp;#34;`
}
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;running-the-game-server&#34;&gt;Running the Game Server&lt;/h2&gt;
&lt;p&gt;Once you have modified the &lt;code&gt;gameserver_*.yaml&lt;/code&gt; to use your
endpoint(s), apply to your Agones cluster with &lt;code&gt;kubectl apply -f gameserver_autochat.yaml&lt;/code&gt;,
&lt;code&gt;kubectl apply -f gameserver_manualchat.yaml&lt;/code&gt;, or &lt;code&gt;kubectl apply -f gameserver_npcchat&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note that if your inference server is in a different cluster you&amp;rsquo;ll want to make sure you&amp;rsquo;re using
the kubectl context that points to your Agones cluster and not the inference cluster.&lt;/p&gt;
&lt;p&gt;If you set up the &lt;code&gt;gameserver_autochat.yaml&lt;/code&gt; or &lt;code&gt;gameserver_npcchat&lt;/code&gt; the chat will be in the game server logs:&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 logs -f gen-ai-server-auto -c simple-genai-game-server
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In autochat mode, the game server will stay running forever until the game server is deleted.
While running, we keep &lt;code&gt;--ConcurrentPlayers&lt;/code&gt; slots of players running - each simulated player
will initiate a chat and then go until they send &lt;code&gt;--StopPhrase&lt;/code&gt; or until &lt;code&gt;--NumChats&lt;/code&gt;, whichever
comes first, after which a new player will fill the slot.&lt;/p&gt;
&lt;p&gt;If you set up the &lt;code&gt;gameserver_manualchat.yaml&lt;/code&gt; you can manually send requests to the GenAI endpoint.
Retreive the IP address and port:&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 gen-ai-server-manual -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 send requests to the GenAI endpoint:&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 {IP} {PORT}
Enter your prompt for the GenAI server in the same terminal, and the response will appear here too.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After you&amp;rsquo;re done you will need to manually delete the game server &lt;code&gt;kubectl delete gs gen-ai-server-manual&lt;/code&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Docs: Deploying and Running SuperTuxKart Server Using Agones</title>
      <link>/site/docs/examples/supertuxkart/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/site/docs/examples/supertuxkart/</guid>
      <description>
        
        
        &lt;h2 id=&#34;prerequisite&#34;&gt;Prerequisite&lt;/h2&gt;
&lt;p&gt;To get started, ensure the following prerequisites are met:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You have a running Kubernetes cluster.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Agones is installed on your cluster. Refer to the &lt;a href=&#34;https://agones.dev/site/docs/installation/install-agones/&#34;&gt;Agones guide&lt;/a&gt; for the instructions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The SuperTuxKart client downloaded for gameplay. Download it from &lt;a href=&#34;https://supertuxkart.net/Main_Page&#34;&gt;SuperTuxKart&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Review 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.39.0/examples/supertuxkart&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;SuperTuxKart code&lt;/a&gt;
 to see the details of this example.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-a-fleet&#34;&gt;Create a Fleet&lt;/h2&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.39.0/examples/supertuxkart/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/supertuxkart created
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This has created a Fleet record inside Kubernetes, which in turn creates two ready &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
supertuxkart   Packed       2         2         0           2       55s
&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;supertuxkart&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                             STATE       ADDRESS        PORT   NODE                                  AGE
supertuxkart-xfw2g-bwwkb         Ready       34.82.158.69   7421   gke-agon-default-pool-f18c8e90-1f9k   103s
supertuxkart-xfw2g-skdnf         Ready       34.82.158.69   7585   gke-agon-default-pool-f18c8e90-1f9k   103s
&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;h2 id=&#34;connect-to-the-game-server&#34;&gt;Connect to the Game Server&lt;/h2&gt;
&lt;p&gt;After allocating a GameServer from the fleet and obtaining its status and IP, you&amp;rsquo;re ready to connect and play. Here’s how to use the server IP and port to join the game with the SuperTuxKart client:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Launch SuperTuxKart&lt;/strong&gt;: Start the SuperTuxKart client you downloaded earlier by running the executable for your operating system (&lt;a href=&#34;https://supertuxkart.net/FAQ&#34;&gt;documentation&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Navigate to Online Play&lt;/strong&gt;: From the main menu, select the &amp;ldquo;Online&amp;rdquo; option and then select &amp;ldquo;Enter server address&amp;rdquo; from the available options.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enter Server Details&lt;/strong&gt;: In the subsequent screen, you will be prompted to input the IP address and port number in order to join the game. Please enter the IP address and port number obtained from the &lt;code&gt;kubectl get gameservers&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../images/supertuxkart-enter-ip-port.png&#34; alt=&#34;enter ip and port&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Join the Game&lt;/strong&gt;: After entering the server details, proceed to join the server. You should now be connected to your Agones-managed SuperTuxKart game server and ready to play.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../images/supertuxkart-race-start.png&#34; alt=&#34;start race&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Launch the Game with AI Bots&lt;/strong&gt;: To start the server with AI players, use the &lt;code&gt;&amp;lt;executable-script&amp;gt; --connect-now=&amp;lt;IP:port&amp;gt; --network-ai=&amp;lt;number of AIs&amp;gt;&lt;/code&gt; command, substituting &lt;code&gt;&amp;lt;IP:port&amp;gt;&lt;/code&gt; with your server&amp;rsquo;s IP address and port number and &lt;code&gt;&amp;lt;number of AIs&amp;gt;&lt;/code&gt; with the desired number of bots. For more information, refer to the &lt;a href=&#34;https://github.com/supertuxkart/stk-code/blob/master/NETWORKING.md#testing-server&#34;&gt;SuperTuxKart documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../images/supertuxkart-AI-players.png&#34; alt=&#34;race with AI bots&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;cleaning-up&#34;&gt;Cleaning Up&lt;/h2&gt;
&lt;p&gt;After playing SuperTuxKart, it&amp;rsquo;s a good practice to clean up the resources to prevent unnecessary resource consumption. To delete the Agones fleet you deployed, execute the following command. This will remove the fleet along with all the game server instances it manages:&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.39.0/examples/supertuxkart/fleet.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
      </description>
    </item>
    
    <item>
      <title>Docs: Deploying and Running Xonotic Server Using Agones</title>
      <link>/site/docs/examples/xonotic/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/site/docs/examples/xonotic/</guid>
      <description>
        
        
        &lt;h2 id=&#34;prerequisite&#34;&gt;Prerequisite&lt;/h2&gt;
&lt;p&gt;To get started, ensure the following prerequisites are met:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You have a running Kubernetes cluster.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Agones is installed on your cluster. Refer to the &lt;a href=&#34;https://agones.dev/site/docs/installation/install-agones/&#34;&gt;Agones guide&lt;/a&gt; for the instructions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Xonotic client downloaded for gameplay. Download it from &lt;a href=&#34;http://www.xonotic.org&#34;&gt;Xonotic&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Review 
&lt;a href=&#34;https://github.com/googleforgames/agones/blob/release-1.39.0/examples/xonotic&#34; target=&#34;_blank&#34; data-proofer-ignore&gt;Xonotic code&lt;/a&gt;
 to see the details of this example.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-a-fleet&#34;&gt;Create a Fleet&lt;/h2&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.39.0/examples/xonotic/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/xonotic created
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This has created a Fleet record inside Kubernetes, which in turn creates two ready &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
xonotic        Packed       2         2         0           2       55s
&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;xonotic&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;NAME                       STATE   ADDRESS          PORT   NODE                                        AGE
xonotic-7lk8x-hgfrg        Ready   34.71.168.92     7206   gk3-genai-quickstart-pool-3-ba2a705f-wpmc   103s
xonotic-7lk8x-rwhst        Ready   34.71.168.92     7330   gk3-genai-quickstart-pool-3-ba2a705f-wpmc   103s
&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;h2 id=&#34;connect-to-the-game-server&#34;&gt;Connect to the Game Server&lt;/h2&gt;
&lt;p&gt;After allocating a GameServer from the fleet and obtaining its status and IP, you&amp;rsquo;re ready to connect and play. Here’s how to use the server IP and port to join the game with the Xonotic server:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Launch Xonotic&lt;/strong&gt;: Start the Xonotic client you previously downloaded by running the executable for your operating system (&lt;a href=&#34;https://xonotic.org/faq/#install&#34;&gt;documentation&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Multiplayer Mode&lt;/strong&gt;: From the main menu, select &amp;ldquo;Multiplayer&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Server Connection&lt;/strong&gt;: Choose to join a server manually and input the IP and port number you obtained from the &lt;code&gt;kubectl get gameservers&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../images/xonotic-ip-port.png&#34; alt=&#34;Enter IP and Port&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Join the Game&lt;/strong&gt;: After entering the server details, proceed to join the server. You should now be connected to your Agones-managed Xonotic game server and ready to play.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../../images/xonotic-join-game.png&#34; alt=&#34;Join the Game&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;cleaning-up&#34;&gt;Cleaning Up&lt;/h2&gt;
&lt;p&gt;After you&amp;rsquo;re done playing, it&amp;rsquo;s a good idea to clean up. To remove the Agones fleet you deployed, execute the following command. This will remove the fleet along with all the game server instances it manages:&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.39.0/examples/xonotic/fleet.yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
      </description>
    </item>
    
  </channel>
</rss>
