GKE Cluster Optimization: 13 Tactics For A Smoother K8s Deployment
Tags: cloud, devops, kubernetes, googlecloud
Published: 2023-02-22 11:31:58

<!-- wp:paragraph -->
<p>Most engineers don’t want to spend more time than necessary to keep their clusters highly available, secure, and cost-efficient. How do you make sure that your <span id="docs-internal-guid-4b94823a-7fff-86e9-a900-0ad026703fe0"><span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-variant-numeric: normal; font-variant-east-asian: normal; vertical-align: baseline;">Google Kubernetes Engine</span></span> cluster is ready for the storms ahead?&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Here are 13 optimization tactics divided into three core areas of your cluster. Use them to build a resource-efficient, highly-available GKE cluster with airtight security.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Jump to the optimization section that interests you most:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><a href="#h-resource-management-tips-for-a-gke-cluster">Resource management</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="#h-security-best-practices-for-gke-clusters">Security</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="#h-networking-optimization-tips-for-your-gke-cluster">Networking</a></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="h-resource-management-tips-for-a-gke-cluster">Resource management tips for a GKE cluster</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-1-autoscaling">1. Autoscaling</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Use the autoscaling capabilities of Kubernetes to make sure that your workloads perform well during peak load and control costs in times of normal or low load.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Kubernetes gives you several autoscaling mechanisms. Here’s a quick overview to get you up to speed:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><strong>Horizontal Pod Autoscaler</strong> - HPA <a href="https://cast.ai/blog/what-is-kubernetes-hpa-and-how-can-it-help-you-save-on-the-cloud/" target="_blank" rel="noreferrer noopener">adds or removes pod replicas</a> automatically based on utilization metrics. It works great for scaling stateless and stateful applications. Use it with Cluster Autoscaler to shrink the number of active nodes when the pod number decreases. HPA also comes in handy for handling workloads with short high utilization spikes.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Vertical Pod Autoscaler</strong> - VPA increases and lowers the CPU and memory resource requests of pod containers to make sure the allocated and actual cluster usage match. If your HPA configuration doesn’t use CPU or memory to identify scaling targets, it’s best to use it with VPA.&nbsp;</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><strong>Cluster Autoscaler </strong>- it dynamically scales the number of nodes to match the current GKE cluster utilization. Works great with workloads designed to meet dynamically changing demand.&nbsp;</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p><strong>Want to dive deeper? Here’s a more detailed guide to these three autoscaling mechanisms: </strong><a href="https://cast.ai/blog/guide-to-kubernetes-autoscaling-for-cloud-cost-optimization/" target="_blank" rel="noreferrer noopener"><strong>Guide to Kubernetes autoscaling for cloud cost optimization</strong></a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading" id="h-best-practices-for-autoscaling-in-a-gke-cluster">Best practices for autoscaling in a GKE cluster</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><strong>Use HPA, VPA and Node Auto Provisioning (NAP)</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>By using HPA, VPA and NAP together, you let GKE efficiently scale your cluster horizontally (pods) and vertically (nodes). VPA sets values for CPU, memory requests, and limits for containers, while NAP manages node pools and eliminates the default limitation of starting new nodes only from the set of user-created node pools.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Check if your HPA and VPA policies clash</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Make sure that the VPA and HPA policies don’t interfere with each other. For example, if HPA only relies on CPU and memory metrics, HPA and VPA cannot work together. Also, review your bin packing density settings when designing a new GKE cluster for a business- or purpose-class tier of service.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Use instance weighted scores</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This allows you to determine how much of your chosen resource pool will be dedicated to a specific workload and ensure that your machine is best suited for the job.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Slash costs with a mixed-instance strategy</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Using mixed instances helps to achieve high availability and performance at a reasonable cost. It’s basically about choosing from various instance types, some of which may be cheaper and good enough for lower-throughput or low-latency workloads.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Or you could run smaller number of machines with higher specs.This way it would bring costs down because each node requires Kubernetes to be installed on it, which always adds a little overhead. Read more about how mixed-instance strategy works <a href="https://cast.ai/blog/guide-to-kubernetes-autoscaling-for-cloud-cost-optimization/#bestpractices">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-2-choose-the-topology-for-your-gke-cluster">2. Choose the topology for your GKE cluster</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You can choose from two types of clusters: regional and zonal topology. In a regional Kubernetes cluster, Google replicates the control plane and nodes across multiple zones in a single region. In a zonal cluster, they both run in a single compute zone specified upon cluster creation.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If your application depends on the availability of a cluster API, pick a regional cluster topology, which offers higher availability for the cluster’s control plane API.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Since it’s the control plane that does jobs like scaling, replacing, and scheduling pods, if it becomes unavailable you’re in for reliability trouble. On the other hand, regional clusters have nodes spreaded across multiple zones, which may increase your cross-zone network traffic and thus costs.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To learn more about this, take a look at <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/types-of-clusters" target="_blank" rel="noreferrer noopener">this documentation page</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-3-bin-pack-nodes-for-maximum-utilization">3. Bin pack nodes for maximum utilization</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>This is a smart approach to <a href="https://cast.ai/blog/gke-cost-optimization-10-steps-for-a-lower-cloud-bill-in-2023/">GKE cost optimization</a> shared by the engineering team at <a href="https://tech.deliveryhero.com/a-systematic-way-to-optimize-gke-resources/">Delivery Hero</a>.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To maximize node utilization, it’s best to add pods to nodes in a compacted way. This opens the door to reducing costs without any impact on performance. This strategy is called bin packing and goes against the Kubernetes that favors even distribution of pods across nodes.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/VTcv2YPTxRA4Py_QHlX927sHO5oiBRRpOFMjEMeUbeRUwCopCg4wMyHR34-nVVbI5xTBk671XFD2LIxuL3qfnnog3P7RJY6WxiNoLg9G3Gqc2mLJAK1Hii6LMithptdSQBKGJ-VCbiw2Am7GlRUubHw" alt=""/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Source: <a href="https://tech.deliveryhero.com/a-systematic-way-to-optimize-gke-resources/">Delivery Hero</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The team at Delivery Hero used GKE Autopilot, but its limitations made the engineers build bin packing on their own. To achieve the highest node utilization, the team defines one or more node pools in a way that allows nodes to include pods in the most compacted way (but leaving some buffer for the shared CPU).&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>By merging node pools and performing bin packing, pods fit into nodes more efficiently, helping Delivery Hero to decrease the total number of nodes by ~60% in that team.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you’re curious to see what an automated bin packing flow looks like, check out <a href="https://docs.cast.ai/docs/how-it-works#bin-packing-flow" target="_blank" rel="noreferrer noopener">this page in our documentation</a> that shows how we designed it step by step.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-4-implement-cost-monitoring">4. Implement cost monitoring</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Cost monitoring is a big part of resource management because it lets you keep an eye on your expenses and instantly act on cost spike alerts.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To understand your Google Kubernetes Engine costs better, implement a monitoring solution that gathers data about your cluster’s workload, total cost, costs divided by labels or namespaces, and overall performance.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The GKE usage metering enables you to monitor resource usage, map workloads, and estimate resource consumption. Enable it to quickly identify the most resource-intensive workloads or spikes in resource consumption.</p>
<!-- /wp:paragraph -->

