{"id":15633,"date":"2023-08-17T11:31:40","date_gmt":"2023-08-17T04:31:40","guid":{"rendered":"https:\/\/gcloudvn.com\/?p=15633"},"modified":"2024-07-31T10:18:18","modified_gmt":"2024-07-31T03:18:18","slug":"maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads","status":"publish","type":"post","link":"https:\/\/gcloudvn.com\/en\/kienthuc\/maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads\/","title":{"rendered":"Maximizing Reliability, Minimizing Costs: Right-Sizing Kubernetes Workloads"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Do you know how much money you could save by adjusting workload requests to better represent their actual usage? If you're not rightsizing your workloads, you might be overpaying for resources that your workloads aren't even using or worse, putting your workloads at risk for reliability issues due to under provisioning.<\/span><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/cloud.google.com\/blog\/products\/containers-kubernetes\/setting-resource-requests-the-key-to-kubernetes-cost-optimization\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">As we discussed before<\/span><\/a><span style=\"font-weight: 400;\">setting the resources is the most important thing you can do to increase the reliability of your Kubernetes workloads. In this blog we will help you with the second key finding from the report: <\/span><a href=\"https:\/\/goo.gle\/state-of-kubernetes-cost-optimization\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">State of Kubernetes Cost Optimization<\/span><\/a><span style=\"font-weight: 400;\">!<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15638\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_1.jpg\" alt=\"T\u1ed1i \u0111a h\u00f3a \u0111\u1ed9 tin c\u1eady, gi\u1ea3m thi\u1ec3u chi ph\u00ed: \u0110\u1ecbnh l\u01b0\u1ee3ng k\u00edch c\u1ee1 Kubernetes Workloads ph\u00f9 h\u1ee3p 1\" width=\"600\" height=\"267\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_1.jpg 598w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_1-18x8.jpg 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>\u201cThe research \u2026 found that workload rightsizing has the biggest opportunity to reduce resource waste.\u201d<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">State of Kubernetes Cost Optimization Report<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">According to the results of Google research, workload rightsizing is the most important golden signal. Workload rightsizing measures the capacity of developers to properly use the CPU and memory they have requested for their applications.<\/span><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads\/#Dinh_luong_la_mot_thach_thuc\" >Rightsizing is challenging<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads\/#Tools_su_dung_cho_dinh_luong_workload\" >Tools for workload rightsizing\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads\/#Dinh_luong_tren_giao_dien_Console\" >Rightsizing in the console<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads\/#Rightsizing_voi_Cloud_Monitoring\" >Rightsizing with Cloud Monitoring<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads\/#Dinh_luong_de_toi_uu\" >Rightsizing at scale<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/maximizing-reliability-minimizing-costs-right-sizing-kubernetes-workloads\/#Tong_ket\" >In conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Dinh_luong_la_mot_thach_thuc\"><\/span><b>Rightsizing is challenging<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">It can be quite difficult to predict the resource needs of your applications, which historically has not been a concern for developers in traditional data center environments.In traditional data center environments, resources were typically over-provisioned upfront to ensure capacity for peak demand and future growth, so developers didn't need to focus on accurately predicting resource needs as they were covered by the excess capacity, whereas in cloud environments, resources are consumed on-demand. Finding a balance between efficiency and reliability can often feel like a delicate balancing act.<\/span><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Tools_su_dung_cho_dinh_luong_workload\"><\/span><b>Tools for workload rightsizing\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">C\u00f3 c\u00e1c tools trong Cloud Monitoring v\u00e0 Giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng GKE m\u00e0 b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng \u0111\u1ec3 \u0111\u1ecbnh l\u01b0\u1ee3ng workloads c\u1ee7a m\u00ecnh ch\u1ea1y tr\u00ean <a href=\"https:\/\/gcloudvn.com\/en\/google-kubernetes-engine-gke\/\">GKE Google Kubernetes Engine<\/a>.<\/span><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Dinh_luong_tren_giao_dien_Console\"><\/span><b>Rightsizing in the console<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Workload Cost Optimization<\/span><span style=\"font-weight: 400;\"> tab helps you identify workloads that can be optimized by displaying the resources used versus what\u2019s requested.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15637\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_2.jpg\" alt=\"T\u1ed1i \u0111a h\u00f3a \u0111\u1ed9 tin c\u1eady, gi\u1ea3m thi\u1ec3u chi ph\u00ed: \u0110\u1ecbnh l\u01b0\u1ee3ng k\u00edch c\u1ee1 Kubernetes Workloads ph\u00f9 h\u1ee3p 2\" width=\"800\" height=\"285\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_2.jpg 802w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_2-768x274.jpg 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_2-18x6.jpg 18w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/>To take advantage of potential cost savings, you can drill into clusters to see workload level resource recommendations.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To view workload resource recommendations for Deployment objects only<\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In <\/span><a href=\"https:\/\/console.cloud.google.com\/kubernetes\/list\/cost\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">GKE Cost Optimization<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select a cluster.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><a href=\"https:\/\/console.cloud.google.com\/kubernetes\/list\/overview\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Workloads &gt; Cost Optimization<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Choose a Deployment workloads<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Workload&#039;s detail page, select Actions &gt; Scale &gt; Edit Resource Requests<\/span><\/li>\n<\/ol>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Rightsizing_voi_Cloud_Monitoring\"><\/span><b>Rightsizing with Cloud Monitoring<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Cloud Monitoring provides built-in VPA scale recommendations metrics that you can use to monitor the performance of your workloads and to identify opportunities to rightsize them without the need to create VPA objects.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15636 size-full\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_3.jpg\" alt=\"T\u1ed1i \u0111a h\u00f3a \u0111\u1ed9 tin c\u1eady, gi\u1ea3m thi\u1ec3u chi ph\u00ed: \u0110\u1ecbnh l\u01b0\u1ee3ng k\u00edch c\u1ee1 Kubernetes Workloads ph\u00f9 h\u1ee3p 3\" width=\"800\" height=\"374\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_3.jpg 800w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_3-768x359.jpg 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_3-18x8.jpg 18w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/>To view these metrics:<\/span><\/p>\n<ol style=\"text-align: justify;\">\n<li><span style=\"font-weight: 400;\"> Go to Cloud Monitoring &gt; Metric Explore console.<\/span><\/li>\n<li><span style=\"font-weight: 400;\"> In the Metric dropdown, select the metrics:<\/span><\/li>\n<\/ol>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Memory recommendation:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 100;\">Kubernetes Scale &gt; autoscaler &gt; Recommended per replica request bytes<\/span><\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Recommended CPU:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 100;\">Kubernetes Scale &gt; autoscaler &gt; Recommended per replica request cores<\/span><\/li>\n<\/ul>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Dinh_luong_de_toi_uu\"><\/span><b>Rightsizing at scale<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If you\u2019re interested in viewing recommendations across clusters and projects, We've created a guide that you can use today to help you <\/span><a href=\"https:\/\/cloud.google.com\/kubernetes-engine\/docs\/tutorials\/right-size-workloads-at-scale\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">right-size your GKE workloads at scale<\/span><\/a><span style=\"font-weight: 400;\">. This solution leverages your actual cluster\u2019s metric data and built-in workload recommendations provided by Cloud Monitoring. You can determine the resource requirements for all your workloads without having to create additional VPA autoscaler objects in each of your clusters. The guide walks you through deploying the solution.<\/span><\/p>\n<p style=\"text-align: justify;\"><b><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15635\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_4.jpg\" alt=\"T\u1ed1i \u0111a h\u00f3a \u0111\u1ed9 tin c\u1eady, gi\u1ea3m thi\u1ec3u chi ph\u00ed: \u0110\u1ecbnh l\u01b0\u1ee3ng k\u00edch c\u1ee1 Kubernetes Workloads ph\u00f9 h\u1ee3p 4\" width=\"800\" height=\"560\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_4.jpg 801w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_4-768x538.jpg 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/kich_co_kubernetes_workloads_4-18x12.jpg 18w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/b><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><b>In conclusion<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In short, sizing your workloads is essential for both cost savings and reliability. By following the tips in this blog, you can ensure that your workloads are using the right amount of resources, which will save you money and increase the reliability of your workloads.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Links to the solution presented in this blog and other useful tools to help you optimize your cluster are listed below:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The <\/span><a href=\"https:\/\/cloud.google.com\/kubernetes-engine\/docs\/tutorials\/right-size-workloads-at-scale\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Right-sizing workloads at scale<\/span><\/a><span style=\"font-weight: 400;\"> solution guide<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><a href=\"https:\/\/cloud.google.com\/blog\/products\/containers-kubernetes\/setting-resource-requests-the-key-to-kubernetes-cost-optimization\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Setting resource requests: the key to Kubernetes cost optimization<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The simple <\/span><a href=\"https:\/\/github.com\/GoogleCloudPlatform\/kubernetes-engine-samples\/tree\/main\/cost-optimization\/state-of-k8s-cost-optimization\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">kube-requests-checker<\/span><\/a><span style=\"font-weight: 400;\"> tool<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">An <\/span><a href=\"https:\/\/console.cloud.google.com\/welcome?walkthrough_id=kubernetes--gke_quickstart$c2d2-cgcb-neos062-out\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">interactive tutorial<\/span><\/a><span style=\"font-weight: 400;\"> to get set up in GKE with a set of sample workloads<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Download report <\/span><a href=\"https:\/\/inthecloud.withgoogle.com\/state-of-kubernetes-cost-optimization-report\/dl-cd.html\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">State of Kubernetes Optimization<\/span><\/a><span style=\"font-weight: 400;\">, review key solutions and follow Gimasys &amp; Google&#039;s next blog post!<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>B\u1ea1n c\u00f3 bi\u1ebft m\u00ecnh c\u00f3 th\u1ec3 ti\u1ebft ki\u1ec7m \u0111\u01b0\u1ee3c bao nhi\u00eau ti\u1ec1n b\u1eb1ng c\u00e1ch \u0111i\u1ec1u ch\u1ec9nh c\u00e1c workload requests \u0111\u1ec3 th\u1ec3 hi\u1ec7n t\u1ed1t h\u01a1n m\u1ee9c s\u1eed d\u1ee5ng th\u1ef1c t\u1ebf c\u1ee7a ch\u00fang kh\u00f4ng? N\u1ebfu b\u1ea1n kh\u00f4ng \u0111\u1ecbnh l\u01b0\u1ee3ng \u0111\u00fang cho workloads&hellip;<\/p>","protected":false},"author":2,"featured_media":15634,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1,135],"tags":[],"class_list":["post-15633","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kienthuc","category-google-cloud-platform","entry","has-media"],"_links":{"self":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/15633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/comments?post=15633"}],"version-history":[{"count":0,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/15633\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media\/15634"}],"wp:attachment":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media?parent=15633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/categories?post=15633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/tags?post=15633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}