<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>– Best Practices</title><link>https://codeblind-ai.github.io/docs/guides/best-practices/</link><description>Recent content in Best Practices on</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 12 May 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://codeblind-ai.github.io/docs/guides/best-practices/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: Google Kubernetes Engine Best Practices</title><link>https://codeblind-ai.github.io/docs/guides/best-practices/gke/</link><pubDate>Fri, 12 May 2023 00:00:00 +0000</pubDate><guid>https://codeblind-ai.github.io/docs/guides/best-practices/gke/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>On this page, we&amp;rsquo;ve collected several &lt;a href="https://cloud.google.com/kubernetes-engine/">Google Kubernetes Engine (GKE)&lt;/a> best practices.&lt;/p>
&lt;h2 id="release-channels">Release Channels&lt;/h2>
&lt;h3 id="why">Why?&lt;/h3>
&lt;p>We recommned using &lt;a href="https://cloud.google.com/kubernetes-engine/docs/concepts/release-channels">Release Channels&lt;/a> for all GKE clusters. Using Release Channels has several advantages:&lt;/p>
&lt;ul>
&lt;li>Google automatically manages the version and upgrade cadence for your Kubernetes Control Plane and its nodes.&lt;/li>
&lt;li>Clusters on a Release Channel are allowed to use the &lt;code>No minor upgrades&lt;/code> and &lt;code>No minor or node upgrades&lt;/code> &lt;a href="https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#limitations-maint-exclusions">scope of maintenance exclusions&lt;/a> - in other words, enrolling a cluster in a Release Channel gives you &lt;em>more control&lt;/em> over node upgrades.&lt;/li>
&lt;li>Clusters enrolled in &lt;code>rapid&lt;/code> channel have access to the newest Kubernetes version first. Code Blind strives to &lt;a href="https://codeblind-ai.github.io/docs/installation/#agones-and-kubernetes-supported-versions">support the newest release in &lt;code>rapid&lt;/code> channel&lt;/a> to allow you to test the newest Kubernetes soon after it&amp;rsquo;s available in GKE.&lt;/li>
&lt;/ul>
&lt;div class="alert alert-info" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
GKE Autopilot clusters must be on Release Channels.
&lt;/div>
&lt;h3 id="what-channel-should-i-use">What channel should I use?&lt;/h3>
&lt;p>We recommend the &lt;code>regular&lt;/code> channel, which offers a balance between stability and freshness. See &lt;a href="https://cloud.google.com/kubernetes-engine/docs/concepts/release-channels#what_channel_should_i_use">this guide&lt;/a> for more discussion.&lt;/p>
&lt;p>If you need to disallow minor version upgrades for more than 6 months, consider choosing the freshest Kubernetes version possible: Choosing the freshest version on &lt;code>rapid&lt;/code> or &lt;code>regular&lt;/code> will extend the amount of time before your cluster reaches &lt;a href="https://cloud.google.com/kubernetes-engine/docs/release-schedule#schedule-for-release-channels">end of life&lt;/a>.&lt;/p>
&lt;h3 id="what-versions-are-available-on-a-given-channel">What versions are available on a given channel?&lt;/h3>
&lt;p>You can query the versions available across different channels using &lt;code>gcloud&lt;/code>:&lt;/p>
&lt;pre tabindex="0">&lt;code>gcloud container get-server-config \
--region=[COMPUTE_REGION] \
--flatten=&amp;#34;channels&amp;#34; \
--format=&amp;#34;yaml(channels)&amp;#34;
&lt;/code>&lt;/pre>&lt;p>Replace the following:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>COMPUTE_REGION&lt;/strong>: the
&lt;a href="https://cloud.google.com/compute/docs/regions-zones#available">Google Cloud region&lt;/a>
where you will create the cluster.&lt;/li>
&lt;/ul>
&lt;h2 id="managing-game-server-disruption-on-gke">Managing Game Server Disruption on GKE&lt;/h2>
&lt;p>If your game session length is less than an hour, use the &lt;code>eviction&lt;/code> API to configure your game servers appropriately - see &lt;a href="https://codeblind-ai.github.io/docs/advanced/controlling-disruption/">Controlling Disruption&lt;/a>.&lt;/p>
&lt;p>For sessions longer than an hour, there are currently two possible approaches to manage disruption:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>(GKE Standard/Autopilot) &lt;a href="https://martinfowler.com/bliki/BlueGreenDeployment.html">Blue/green deployment&lt;/a> at the cluster level: If you are using an automated deployment process, you can:&lt;/p>
&lt;ul>
&lt;li>create a new, &lt;code>green&lt;/code> cluster within a release channel e.g. every week,&lt;/li>
&lt;li>use &lt;a href="https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#exclusions">maintenance exclusions&lt;/a> to prevent node upgrades for 30d, and&lt;/li>
&lt;li>scale the &lt;code>Fleet&lt;/code> on the old, &lt;code>blue&lt;/code> cluster down to 0, and&lt;/li>
&lt;li>use &lt;a href="https://codeblind-ai.github.io/docs/advanced/multi-cluster-allocation/">multi-cluster allocation&lt;/a> on Code Blind, which will then direct new allocations to the new &lt;code>green&lt;/code> cluster (since &lt;code>blue&lt;/code> has 0 desired), then&lt;/li>
&lt;li>delete the old, &lt;code>blue&lt;/code> cluster when the &lt;code>Fleet&lt;/code> successfully scales down.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>(GKE Standard only) Use &lt;a href="https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies#blue-green-upgrade-strategy">node pool blue/green upgrades&lt;/a>&lt;/p>
&lt;/li>
&lt;/ul></description></item></channel></rss>