<!-- wp:quote {"className":"is-style-plain"} -->
<blockquote class="wp-block-quote is-style-plain"><!-- wp:paragraph -->
<p>This step is the bare minimum you can do for cost monitoring. Tracking <a href="https://cast.ai/blog/kubernetes-cost-monitoring-3-metrics-you-need-to-track-asap/" target="_blank" rel="noreferrer noopener">these 3 metrics</a> is what really makes a difference in how you manage your cloud resources.&nbsp;</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-5-use-spot-vms">5. Use spot VMs</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Spot VMs are an incredible cost-saving opportunity - you can get a discount reaching up to 91% off the pay-as-you-go pricing. The catch is that Google may reclaim the machine at any time, so you need to have a strategy in place to handle the interruption.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>That’s why many teams use spot VMs for workloads that are fault- and interruption-tolerant like batch processing jobs, distributed databases, CI/CD operations, or microservices.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading" id="h-best-practices-for-running-your-gke-cluster-on-spot-vms">Best practices for running your GKE cluster on spot VMs</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><strong>How to choose the right spot VM?</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Pick a slightly less popular spot VM type - it’s less likely to get interrupted. You can also check its frequency of interruption (the rate at which this instance reclaimed capacity within the trailing month).&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Set up spot VM groups</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This increases your chances of snatching the machines you want. Managed instance groups can request multiple machine types at the same time, adding new spot VMs when extra resources become available.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="h-more-insights">💡 More insights</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Google Cloud Platform has two really great resources on resource management for Kubernetes clusters:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><a href="https://cloud.google.com/blog/products/containers-kubernetes/best-practices-for-creating-a-highly-available-gke-cluster" target="_blank" rel="noreferrer noopener">GKE best practices: Designing and building highly available clusters</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://cloud.google.com/architecture/best-practices-for-running-cost-effective-kubernetes-applications-on-gke#introduction" target="_blank" rel="noreferrer noopener">Best practices for running cost-optimized Kubernetes applications on GKE</a></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">____</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="h-security-best-practices-for-gke-clusters">Security best practices for GKE clusters</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Red Hat 2022 State of Kubernetes and Container Security found that almost 70% of incidents happen due to misconfigurations.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>GKE secures your Kubernetes cluster in many layers, including the container image, its runtime, the cluster network, and access to the cluster API server. Google generally recommends implementing a layered approach to GKE cluster security.&nbsp;&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The most important security aspects to focus on are: authentication and authorization, control plane, node, and network security.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-1-follow-cis-benchmarks">1. Follow CIS Benchmarks&nbsp;</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>All of the key security areas are part of Center of Internet Security (CIS) Benchmarks, a globally recognized best practices collection that gives you a helping hand for structuring security efforts.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>When you use a managed service like GKE, you don’t have the power over all the CIS Benchmark items. But some things are definitely within your control, like auditing, upgrading, and securing the cluster nodes and workloads.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You can either go through the CIS Benchmarks manually or use a tool that does the benchmarking job for you. We recently introduced a <a href="https://cast.ai/cloud-security/">container security</a> module that scans your GKE cluster to check for any benchmark discrepancies and prioritizes issues to help you take action.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-2-implement-rbac">2. Implement RBAC&nbsp;</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Role-Based Access Control (RBAC) is an essential component for managing access to your GKE cluster. It lets you establish more granular access to Kubernetes resources at cluster and namespace levels, and develop detailed permission policies.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>CIS GKE Benchmark 6.8.4 emphasizes that teams give preference to RBAC over the legacy Attribute Based Access Control (ABAC).&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Another CIS GKE Benchmark (6.8.3) suggests using groups for managing users. This is how you make controlling identities and permissions simpler and don’t need to update the RBAC configuration whenever you add or remove users from the group.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-3-follow-the-principle-of-least-privilege">3. Follow the principle of least privilege</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Make sure to grant user accounts only the privileges that are essential for them to do their jobs. Nothing more than that.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The CIS GKE Benchmark 6.2.1 states: <em>Prefer not running GKE clusters using the Compute Engine default service account</em>.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>By default, nodes get access to the Compute Engine service account. This comes in handy for multiple applications but opens the door to more permissions than necessary to run your GKE cluster. Create and use a minimally privileged service account instead of the default - and follow the same principle everywhere else.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-4-boost-your-control-plane-s-security">4. Boost your control plane’s security&nbsp;</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Google implements the Shared Responsibility Model to manage the GKE <a href="https://cast.ai/blog/kubernetes-control-plane-10-tips-for-airtight-k8s-security/">control plane</a> components. Still, you’re the one responsible for securing nodes, containers, and pods.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The Kubernetes API server uses a public IP address by default. You can secure it with the help of authorized networks and private Kubernetes clusters that let you assign a private IP address.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Another way to improve your control plane’s security is performing a regular credential rotation. The TLS certificates and cluster certificate authority get rotated automatically when you initiate the process.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-5-protect-node-metadata">5. Protect node metadata</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>CIS GKE Benchmarks 6.4.1 and 6.4.2 point out two critical factors that may compromise your node security - and fall on your plate.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Kubernetes deprecated the v0.1 and v1beta1 Compute Engine metadata server endpoints in 2020. The reason was that they didn’t enforce metadata query headers.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Some attacks against Kubernetes clusters rely on access to the metadata server of virtual machines. The idea here is to extract credentials. You can fight such attacks with Workload identity or Metadata Concealment.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-6-upgrade-gke-regularly">6. Upgrade GKE regularly</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Kubernetes often releases new security features and patches, so keeping your deployment up-to-date is a simple but powerful approach to improving your security posture.&nbsp;&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The good news about GKE is that it patches and upgrades the control plane automatically. The node auto-upgrade also upgrades cluster nodes and CIS GKE Benchmark 6.5.3 recommends that you keep this setting on.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you want to disable the auto-upgrade for any reason, Google suggests performing upgrades on a monthly basis and following the GKE security bulletins for critical patches.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="h-more-insights-1">💡 More insights</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Here’s a checklist with more security tips for GKE:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><a href="https://cast.ai/blog/gke-security-top-10-strategies-for-securing-your-cluster/" target="_blank" rel="noreferrer noopener">GKE Security: Top 10 Strategies for Securing Your Cluster</a></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">____</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="h-networking-optimization-tips-for-your-gke-cluster">Networking optimization tips for your GKE cluster</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-1-avoid-overlaps-with-ip-addresses-from-other-environments">1. Avoid overlaps with IP addresses from other environments</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>When designing a larger Kubernetes cluster, keep in mind to avoid overlaps with IP addresses used in your other environments. Such overlaps might cause issues with routing if you need to connect cluster VPC network to on-premises environments or other cloud service provider networks via Cloud VPN or Cloud Interconnect.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-2-use-gke-dataplane-v2-and-network-policies">2. Use GKE Dataplane V2 and network policies</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you want to control traffic flow at the OSI layer 3 or 4 (IP address or port level), you should consider using <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/">network policies</a>. Network policies allow specifying how a pod can communicate with other network entities (pods, services, certain subnets, etc.).&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To bring your cluster networking to the next level, <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/dataplane-v2" target="_blank" rel="noreferrer noopener">GKE Dataplane V2</a> is the right choice. It’s based on eBPF and provides extended integrated network security and visibility experience.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Adding to that, if the cluster uses the Google Kubernetes Engine Dataplane V2, you don’t need to enable network policies explicitly as the former manages services routing, network policy enforcement, and logging&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading" id="h-3-use-cloud-dns-for-gke">3. Use Cloud DNS for GKE</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Pod and Service DNS resolution can be done without the additional overhead of managing the cluster-hosted DNS provider. <a href="https://cloud.google.com/kubernetes-engine/docs/best-practices/networking#cloud-dns" target="_blank" rel="noreferrer noopener">Cloud DNS for GKE</a> requires no additional monitoring, scaling, or other management activities as it’s a fully hosted Google service.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="h-more-insights-2">💡 More insights</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Check out this resource from Google for more insights for your GKE cluster::</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li><a href="https://cloud.google.com/kubernetes-engine/docs/best-practices/networking" target="_blank" rel="noreferrer noopener">Best practices for GKE networking</a></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="h-use-automation-and-cross-these-tasks-off-your-to-do-list">Use automation and cross these tasks off your to-do list&nbsp;</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>To see the difference automation can make in the life of an engineer, take a look at this case study into how <strong>ShareChat</strong> - India’s largest homegrown social media company and biggest Google Cloud Platform customer - used automation to reduce engineer workload and save several million dollars on its annual cloud bill.</p>
<!-- /wp:paragraph -->

