{"id":58586,"date":"2023-09-28T08:13:14","date_gmt":"2023-09-28T02:43:14","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=58586"},"modified":"2024-01-02T17:37:17","modified_gmt":"2024-01-02T12:07:17","slug":"goldilocks-an-unlocker-for-k8s-resources-recommendations","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/goldilocks-an-unlocker-for-k8s-resources-recommendations\/","title":{"rendered":"GoldiLocks: An Unlocker for K8s Resources Recommendations"},"content":{"rendered":"<figure class=\"graf graf--figure\">\n<figure class=\"graf graf--figure\"><img decoding=\"async\" class=\"graf-image aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/0mCKEYn6lsPkm7kzx.png\" data-image-id=\"0*mCKEYn6lsPkm7kzx.png\" data-width=\"1400\" data-height=\"405\" data-is-featured=\"true\" \/><\/figure>\n<\/figure>\n<p>In the past decade, we have seen industries evolve their businesses by migrating their applications from monolithic to microservices using various container orchestrations such as K8s, ECS, Docker etc. In this process, a lot of effort has been put into designing architecture that should be scalable, robust, reliable, and so on. As application and business start evolving, we must transit our focus to optimize resources and limit allocations so that applications will not be under or over-utilized the resources. Hence reducing the cost with the right-size workloads.<\/p>\n<p>Before directly hopping into concepts, I would like to tell the intent of this blog via a problem statement.<\/p>\n<h2><span data-preserver-spaces=\"true\">Problem Statement<\/span><\/h2>\n<p><span data-preserver-spaces=\"true\">Python Based RestFul API running as POD in K8s Cluster with the below:<\/span><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">No AutoScaler(<\/span><a class=\"editor-rtfLink\" href=\"https:\/\/kubernetes.io\/docs\/tasks\/run-application\/horizontal-pod-autoscale\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">HPA or VPA<\/span><\/a><span data-preserver-spaces=\"true\">)<\/span><\/li>\n<li><a class=\"editor-rtfLink\" href=\"https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/quality-service-pod\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">No Correct QoS (Quality of Service)<\/span><\/a><\/li>\n<li><a class=\"editor-rtfLink\" href=\"https:\/\/grafana.com\/grafana\/dashboards\/15154-workload-resource-recommendations-based-on-usage\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">No Observibilty Dashboard<\/span><\/a><\/li>\n<li><span data-preserver-spaces=\"true\">No Application Workload Trends<\/span><\/li>\n<li><a class=\"editor-rtfLink\" href=\"https:\/\/locust.io\/\" target=\"_blank\" rel=\"noopener\"><span data-preserver-spaces=\"true\">Stress\/Load Testing<\/span><\/a><span data-preserver-spaces=\"true\"> can\u2019t benchmark resource limits and requests as traffic is majorly dependent on real data based on customer profile.<\/span><\/li>\n<\/ul>\n<blockquote><p>In case of high traffic or heavy load, API gets crashed. So, in order to make it available, we need to scale out the pod; therefore, it requires HPA to be in place. Since we have no QoS or history of application that could help us benchmark our HPA thresholds. This is where <strong>GOLDILOCKS\u00a0<\/strong>comes into existence.<\/p><\/blockquote>\n<p><span data-preserver-spaces=\"true\">In this article, we will share guidance and the journey of implementing Goldilocks, which helped us in optimize resource allocation and right-size application via QoS recommendations.<\/span><\/p>\n<h2 id=\"c0e0\" class=\"lz ma ev be mb mc md me mf mg mh mi mj mk ml mm mn mo mp mq mr ms mt mu mv mw bj\"><strong class=\"al\">Ramification of Resources Right-Sizing in K8s Application<\/strong><\/h2>\n<p id=\"c139\" class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\" data-selectable-paragraph=\"\">Right-sizing of resource allocation in K8s can be done by embedding <a class=\"af ni\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/configuration\/manage-resources-containers\/#requests-and-limits\" target=\"_blank\" rel=\"noopener ugc nofollow\">resource specification<\/a> block in application deployment manifests, and it will ramify application in the below ways.<\/p>\n<p data-selectable-paragraph=\"\"><img decoding=\"async\" class=\"graf-image aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1RovsMXgaq5MKQUgG_vmv5A.png\" data-image-id=\"1*RovsMXgaq5MKQUgG_vmv5A.png\" data-width=\"845\" data-height=\"752\" \/><\/p>\n<p class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\"><strong class=\"markup--strong markup--figure-strong\" style=\"font-size: 1rem;\">Pillars of Application<\/strong><\/p>\n<h2 class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\">Introduction to Goldilocks<\/h2>\n<p class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\" data-selectable-paragraph=\"\"><span style=\"font-size: 1rem;\">Goldilocks is a Fairwinds open-source project which helps organisation by accelerating the correct or right size of resource requirement to their K8s Application. It is composed of K8s VPA(<\/span><a class=\"markup--anchor markup--p-anchor\" style=\"font-size: 1rem;\" href=\"https:\/\/docs.aws.amazon.com\/eks\/latest\/userguide\/vertical-pod-autoscaler.html\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.aws.amazon.com\/eks\/latest\/userguide\/vertical-pod-autoscaler.html\">Vertical Pod Autoscaler<\/a><span style=\"font-size: 1rem;\">) which inturn provides a controller which is responsible to create VPA Objects for workloads in your cluster. Along with this, a dashboard which visualize resource recommendations for the all enabled\/monitored workloads.<\/span><\/p>\n<p class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\" data-selectable-paragraph=\"\"><strong class=\"markup--strong markup--h3-strong\" style=\"font-size: 1.14286rem;\">Solution Overview: <\/strong><span style=\"font-size: 1rem;\">This will contain a solution overview as a whole, starting from its architecture, installations, deployment of the application, and checking resource recommendations on the dashboard.<\/span><\/p>\n<p class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\" data-selectable-paragraph=\"\"><span style=\"text-decoration: underline;\"><strong class=\"markup--strong markup--h4-strong\" style=\"font-size: 1rem;\">Architecture of Solution<\/strong><\/span><\/p>\n<p data-selectable-paragraph=\"\"><img decoding=\"async\" class=\"graf-image aligncenter\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/11h_Uwd5zr1JijP-jArnyRA.png\" data-image-id=\"1*1h_Uwd5zr1JijP-jArnyRA.png\" data-width=\"811\" data-height=\"505\" \/><\/p>\n<p class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\" data-selectable-paragraph=\"\"><strong class=\"markup--strong markup--h4-strong\" style=\"font-size: 1rem;\">(a) Installation of Goldilocks Pre-requisites and Dependencies: <\/strong><span style=\"font-size: 1rem;\">There are few prerequisites and dependencies that are required to be in place before goldilocks installation.<\/span><\/p>\n<p class=\"pw-post-body-paragraph lb lc ev ld b le mx lg lh li my lk ll lm mz lo lp lq na ls lt lu nb lw lx ly eo bj\" data-selectable-paragraph=\"\"><span style=\"font-size: 1rem;\">Below are the prerequisites:<\/span><\/p>\n<ul class=\"postList\">\n<li class=\"graf graf--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/helm.sh\/docs\/intro\/install\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/helm.sh\/docs\/intro\/install\/\">Helm3<\/a><\/li>\n<li class=\"graf graf--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/github.com\/kubernetes-sigs\/metrics-server\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/github.com\/kubernetes-sigs\/metrics-server\">Metric Server<\/a><\/li>\n<li class=\"graf graf--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/kubernetes.io\/docs\/tasks\/tools\/install-kubectl-linux\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/kubernetes.io\/docs\/tasks\/tools\/install-kubectl-linux\/\">kubectl<\/a><\/li>\n<li class=\"graf graf--li\"><a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/docs.aws.amazon.com\/eks\/latest\/userguide\/eksctl.html\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.aws.amazon.com\/eks\/latest\/userguide\/eksctl.html\">K8s Cluster<\/a><\/li>\n<li class=\"graf graf--li\">A<a class=\"markup--anchor markup--li-anchor\" href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/getting-started-install.html\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/getting-started-install.html\">WS CommandLine<\/a><\/li>\n<\/ul>\n<p><strong class=\"markup--strong markup--h4-strong\" style=\"font-size: 1rem;\">Check if the Metric Server is deployed or not?<\/strong><\/p>\n<p><span style=\"font-size: 1rem;\">In this step, we are going to check if the metric server is installed on an existing cluster or not, if not then run the below commands:<\/span><\/p>\n<pre>helm repo add metrics-server https:\/\/kubernetes-sigs.github.io\/metrics-server\r\nhelm upgrade --install metrics-server metrics-server\/metrics-server\r\n\r\n<span class=\"hljs-comment\"># Verify metric server installation <\/span>\r\nkubectl top pods -n kube-system<\/pre>\n<h2>Labelling and Enabling Target Namespace<\/h2>\n<p><strong class=\"markup--strong markup--p-strong\" style=\"font-size: 1rem;\"><em class=\"markup--em markup--p-em\">How can we enable the target namespace for resource recommendation?<\/em><\/strong><\/p>\n<p>Target Namespaces: Those namespaces for which we want resource recommendations can be enabled by simply adding the below label to it. <code class=\"markup--code markup--p-code\">goldilocks.fairwinds.com\/enabled: true<\/code><span style=\"font-size: 1rem;\"> Label to a namespace.<\/span><\/p>\n<pre>kubectl create ns mvc\r\nkubectl label ns mvc goldilocks.fairwinds.com\/enabled=<span class=\"hljs-literal\">true<\/span><\/pre>\n<h2><span style=\"font-size: 1rem;\">Deploying Goldilocks in Cluster<\/span><\/h2>\n<p>Goldilocks Deployment deploys three K8s objects (Controller, VPA Recommender, Dashboard)<\/p>\n<ul>\n<li><span style=\"font-size: 1rem;\">Controller responsible for creating the VPA objects for the workloads for target namespace whose is enabled for a Goldilocks recommendation.<\/span><\/li>\n<li><span style=\"font-size: 1rem;\">VPA Recommender is responsible for providing the resource recommendations for the workloads<\/span><\/li>\n<li><span style=\"font-size: 1rem;\">Dashboard will visualize the summary of resource recommendations made up by the VPA recommender.<\/span><\/li>\n<\/ul>\n<pre class=\"oa ob oc od oe pd pe pf bo pg ba bj\"><span id=\"5f93\" class=\"ph ma ev pe b bf pi pj l pk pl\" data-selectable-paragraph=\"\">helm repo add fairwinds-stable https:<span class=\"hljs-comment\">\/\/charts.fairwinds.com\/stable<\/span>\r\nhelm upgrade --install goldilocks fairwinds-stable\/goldilocks --<span class=\"hljs-keyword\">namespace<\/span> goldilocks --create-<span class=\"hljs-keyword\">namespace<\/span> --set vpa.enabled=<span class=\"hljs-literal\">true<\/span><\/span><\/pre>\n<pre class=\"pp pd pe pf bo pg ba bj\"><span id=\"984a\" class=\"ph ma ev pe b bf pi pj l pk pl\" data-selectable-paragraph=\"\">cloudmonk<span class=\"hljs-variable\">@Garvits<\/span><span class=\"hljs-operator\">-<\/span>MacBook<span class=\"hljs-operator\">-<\/span>Air <span class=\"hljs-operator\">~<\/span> <span class=\"hljs-operator\">%<\/span> kubectl <span class=\"hljs-keyword\">get<\/span> po <span class=\"hljs-operator\">-<\/span>n goldilocks\r\nNAME                                                  READY   STATUS    RESTARTS       AGE\r\ngoldilocks<span class=\"hljs-operator\">-<\/span>controller<span class=\"hljs-operator\">-<\/span>b764bbb9<span class=\"hljs-operator\">-<\/span>r9sxt                  <span class=\"hljs-number\">1<\/span><span class=\"hljs-operator\">\/<\/span><span class=\"hljs-number\">1<\/span>     <span class=\"hljs-keyword\">Running<\/span>   <span class=\"hljs-number\">2<\/span> (<span class=\"hljs-number\">6<\/span>d2h ago)   <span class=\"hljs-number\">16<\/span>d\r\ngoldilocks<span class=\"hljs-operator\">-<\/span>dashboard<span class=\"hljs-number\">-85<\/span>c954ff99<span class=\"hljs-operator\">-<\/span>bbmdt                 <span class=\"hljs-number\">1<\/span><span class=\"hljs-operator\">\/<\/span><span class=\"hljs-number\">1<\/span>     <span class=\"hljs-keyword\">Running<\/span>   <span class=\"hljs-number\">2<\/span> (<span class=\"hljs-number\">6<\/span>d2h ago)   <span class=\"hljs-number\">16<\/span>d\r\ngoldilocks<span class=\"hljs-operator\">-<\/span>dashboard<span class=\"hljs-number\">-85<\/span>c954ff99<span class=\"hljs-operator\">-<\/span>vqstm                 <span class=\"hljs-number\">1<\/span><span class=\"hljs-operator\">\/<\/span><span class=\"hljs-number\">1<\/span>     <span class=\"hljs-keyword\">Running<\/span>   <span class=\"hljs-number\">2<\/span> (<span class=\"hljs-number\">6<\/span>d2h ago)   <span class=\"hljs-number\">16<\/span>d\r\ngoldilocks<span class=\"hljs-operator\">-<\/span>vpa<span class=\"hljs-operator\">-<\/span>admission<span class=\"hljs-operator\">-<\/span>controller<span class=\"hljs-operator\">-<\/span>bbb69d975<span class=\"hljs-number\">-952<\/span>d6   <span class=\"hljs-number\">1<\/span><span class=\"hljs-operator\">\/<\/span><span class=\"hljs-number\">1<\/span>     <span class=\"hljs-keyword\">Running<\/span>   <span class=\"hljs-number\">2<\/span> (<span class=\"hljs-number\">6<\/span>d2h ago)   <span class=\"hljs-number\">16<\/span>d\r\ngoldilocks<span class=\"hljs-operator\">-<\/span>vpa<span class=\"hljs-operator\">-<\/span>recommender<span class=\"hljs-number\">-68<\/span>d77754b4<span class=\"hljs-operator\">-<\/span>ms7vv           <span class=\"hljs-number\">1<\/span><span class=\"hljs-operator\">\/<\/span><span class=\"hljs-number\">1<\/span>     <span class=\"hljs-keyword\">Running<\/span>   <span class=\"hljs-number\">2<\/span> (<span class=\"hljs-number\">6<\/span>d2h ago)   <span class=\"hljs-number\">16<\/span><\/span><\/pre>\n<h2>Application Integration to Goldilocks<\/h2>\n<p>In this step, we integrate our existing application in the cluster for which we want to generate some resource recommendations; the Moment you set the label in the above steps. Goldilocks VPA Recommender Object gets created for each application deployment.<\/p>\n<pre>loudmonk<span class=\"hljs-variable\">@Garvits<\/span><span class=\"hljs-operator\">-<\/span>MacBook<span class=\"hljs-operator\">-<\/span>Air Desktop <span class=\"hljs-operator\">%<\/span> kubectl <span class=\"hljs-keyword\">get<\/span> vpa <span class=\"hljs-operator\">-<\/span>n mvc\r\nNAME               MODE      CPU  MEM         PROVIDED    AGE\r\ngoldilocks<span class=\"hljs-operator\">-<\/span>mvc<span class=\"hljs-operator\">-<\/span>app Off        <span class=\"hljs-number\">15<\/span>m <span class=\"hljs-number\">104857600<\/span>     <span class=\"hljs-literal\">True<\/span>      <span class=\"hljs-number\">23<\/span>s<\/pre>\n<h2><span style=\"font-size: 1rem;\">Check Goldilocks Recommendation Dashboard<\/span><\/h2>\n<p><span style=\"font-size: 1rem;\">Goldilocks Dashboard can be accessed at port 8080; use the below command to access and check the resource recommendations <\/span><a class=\"markup--anchor markup--p-anchor\" style=\"font-size: 1rem;\" href=\"http:\/\/localhost:8080\" target=\"_blank\" rel=\"noopener\" data-href=\"http:\/\/localhost:8080\">here.<\/a><\/p>\n<pre class=\"oa ob oc od oe pd pe pf bo pg ba bj\"><span id=\"d8dd\" class=\"ph ma ev pe b bf pi pj l pk pl\" data-selectable-paragraph=\"\">kubectl -n goldilocks port-forward svc\/goldilocks-dashboard 8080:80<\/span><\/pre>\n<figure class=\"oa ob oc od oe ku km kn paragraph-image\">\n<div class=\"kv kw go kx bg ky\" tabindex=\"0\" role=\"button\"><\/div>\n<\/figure>\n<p><img decoding=\"async\" class=\"graf-image\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/11GEiZxbByJxwcjZbYGxaoQ.png\" data-image-id=\"1*1GEiZxbByJxwcjZbYGxaoQ.png\" data-width=\"3330\" data-height=\"1580\" \/><\/p>\n<p><span style=\"font-size: 1rem;\">Before start checking recommendations, let\u2019s understand <strong>What is QoS?<\/strong><\/span><\/p>\n<p><span style=\"font-size: 1rem;\">\u201cIt stands as Quality of Service (QoS) class. Kubernetes assigns each Pod a QoS class based on the resource requests and limits of its component Containers. QoS classes have been used by Kubernetes to decide which Pods to evict from a Node experiencing Node Pressure. In here, we have observed that the recommendations are available for two distinct (QoS) types: Guaranteed and Burstable. For more details, please refer <\/span><a class=\"markup--anchor markup--p-anchor\" style=\"font-size: 1rem;\" href=\"https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/quality-service-pod\/\" target=\"_blank\" rel=\"noopener\" data-href=\"https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/quality-service-pod\/\">link<\/a><span style=\"font-size: 1rem;\">\u201d <\/span><span style=\"font-size: 1rem;\">Let\u2019s analyze our targeted namespace (mvc) where our application is deployed as mvc-app.<\/span><\/p>\n<p><span style=\"font-size: 1rem;\">In the above screenshot, we can clearly see that there are two QoS that recommend the memory and CPU limit for our application.<\/span><\/p>\n<p><span style=\"font-size: 1rem;\">It is clearly observed that we have given high compute resources to our application which get over-provisioned, and based on Goldilocks recommendations, it can be optimized. The Burstable QoS recommendation for CPU request and CPU limit is 15m and 15m compared to the current setting of 100m and 300m for Guaranteed QoS. Memory requests and limits are recommended to be 105M and 105M, compared to the current setting of 180Mi and 300 Mi.<\/span><\/p>\n<p><img decoding=\"async\" class=\"graf-image\" src=\"\/blog\/wp-ttn-blog\/uploads\/2024\/01\/1GiXUkH8F2I7CngKN93z6Ew.png\" data-image-id=\"1*GiXUkH8F2I7CngKN93z6Ew.png\" data-width=\"2954\" data-height=\"1414\" \/><\/p>\n<p><span style=\"font-size: 1rem;\">In order to follow and embed the recommended resource specs, we can just copy the respective manifest file for the desired QoS class &amp; deploy the workloads by just editing the deployment or updating its helm chart or standalone manifest, which will then be right-sized and optimized.<\/span><\/p>\n<p><span style=\"font-size: 1rem;\">For instance, if we want to apply QoS recommendation to our application. We can do it by editing the deployment.<\/span><\/p>\n<pre class=\"oa ob oc od oe pd pe pf bo pg ba bj\"><span id=\"c595\" class=\"ph ma ev pe b bf pi pj l pk pl\" data-selectable-paragraph=\"\">kubectl edit deployment mvc-app -n mvc<\/span><\/pre>\n<p><span style=\"font-size: 1rem;\">Let\u2019s run the <\/span><code class=\"markup--code markup--p-code\">kubectl edit<\/code><span style=\"font-size: 1rem;\"> command to the deployment to apply the recommendations:<\/span><\/p>\n<p><span style=\"font-size: 1rem;\">Apply the recommended YAML in the resource block of the deployment manifest. Once it gets applied, we can see pods get restarted and come back with updated config.<\/span><\/p>\n<pre>kubectl <span class=\"hljs-keyword\">describe<\/span> deployment mvc<span class=\"hljs-operator\">-<\/span>app <span class=\"hljs-operator\">-<\/span>n mvc<\/pre>\n<pre><span style=\"font-size: 1.14286rem;\"><span class=\"hljs-string\">kubectl<\/span> <span class=\"hljs-string\">describe<\/span> <span class=\"hljs-string\">deployment<\/span> <span class=\"hljs-string\">mvc-app<\/span> <span class=\"hljs-string\">-n<\/span> <span class=\"hljs-string\">mvc<\/span>\r\n<span class=\"hljs-attr\">Name:<\/span> <span class=\"hljs-string\">mvc-app<\/span>\r\n<span class=\"hljs-attr\">Namespace:<\/span> <span class=\"hljs-string\">mvc<\/span>\r\n<span class=\"hljs-attr\">CreationTimestamp:<\/span> <span class=\"hljs-string\">Fri,<\/span> <span class=\"hljs-number\">15<\/span> <span class=\"hljs-string\">Sep<\/span> <span class=\"hljs-number\">2023 03:18:28<\/span> <span class=\"hljs-string\">+0530<\/span>\r\n<span class=\"hljs-attr\">Labels:<\/span> <span class=\"hljs-string\">&lt;none&gt;<\/span>\r\n<span class=\"hljs-attr\">Annotations: deployment.kubernetes.io\/revision:<\/span> <span class=\"hljs-number\">2<\/span>\r\n<span class=\"hljs-attr\">Selector:<\/span> <span class=\"hljs-string\">app=mvc-app-pods<\/span>\r\n<span class=\"hljs-attr\">Replicas:<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-string\">desired<\/span> <span class=\"hljs-string\">|<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-string\">updated<\/span> <span class=\"hljs-string\">|<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-string\">total<\/span> <span class=\"hljs-string\">|<\/span> <span class=\"hljs-number\">1<\/span> <span class=\"hljs-string\">available<\/span> <span class=\"hljs-string\">|<\/span> <span class=\"hljs-number\">0<\/span> <span class=\"hljs-string\">unavailable<\/span>\r\n<span class=\"hljs-attr\">StrategyType:<\/span> <span class=\"hljs-string\">RollingUpdate<\/span>\r\n<span class=\"hljs-attr\">MinReadySeconds:<\/span> <span class=\"hljs-number\">0<\/span>\r\n<span class=\"hljs-attr\">RollingUpdateStrategy:<\/span> <span class=\"hljs-number\">25<\/span><span class=\"hljs-string\">%<\/span> <span class=\"hljs-string\">max<\/span> <span class=\"hljs-string\">unavailable,<\/span> <span class=\"hljs-number\">25<\/span><span class=\"hljs-string\">%<\/span> <span class=\"hljs-string\">max<\/span> <span class=\"hljs-string\">surge<\/span>\r\n<span class=\"hljs-attr\">Pod Template:<\/span>\r\n<span class=\"hljs-attr\">Labels:<\/span> <span class=\"hljs-string\">app=mvc-app-pods<\/span>\r\n<span class=\"hljs-attr\">Containers:<\/span>\r\n<span class=\"hljs-attr\">mvc-app-pod:<\/span>\r\n<span class=\"hljs-attr\">Image:<\/span> <span class=\"hljs-string\">public.ecr.aws\/mvc-uat\/mvc-app:latest<\/span>\r\n<span class=\"hljs-attr\">Ports:<\/span> <span class=\"hljs-number\">8080<\/span><span class=\"hljs-string\">\/TCP,<\/span> <span class=\"hljs-number\">9404<\/span><span class=\"hljs-string\">\/TCP<\/span>\r\n<span class=\"hljs-attr\">Host Ports:<\/span> <span class=\"hljs-number\">0<\/span><span class=\"hljs-string\">\/TCP,<\/span> <span class=\"hljs-number\">0<\/span><span class=\"hljs-string\">\/TCP<\/span>\r\n<span class=\"hljs-attr\">Limits:<\/span>\r\n<span class=\"hljs-attr\">cpu:<\/span> <span class=\"hljs-string\">15m<\/span>\r\n<span class=\"hljs-attr\">memory:<\/span> <span class=\"hljs-string\">105Mi<\/span>\r\n<span class=\"hljs-attr\">Requests:<\/span>\r\n<span class=\"hljs-attr\">cpu:<\/span> <span class=\"hljs-string\">15m<\/span>\r\n<span class=\"hljs-attr\">memory:<\/span> <span class=\"hljs-string\">105Mi<\/span>\r\n<span class=\"hljs-attr\">Environment:<\/span> <span class=\"hljs-string\">&lt;none&gt;<\/span>\r\n<span class=\"hljs-attr\">Mounts:<\/span> <span class=\"hljs-string\">&lt;none&gt;<\/span>\r\n<span class=\"hljs-attr\">Volumes:<\/span> <span class=\"hljs-string\">&lt;none&gt;<\/span>\r\n<span class=\"hljs-attr\">Conditions:<\/span>\r\n<span class=\"hljs-string\">Type<\/span> <span class=\"hljs-string\">Status<\/span> <span class=\"hljs-string\">Reason<\/span>\r\n<span class=\"hljs-string\">----<\/span> <span class=\"hljs-string\">------<\/span> <span class=\"hljs-string\">------<\/span>\r\n<span class=\"hljs-string\">Available<\/span> <span class=\"hljs-literal\">True<\/span> <span class=\"hljs-string\">MinimumReplicasAvailable<\/span>\r\n<span class=\"hljs-string\">Progressing<\/span> <span class=\"hljs-literal\">True<\/span> <span class=\"hljs-string\">NewReplicaSetAvailable<\/span>\r\n<span class=\"hljs-attr\">OldReplicaSets:<\/span> <span class=\"hljs-string\">&lt;none&gt;<\/span>\r\n<span class=\"hljs-attr\">NewReplicaSet:<\/span> <span class=\"hljs-string\">mvc-app-67cdc49555<\/span> <span class=\"hljs-string\">(1\/1<\/span> <span class=\"hljs-string\">replicas<\/span> <span class=\"hljs-string\">created)<\/span>\r\n<span class=\"hljs-attr\">Events:<\/span>\r\n<span class=\"hljs-string\">Type<\/span> <span class=\"hljs-string\">Reason<\/span> <span class=\"hljs-string\">Age<\/span> <span class=\"hljs-string\">From<\/span> <span class=\"hljs-string\">Message<\/span>\r\n<span class=\"hljs-string\">----<\/span> <span class=\"hljs-string\">------<\/span> <span class=\"hljs-string\">----<\/span> <span class=\"hljs-string\">----<\/span> <span class=\"hljs-string\">-------<\/span>\r\n<span class=\"hljs-string\">Normal<\/span> <span class=\"hljs-string\">ScalingReplicaSet<\/span> <span class=\"hljs-string\">57m<\/span> <span class=\"hljs-string\">deployment-controller<\/span> <span class=\"hljs-string\">Scaled<\/span> <span class=\"hljs-string\">up<\/span> <span class=\"hljs-string\">replica<\/span> <span class=\"hljs-string\">set<\/span> <span class=\"hljs-string\">mvc-app-6cbbcf458d<\/span> <span class=\"hljs-string\">to<\/span> <span class=\"hljs-number\">1<\/span>\r\n<span class=\"hljs-string\">Normal<\/span> <span class=\"hljs-string\">ScalingReplicaSet<\/span> <span class=\"hljs-string\">41s<\/span> <span class=\"hljs-string\">deployment-controller<\/span> <span class=\"hljs-string\">Scaled<\/span> <span class=\"hljs-string\">up<\/span> <span class=\"hljs-string\">replica<\/span> <span class=\"hljs-string\">set<\/span> <span class=\"hljs-string\">mvc-app-67cdc49555<\/span> <span class=\"hljs-string\">to<\/span> <span class=\"hljs-number\">1<\/span>\r\n<span class=\"hljs-string\">Normal<\/span> <span class=\"hljs-string\">ScalingReplicaSet<\/span> <span class=\"hljs-string\">24s<\/span> <span class=\"hljs-string\">deployment-controller<\/span> <span class=\"hljs-string\">Scaled<\/span> <span class=\"hljs-string\">down<\/span> <span class=\"hljs-string\">replica<\/span> <span class=\"hljs-string\">set<\/span> <span class=\"hljs-string\">mvc-app-6cbbcf458d<\/span> <span class=\"hljs-string\">to<\/span> <span class=\"hljs-number\">0<\/span><\/span><\/pre>\n<h2><span style=\"font-size: 1.14286rem;\"><br \/>\nConclusion<\/span><\/h2>\n<p>Through this article, we observed how Goldilocks identified the right size for resource requests and limits, which further helped us to benchmark HPA. It helped in making fast decisions to set the correct QoS for our application with minimal effort, which usually takes a lot of effort by looking at observability trends. It also makes our client happy as it has made a significant impact on cost in the first place.<\/p>\n<h2><span style=\"font-size: 1.14286rem;\">References<\/span><\/h2>\n<ul>\n<li class=\"graf graf--mixtapeEmbed\"><a class=\"markup--anchor markup--mixtapeEmbed-anchor\" title=\"https:\/\/github.com\/FairwindsOps\/goldilocks\" href=\"https:\/\/github.com\/FairwindsOps\/goldilocks\" data-href=\"https:\/\/github.com\/FairwindsOps\/goldilocks\">GitHub &#8211; FairwindsOps\/goldilocks: Get your resource requests &#8220;Just Right&#8221;<\/a><\/li>\n<li class=\"graf graf--mixtapeEmbed\"><a class=\"markup--anchor markup--mixtapeEmbed-anchor\" title=\"https:\/\/goldilocks.docs.fairwinds.com\/\" href=\"https:\/\/goldilocks.docs.fairwinds.com\/\" data-href=\"https:\/\/goldilocks.docs.fairwinds.com\/\">Goldilocks Documentation | Fairwinds<br \/>\n<\/a><\/li>\n<li class=\"graf graf--mixtapeEmbed\"><a class=\"markup--anchor markup--mixtapeEmbed-anchor\" title=\"https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/quality-service-pod\/\" href=\"https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/quality-service-pod\/\" data-href=\"https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/quality-service-pod\/\">Configure Quality of Service for Pods<\/a><\/li>\n<li class=\"graf graf--mixtapeEmbed\"><a class=\"markup--anchor markup--mixtapeEmbed-anchor\" title=\"https:\/\/aws.github.io\/aws-eks-best-practices\/reliability\/docs\/application\/\" href=\"https:\/\/aws.github.io\/aws-eks-best-practices\/reliability\/docs\/application\/\" data-href=\"https:\/\/aws.github.io\/aws-eks-best-practices\/reliability\/docs\/application\/\">Applications &#8211; EKS Best Practices Guides<\/a><\/li>\n<\/ul>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>In the past decade, we have seen industries evolve their businesses by migrating their applications from monolithic to microservices using various container orchestrations such as K8s, ECS, Docker etc. In this process, a lot of effort has been put into designing architecture that should be scalable, robust, reliable, and so on. As application and business [&hellip;]<\/p>\n","protected":false},"author":1543,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":39},"categories":[2348],"tags":[5493,5303,5494,5492],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58586"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1543"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=58586"}],"version-history":[{"count":4,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58586\/revisions"}],"predecessor-version":[{"id":59672,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/58586\/revisions\/59672"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=58586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=58586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=58586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}