Skip to content

Commit

Permalink
Deploying to gh-pages from @ 36e82a5 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
XAMPPRocky committed Oct 5, 2023
1 parent 73a2646 commit 9ff7a1c
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@
</span><span class="kw">pub const </span>GIT_HEAD_REF: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>str&gt; = <span class="prelude-val">Some</span>(<span class="string">&quot;refs/heads/main&quot;</span>);
<span class="attr">#[doc=<span class="string">r#&quot;If the crate was compiled from within a git-repository, `GIT_COMMIT_HASH` contains HEAD&#39;s full commit SHA-1 hash.&quot;#</span>]
#[allow(dead_code)]
</span><span class="kw">pub const </span>GIT_COMMIT_HASH: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>str&gt; = <span class="prelude-val">Some</span>(<span class="string">&quot;1712f1a3c00b9f16df75c880b77fab868e8edef6&quot;</span>);
</span><span class="kw">pub const </span>GIT_COMMIT_HASH: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>str&gt; = <span class="prelude-val">Some</span>(<span class="string">&quot;36e82a556c909bfb488bbc38d14091952115bd7a&quot;</span>);
<span class="attr">#[doc=<span class="string">r#&quot;If the crate was compiled from within a git-repository, `GIT_COMMIT_HASH_SHORT` contains HEAD&#39;s short commit SHA-1 hash.&quot;#</span>]
#[allow(dead_code)]
</span><span class="kw">pub const </span>GIT_COMMIT_HASH_SHORT: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>str&gt; = <span class="prelude-val">Some</span>(<span class="string">&quot;1712f1a&quot;</span>);
</span><span class="kw">pub const </span>GIT_COMMIT_HASH_SHORT: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>str&gt; = <span class="prelude-val">Some</span>(<span class="string">&quot;36e82a5&quot;</span>);
<span class="attr">#[doc=<span class="string">r#&quot;The target architecture, given by `CARGO_CFG_TARGET_ARCH`.&quot;#</span>]
#[allow(dead_code)]
</span><span class="kw">pub const </span>CFG_TARGET_ARCH: <span class="kw-2">&amp;</span>str = <span class="string">r&quot;x86_64&quot;</span>;
Expand Down
6 changes: 3 additions & 3 deletions main/book/deployment/quickstarts/agones-xonotic-sidecar.html
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ <h2 id="2-play-xonotic"><a class="header" href="#2-play-xonotic">2. Play Xonotic
<code>GameServer</code>, but we'll skip this step for this example.</p>
<p>Choose one of the listed <code>GameServer</code>s from the previous step, and connect to the IP and port of the Xonotic
server via the &quot;Multiplayer &gt; Address&quot; field in the Xonotic client in the format of {IP}:{PORT}.</p>
<p><img src="xonotic-address.png" alt="xonotic-address.png" /></p>
<p><img src="xonotic-address-v6.png" alt="xonotic-address.png" /></p>
<p>You should now be playing a game of Xonotic against 4 bots!</p>
<h2 id="3-check-out-the-metrics"><a class="header" href="#3-check-out-the-metrics">3. Check out the metrics</a></h2>
<p>Let's take a look at some metrics that Quilkin outputs.</p>
<p>Grab the name of the GameServer you connected to before, and replace the <code>${gameserver}</code> value below, and run the
command. This will forward the <a href="../admin.html">admin</a> interface to localhost.</p>
<pre><code class="language-shell">kubectl port-forward ${gameserver} 9091
<pre><code class="language-shell">kubectl port-forward ${gameserver} 8000
</code></pre>
<p>Then open a browser to <a href="http://localhost:9091/metrics">http://localhost:9091/metrics</a> to see the
<p>Then open a browser to <a href="http://localhost:9091/metrics">http://localhost:8000/metrics</a> to see the
<a href="https://prometheus.io/">Prometheus</a> metrics that Quilkin exports.</p>
<h2 id="5-cleanup"><a class="header" href="#5-cleanup">5. Cleanup</a></h2>
<p>Run the following to delete the Fleet and the accompanying ConfigMap:</p>
Expand Down
107 changes: 87 additions & 20 deletions main/book/deployment/quickstarts/agones-xonotic-xds.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ <h2 id="requirements"><a class="header" href="#requirements">Requirements</a></h
</ul>
<h2 id="1-overview"><a class="header" href="#1-overview">1. Overview</a></h2>
<p>In this quickstart, we'll be setting up an example <a href="https://xonotic.org/">Xonotic</a> <a href="https://agones.dev/">Agones</a>
Fleet, that will only be accessible through Quilkin, via utilising the <a href="../../services/proxy/filters/token_router.html">TokenRouter</a>
Filter to provide routing and access control to the Allocated <code>GameServer</code> instances.</p>
Fleet, that will only be accessible through Quilkin that is hosted within the same cluster, utilising the
<a href="../../services/proxy/filters/token_router.html">TokenRouter</a> Filter to provide routing and access control to the Allocated <code>GameServer</code> instances.</p>
<p>To do this, we'll take advantage of the Quilkin <a href="../../services/xds/providers/agones.html">Agones xDS Provider</a> to provide
an out-of-the-box control plane for integration between Agones and <a href="../../services/xds.html">Quilkin's xDS configuration API</a> with
minimal effort.</p>
Expand Down Expand Up @@ -237,15 +237,42 @@ <h2 id="3-install-quilkin-proxy-pool"><a class="header" href="#3-install-quilkin
quilkin-proxies-78965c446d-m4rr7 1/1 Running 0 6s
</code></pre>
<p>Let's take this one step further, and check the configuration of the proxies that should have come from the <code>quilkin manage agones</code> instance.</p>
<p>In another terminal, run: <code>kubectl port-forward deployments/quilkin-proxies 8000</code>, to port forward the
<a href="../admin.html">admin endpoint</a> locally, which we can then query.</p>
<p>Go back to your original terminal and run <code>curl -s http://localhost:8000/config</code></p>
<p>In another terminal, run: <code>kubectl port-forward deployments/quilkin-proxies 8001:8000</code>, to port forward the
<a href="../admin.html">admin endpoint</a> locally to port 8001, which we can then query.</p>
<p>Go back to your original terminal and run <code>curl -s http://localhost:8001/config</code> </p>
<blockquote>
<p>If you have <a href="https://stedolan.github.io/jq/">jq</a> installed, run <code>curl -s http://localhost:8000/config | jq</code> for a
<p>If you have <a href="https://stedolan.github.io/jq/">jq</a> installed, run <code>curl -s http://localhost:8001/config | jq</code> for a
nicely formatted JSON output.</p>
</blockquote>
<pre><code class="language-shell">$ curl -s http://localhost:8000/config
{&quot;admin&quot;:{&quot;address&quot;:&quot;0.0.0.0:8000&quot;},&quot;clusters&quot;:{},&quot;filters&quot;:[{&quot;name&quot;:&quot;quilkin.filters.capture.v1alpha1.Capture&quot;,&quot;config&quot;:{&quot;metadataKey&quot;:&quot;quilkin.dev/capture&quot;,&quot;suffix&quot;:{&quot;size&quot;:3,&quot;remove&quot;:true}}},{&quot;name&quot;:&quot;quilkin.filters.token_router.v1alpha1.TokenRouter&quot;,&quot;config&quot;:null}],&quot;id&quot;:&quot;quilkin-proxies-78965c446d-dqvjg&quot;,&quot;management_servers&quot;:[{&quot;address&quot;:&quot;http://quilkin-manage-agones:80&quot;}],&quot;port&quot;:7000,&quot;version&quot;:&quot;v1alpha1&quot;,&quot;maxmind_db&quot;:null}%
<pre><code class="language-shell">$ curl -s http://localhost:8001/config | jq
{
&quot;clusters&quot;: [
{
&quot;endpoints&quot;: [],
&quot;locality&quot;: null
}
],
&quot;filters&quot;: [
{
&quot;name&quot;: &quot;quilkin.filters.capture.v1alpha1.Capture&quot;,
&quot;label&quot;: null,
&quot;config&quot;: {
&quot;metadataKey&quot;: &quot;quilkin.dev/capture&quot;,
&quot;suffix&quot;: {
&quot;size&quot;: 3,
&quot;remove&quot;: true
}
}
},
{
&quot;name&quot;: &quot;quilkin.filters.token_router.v1alpha1.TokenRouter&quot;,
&quot;label&quot;: null,
&quot;config&quot;: null
}
],
&quot;id&quot;: &quot;quilkin-proxies-7d9bbbccdf-9vd59&quot;,
&quot;version&quot;: &quot;v1alpha1&quot;
}
</code></pre>
<p>This shows us the current configuration of the proxies coming from the xDS server created via <code>quilkin manage agones</code>. The most interesting part that we see here, is that we have a matching set of
<a href="../../services/proxy/filters.html">Filters</a> that are found in the <code>ConfigMap</code> in the
Expand Down Expand Up @@ -298,7 +325,7 @@ <h2 id="5-allocate-a-gameserver"><a class="header" href="#5-allocate-a-gameserve
agones.dev/gameserverset=xonotic-h5cfn
Annotations: agones.dev/last-allocated: 2022-12-19T22:59:22.099818298Z
agones.dev/ready-container-id: containerd://7b3d9e9dbda6f2e0381df7669f6117bf3e54171469cfacbce2670605a61ce4b8
agones.dev/sdk-version: 1.24.0
agones.dev/sdk-version: 1.33.0
quilkin.dev/tokens: NDU2
API Version: agones.dev/v1
Kind: GameServer
Expand All @@ -309,13 +336,52 @@ <h2 id="5-allocate-a-gameserver"><a class="header" href="#5-allocate-a-gameserve
<blockquote>
<p>You should use something more cryptographically random than <code>456</code> in your application.</p>
</blockquote>
<p>Let's run <code>curl -s http://localhost:8000/config</code> again, so we can see what has changed!</p>
<pre><code class="language-shell">$ curl -s http://localhost:8000/config
{&quot;admin&quot;:{&quot;address&quot;:&quot;0.0.0.0:8000&quot;},&quot;clusters&quot;: [{&quot;locality&quot;:null,&quot;endpoints&quot;:[{&quot;address&quot;:&quot;34.168.170.51:7226&quot;,&quot;metadata&quot;:{&quot;quilkin.dev&quot;:{&quot;tokens&quot;:[&quot;NDU2&quot;]}}}]}],&quot;filters&quot;:[{&quot;name&quot;:&quot;quilkin.filters.capture.v1alpha1.Capture&quot;,&quot;config&quot;:{&quot;metadataKey&quot;:&quot;quilkin.dev/capture&quot;,&quot;suffix&quot;:{&quot;size&quot;:3,&quot;remove&quot;:true}}},{&quot;name&quot;:&quot;quilkin.filters.token_router.v1alpha1.TokenRouter&quot;,&quot;config&quot;:null}],&quot;id&quot;:&quot;quilkin-proxies-78965c446d-tfgsj&quot;,&quot;management_servers&quot;:[{&quot;address&quot;:&quot;http://quilkin-manage-agones:80&quot;}],&quot;port&quot;:7000,&quot;version&quot;:&quot;v1alpha1&quot;,&quot;maxmind_db&quot;:null}%
<p>Let's run <code>curl -s http://localhost:8001/config</code> again, so we can see what has changed!</p>
<pre><code class="language-shell">❯ curl -s http://localhost:8001/config | jq
{
&quot;clusters&quot;: [
{
&quot;endpoints&quot;: [
{
&quot;address&quot;: &quot;34.168.170.51:7226&quot;,
&quot;metadata&quot;: {
&quot;quilkin.dev&quot;: {
&quot;tokens&quot;: [
&quot;NDU2&quot;
]
},
&quot;name&quot;: &quot;xonotic-8ns7b-2lk5d&quot;
}
}
],
&quot;locality&quot;: null
}
],
&quot;filters&quot;: [
{
&quot;name&quot;: &quot;quilkin.filters.capture.v1alpha1.Capture&quot;,
&quot;label&quot;: null,
&quot;config&quot;: {
&quot;metadataKey&quot;: &quot;quilkin.dev/capture&quot;,
&quot;suffix&quot;: {
&quot;size&quot;: 3,
&quot;remove&quot;: true
}
}
},
{
&quot;name&quot;: &quot;quilkin.filters.token_router.v1alpha1.TokenRouter&quot;,
&quot;label&quot;: null,
&quot;config&quot;: null
}
],
&quot;id&quot;: &quot;quilkin-proxies-7d9bbbccdf-9vd59&quot;,
&quot;version&quot;: &quot;v1alpha1&quot;
}
</code></pre>
<p>Looking under <code>clusters</code> &gt; <code>endpoints</code> we can see an address and token that matches up with the
<code>GameServer</code> record we created above!</p>
<p>The xDS process saw that allocated <code>GameServer</code>, turned it into a Quilkin <code>Endpoint</code> and applied the set routing
<p>The xDS process saw that allocated <code>GameServer</code>, turned it into a Quilkin <code>Endpoint</code> and applied the set the routing
token appropriately -- without you having to write a line of xDS compliant code!</p>
<h2 id="connecting-client-side"><a class="header" href="#connecting-client-side">Connecting Client Side</a></h2>
<p>Instead of connecting to Xonotic or an Agones <code>GameServer</code> directly, we'll want to grab the IP and exposed port of
Expand All @@ -336,16 +402,17 @@ <h2 id="connecting-client-side"><a class="header" href="#connecting-client-side"
<p>We then take the EXTERNAL-IP and port from the <code>quilkin-proxies</code> service, and replace the<code>${LOADBALANCER_IP}</code>
with it in <code>client-token.yaml</code>.</p>
<p>Run this edited configuration locally with your quilkin binary as <code>quilkin -c ./client-token.yaml proxy</code>:</p>
<pre><code class="language-shell">$ quilkin -c ./client-token.yaml proxy
{&quot;timestamp&quot;:&quot;2022-10-07T22:10:47.257635Z&quot;,&quot;level&quot;:&quot;INFO&quot;,&quot;fields&quot;:{&quot;message&quot;:&quot;Starting Quilkin&quot;,&quot;version&quot;:&quot;0.4.0-dev&quot;,&quot;commit&quot;:&quot;c77260a2526542c564829a2c66935c60f00adcd2&quot;},&quot;target&quot;:&quot;quilkin::cli&quot;}
{&quot;timestamp&quot;:&quot;2022-10-07T22:10:47.258273Z&quot;,&quot;level&quot;:&quot;INFO&quot;,&quot;fields&quot;:{&quot;message&quot;:&quot;Starting&quot;,&quot;port&quot;:7000,&quot;proxy_id&quot;:&quot;markmandel45&quot;},&quot;target&quot;:&quot;quilkin::proxy&quot;}
{&quot;timestamp&quot;:&quot;2022-10-07T22:10:47.258321Z&quot;,&quot;level&quot;:&quot;INFO&quot;,&quot;fields&quot;:{&quot;message&quot;:&quot;Starting admin endpoint&quot;,&quot;address&quot;:&quot;[::]:9092&quot;},&quot;target&quot;:&quot;quilkin::admin&quot;}
{&quot;timestamp&quot;:&quot;2022-10-07T22:10:47.258812Z&quot;,&quot;level&quot;:&quot;INFO&quot;,&quot;fields&quot;:{&quot;message&quot;:&quot;Quilkin is ready&quot;},&quot;target&quot;:&quot;quilkin::proxy&quot;}
<pre><code class="language-shell">$ ./quilkin --config ./client-token.yaml proxy
2023-10-04T20:09:07.320780Z INFO quilkin::cli: src/cli.rs: Starting Quilkin version=&quot;0.7.0-dev&quot; commit=&quot;d42db7e14c2e0e758e9a6eb655ccf4184941066c&quot;
2023-10-04T20:09:07.321711Z INFO quilkin::admin: src/admin.rs: Starting admin endpoint address=[::]:8000
2023-10-04T20:09:07.322089Z INFO quilkin::cli::proxy: src/cli/proxy.rs: Starting port=7777 proxy_id=&quot;markmandel45&quot;
2023-10-04T20:09:07.322576Z INFO quilkin::cli::proxy: src/cli/proxy.rs: Quilkin is ready
2023-10-04T20:09:07.322692Z INFO qcmp_task{v4_addr=0.0.0.0:7600 v6_addr=[::]:7600}: quilkin::protocol: src/protocol.rs: awaiting qcmp packets v4_addr=0.0.0.0:7600 v6_addr=[::]:7600
</code></pre>
<p>Now connect to the local client proxy on &quot;127.0.0.1:7000&quot; via the &quot;Multiplayer &gt; Address&quot; field in the
<p>Now connect to the local client proxy on &quot;[::1]:7777&quot; via the &quot;Multiplayer &gt; Address&quot; field in the
Xonotic client, and Quilkin will take care of appending the routing token to all your UDP packets, which the Quilkin
proxies will route to the Allocated GameServer, and you can play a gamee!</p>
<p><img src="xonotic-address.png" alt="xonotic-address.png" /></p>
<p><img src="xonotic-address-v6.png" alt="xonotic-address-v6.png" /></p>
<p>...And you didn't have to change the client or the dedicated game server 🤸</p>
<h2 id="whats-next"><a class="header" href="#whats-next">What's Next?</a></h2>
<ul>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion main/book/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h3 id="oci-image"><a class="header" href="#oci-image"><a href="https://us-docke
<dl>
<dt><strong>Source / Method</strong></dt>
<dd>
<pre><code>us-docker.pkg.dev/quilkin/release/quilkin:0.7.0-dev-1712f1a
<pre><code>us-docker.pkg.dev/quilkin/release/quilkin:0.7.0-dev-36e82a5
</code></pre>
</dd>
<dt><strong>Notes</strong></dt>
Expand Down
Loading

0 comments on commit 9ff7a1c

Please sign in to comment.