<!-- wp:acf/case-studies-list {"id":"block_623300b8b853e","name":"acf/case-studies-list","data":{"layout":"column","_layout":"field_case-studies-list_layout","load_latest":"0","_load_latest":"field_case-studies-list_load_latest","case_studies":["13891"],"_case_studies":"field_case-studies-list_case_studies","show_more":"1","_show_more":"field_case-studies-list_show_more"},"align":"wide","mode":"auto","wpClassName":"wp-block-acf-case-studies-list alignwide"} /-->

<!-- wp:heading -->
<h2 class="wp-block-heading" id="faq">FAQ</h2>
<!-- /wp:heading -->

<!-- wp:yoast/faq-block {"questions":[{"id":"faq-question-1675876023067","question":["1. What techniques can I use to optimize my GKE cluster performance? "],"answer":["To improve the performance of your Google Kubernetes Engine (GKE) cluster, you can use techniques like autoscaling, choosing the right topology for your cluster, and using a node bin packing mechanism to counteract how Kubernetes normally distributes nodes. Consider using an automation solution that takes care of all of these tasks to reduce the amount of work you have to do by hand to set up and run them."],"jsonQuestion":"1. What techniques can I use to optimize my GKE cluster performance? ","jsonAnswer":"To improve the performance of your Google Kubernetes Engine (GKE) cluster, you can use techniques like autoscaling, choosing the right topology for your cluster, and using a node bin packing mechanism to counteract how Kubernetes normally distributes nodes. Consider using an automation solution that takes care of all of these tasks to reduce the amount of work you have to do by hand to set up and run them."},{"id":"faq-question-1675876076185","question":["2. How do I monitor my GKE cluster performance? "],"answer":["Go to Monitoring in the Google Cloud management console. Once you’re there, choose Dashboards, and then pick one of the dashboards you’d like to explore. Pick the GKE dashboard for clusters where Cloud Operations for GKE has been enabled. Go for the GKE Cluster dashboard if Legacy Logging and Monitoring is enabled for the clusters."],"jsonQuestion":"2. How do I monitor my GKE cluster performance? ","jsonAnswer":"Go to Monitoring in the Google Cloud management console. Once you’re there, choose Dashboards, and then pick one of the dashboards you’d like to explore. Pick the GKE dashboard for clusters where Cloud Operations for GKE has been enabled. Go for the GKE Cluster dashboard if Legacy Logging and Monitoring is enabled for the clusters."},{"id":"faq-question-1675876084840","question":["3. What should I consider when setting up my GKE cluster? "],"answer":["Choose the right cluster topology for a newly created cluster – you can pick between zonal or regional. A zonal cluster's control plane and nodes run in a compute zone you select when you construct the cluster. Regional clusters duplicate the control plane and nodes across zones.",{"type":"br","props":{"children":[]}},{"type":"br","props":{"children":[]}},"Capacity planning is crucial. It’s a good idea to research GKE's autoscaling options that best meet your needs to guarantee your workloads perform correctly at peak load and control costs during normal or low load.",{"type":"br","props":{"children":[]}},{"type":"br","props":{"children":[]}},"Be sure to check your monitoring defaults. Kubernetes automatically monitors workloads and distributes load evenly. Exposing workload signals to Kubernetes optimizes workload availability further. "],"jsonQuestion":"3. What should I consider when setting up my GKE cluster? ","jsonAnswer":"Choose the right cluster topology for a newly created cluster – you can pick between zonal or regional. A zonal cluster's control plane and nodes run in a compute zone you select when you construct the cluster. Regional clusters duplicate the control plane and nodes across zones.\u003cbr/\u003e\u003cbr/\u003eCapacity planning is crucial. It’s a good idea to research GKE's autoscaling options that best meet your needs to guarantee your workloads perform correctly at peak load and control costs during normal or low load.\u003cbr/\u003e\u003cbr/\u003eBe sure to check your monitoring defaults. Kubernetes automatically monitors workloads and distributes load evenly. Exposing workload signals to Kubernetes optimizes workload availability further. "},{"id":"faq-question-1675876100337","question":["4. How can I scale my GKE cluster in an efficient way?"],"answer":["To dynamically adjust the size of your node pool based on demand, enable Cluster Autoscaler. And to automatically change the number of pods based on usage parameters, use Horizontal Pod Autoscaling.",{"type":"br","props":{"children":[]}},{"type":"br","props":{"children":[]}},"Use Node Auto Provisioning (NAP) in combination with Vertical Pod Autoscaling (VPA) to enable GKE to effectively scale your cluster both horizontally (pods) and vertically (nodes).",{"type":"br","props":{"children":[]}},{"type":"br","props":{"children":[]}},"VPA automatically sets values for the CPU, RAM requirements, and restrictions. The default restriction of launching new nodes solely from the collection of user-created node pools is removed by NAP, which automatically manages node pools."],"jsonQuestion":"4. How can I scale my GKE cluster in an efficient way?","jsonAnswer":"To dynamically adjust the size of your node pool based on demand, enable Cluster Autoscaler. And to automatically change the number of pods based on usage parameters, use Horizontal Pod Autoscaling.\u003cbr/\u003e\u003cbr/\u003eUse Node Auto Provisioning (NAP) in combination with Vertical Pod Autoscaling (VPA) to enable GKE to effectively scale your cluster both horizontally (pods) and vertically (nodes).\u003cbr/\u003e\u003cbr/\u003eVPA automatically sets values for the CPU, RAM requirements, and restrictions. The default restriction of launching new nodes solely from the collection of user-created node pools is removed by NAP, which automatically manages node pools."}]} -->
<div class="schema-faq wp-block-yoast-faq-block"><div class="schema-faq-section" id="faq-question-1675876023067"><strong class="schema-faq-question">1. What techniques can I use to optimize my GKE cluster performance? </strong> <p class="schema-faq-answer">To improve the performance of your Google Kubernetes Engine (GKE) cluster, you can use techniques like autoscaling, choosing the right topology for your cluster, and using a node bin packing mechanism to counteract how Kubernetes normally distributes nodes. Consider using an automation solution that takes care of all of these tasks to reduce the amount of work you have to do by hand to set up and run them.</p> </div> <div class="schema-faq-section" id="faq-question-1675876076185"><strong class="schema-faq-question">2. How do I monitor my GKE cluster performance? </strong> <p class="schema-faq-answer">Go to Monitoring in the Google Cloud management console. Once you’re there, choose Dashboards, and then pick one of the dashboards you’d like to explore. Pick the GKE dashboard for clusters where Cloud Operations for GKE has been enabled. Go for the GKE Cluster dashboard if Legacy Logging and Monitoring is enabled for the clusters.</p> </div> <div class="schema-faq-section" id="faq-question-1675876084840"><strong class="schema-faq-question">3. What should I consider when setting up my GKE cluster? </strong> <p class="schema-faq-answer">Choose the right cluster topology for a newly created cluster – you can pick between zonal or regional. A zonal cluster's control plane and nodes run in a compute zone you select when you construct the cluster. Regional clusters duplicate the control plane and nodes across zones.<br/><br/>Capacity planning is crucial. It’s a good idea to research GKE's autoscaling options that best meet your needs to guarantee your workloads perform correctly at peak load and control costs during normal or low load.<br/><br/>Be sure to check your monitoring defaults. Kubernetes automatically monitors workloads and distributes load evenly. Exposing workload signals to Kubernetes optimizes workload availability further. </p> </div> <div class="schema-faq-section" id="faq-question-1675876100337"><strong class="schema-faq-question">4. How can I scale my GKE cluster in an efficient way?</strong> <p class="schema-faq-answer">To dynamically adjust the size of your node pool based on demand, enable Cluster Autoscaler. And to automatically change the number of pods based on usage parameters, use Horizontal Pod Autoscaling.<br/><br/>Use Node Auto Provisioning (NAP) in combination with Vertical Pod Autoscaling (VPA) to enable GKE to effectively scale your cluster both horizontally (pods) and vertically (nodes).<br/><br/>VPA automatically sets values for the CPU, RAM requirements, and restrictions. The default restriction of launching new nodes solely from the collection of user-created node pools is removed by NAP, which automatically manages node pools.</p> </div> </div>
<!-- /wp:yoast/faq-block -->