{"id":652,"date":"2022-07-28T09:57:32","date_gmt":"2023-06-04T23:10:57","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/uncategorized\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/"},"modified":"2024-03-07T15:10:32","modified_gmt":"2024-03-07T15:10:32","slug":"one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/","title":{"rendered":"automatic scaling of Kubernetes pods using Metrics Server?"},"content":{"rendered":"<h2>&#8220;The inception of this matter&#8221;<\/h2>\n<p>Kubernetes aims to achieve both resilience and scalability by deploying multiple pods with varying resource allocations, ensuring redundancy for your applications. While you have the option to manually adjust your deployments according to your requirements, Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed loop system automatically adjusts the allocation of resources, i.e., application Pods, based on your current needs. Simply create a HorizontalPodAutoscaler (HPA) resource for each application deployment requiring autoscaling, and it will handle the process seamlessly for you.<\/p>\n<p>HPA functions in the following manner at a broad perspective:<\/p>\n<ol>With the help of the metrics server, it monitors the resource requests metrics from your application workloads. This monitoring includes querying the metrics server and comparing the target threshold specified in the HPA definition with the average resource utilization of your application workloads, such as CPU and memory. If the threshold is reached, the HPA will scale up your application deployment to accommodate increased demands. Conversely, if the resource utilization is below the threshold, the deployment will be scaled down. You can refer to the algorithm details page in the official documentation to understand the scaling logic used by the HPA.<\/ol>\n<p>A HorizontalPodAutoscaler operates by using a dedicated controller within the Control Plane of your cluster, functioning as a CRD (Custom Resource Definition). To apply the HPA resource in your cluster, you need to generate a HorizontalPodAutoscaler YAML manifest that specifically targets your application Deployment and execute it using kubectl.<\/p>\n<p>To function properly, HPA requires a metrics server within your cluster to gather essential metrics like CPU and memory usage. A convenient choice for this is the Kubernetes Metrics Server. This server collects resource metrics from Kubelets and makes them accessible to the Horizontal Pod Autoscaler through the Kubernetes API Server. In case necessary, the Metrics API can also be accessed using kubectl top.<\/p>\n<p>In this tutorial, you will learn:<\/p>\n<ul class=\"post-ul\">\n<li>Deploy Metrics Server to your Kubernetes cluster.<\/li>\n<li>Learn how to create Horizontal Pod Autoscalers for your applications.<\/li>\n<li>Test each HPA setup, using two scenarios: constant and variable application load.<\/li>\n<\/ul>\n<p>If you are searching for a hosted Kubernetes service, take a look at our straightforward, managed Kubernetes solution designed to facilitate scalability.<\/p>\n<h2>Requirements<\/h2>\n<p>To follow this guide, you will require:<\/p>\n<ul class=\"post-ul\">\n<li>A Kubernetes cluster with role-based access control (RBAC) enabled. This setup will use a Silicon Cloud Kubernetes cluster, but you could also create a cluster manually. Your Kubernetes version should be between 1.20 and 1.25.<\/li>\n<li>The kubectl command-line tool installed in your local environment and configured to connect to your cluster. You can read more about installing kubectl in the official documentation. If you are using a Silicon Cloud Kubernetes cluster, please refer to How to Connect to a Silicon Cloud Kubernetes Cluster to learn how to connect to your cluster using kubectl.<\/li>\n<li>The version control tool Git available in your development environment. If you are working in Ubuntu, you can refer to installing Git on Ubuntu 22.04<\/li>\n<li>The Kubernetes Helm package manager also available in your development environment. You can refer to how to install software with Helm to install Helm locally.<\/li>\n<\/ul>\n<h2>Step 1 &#8211; Use Helm to install Metrics Server.<\/h2>\n<p>To begin, include the metrics-server repository in your helm package listings. You may utilize helm repo add for this purpose.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">helm repo <span class=\"token function\">add<\/span> metrics-server https:\/\/kubernetes-sigs.github.io\/metrics-server<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Afterwards, employ the command helm repo update to renew the list of accessible packages.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">helm repo update metrics-server<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Hang tight while we grab the latest from your chart repositories&#8230; &#8230;Successfully got an update from the &#8220;metrics-server&#8221; chart repository Update Complete. \u2388Happy Helming!\u2388<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>After integrating the repository with helm, you will have the capability to include metrics-server in your Kubernetes deployments. While you have the option to create your own deployment configuration, this tutorial will use Silicon Cloud\u2019s Kubernetes Starter Kit, which already includes a configuration for metrics-server.<\/p>\n<p>To accomplish that, duplicate the Kubernetes Starter Kit Git repository.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">git<\/span> clone https:\/\/github.com\/digitalocean\/Kubernetes-Starter-Kit-Developers.git<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>You can find the configuration for metrics-server at Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/metrics-server-values-v3.8.2.yaml. To view or edit it, you can utilize nano or any text editor of your choice.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/metrics-server-values-v3.8.2.yaml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>The set of parameters is limited, with the replicas always being fixed at a value of 2.<\/p>\n<div>yaml file with version 3.8.2 of metrics server values.<\/div>\n<pre class=\"post-pre\"><code>## Starter Kit metrics-server configuration\r\n## Ref: https:\/\/github.com\/kubernetes-sigs\/metrics-server\/blob\/metrics-server-helm-chart-3.8.2\/charts\/metrics-server\r\n##\r\n\r\n# Number of metrics-server replicas to run\r\nreplicas: <mark>2<\/mark>\r\n\r\napiService:\r\n  # Specifies if the v1beta1.metrics.k8s.io API service should be created.\r\n  #\r\n  # You typically want this enabled! If you disable API service creation you have to\r\n  # manage it outside of this chart for e.g horizontal pod autoscaling to\r\n  # work with this release.\r\n  create: true\r\n\r\nhostNetwork:\r\n  # Specifies if metrics-server should be started in hostNetwork mode.\r\n  #\r\n  # You would require this enabled if you use alternate overlay networking for pods and\r\n  # API server unable to communicate with metrics-server. As an example, this is required\r\n  # if you use Weave network on EKS\r\n  enabled: false\r\n<\/code><\/pre>\n<p>For information on the available metrics-server parameters, please refer to the Metrics Server chart page.<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>Be cautious when aligning Kubernetes deployments with the appropriate version of Kubernetes, as the helm charts are also versioned to ensure compatibility. The metrics-server helm chart available now is 3.8.2 and it deploys version 0.6.1 of metrics-server. Referring to the Metrics Server Compatibility Matrix, it is evident that version 0.6.x is compatible with Kubernetes 1.19 or later versions.<\/div>\n<\/div>\n<p>Once you have examined the file and made necessary modifications, you can move forward with deploying metrics-server by including this file in the helm install command.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token assign-left variable\">HELM_CHART_VERSION<\/span><span class=\"token operator\">=<\/span><span class=\"token string\">&#8220;3.8.2&#8221;<\/span><\/li>\n<li data-prefix=\"$\"><\/li>\n<li data-prefix=\"$\">helm <span class=\"token function\">install<\/span> metrics-server metrics-server\/metrics-server <span class=\"token parameter variable\">&#8211;version<\/span> <span class=\"token string\">&#8220;<span class=\"token variable\">$HELM_CHART_VERSION<\/span>&#8220;<\/span> <span class=\"token punctuation\">\\<\/span><\/li>\n<li data-prefix=\"$\"><span class=\"token parameter variable\">&#8211;namespace<\/span> metrics-server <span class=\"token punctuation\">\\<\/span><\/li>\n<li data-prefix=\"$\">&#8211;create-namespace <span class=\"token punctuation\">\\<\/span><\/li>\n<li data-prefix=\"$\"><span class=\"token parameter variable\">-f<\/span> <span class=\"token string\">&#8220;Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/metrics-server-values-v<span class=\"token variable\">${HELM_CHART_VERSION}<\/span>.yaml&#8221;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Your configured Kubernetes cluster will have metrics-server deployed.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME: metrics-server LAST DEPLOYED: Wed May 25 11:54:43 2022 NAMESPACE: metrics-server STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: *********************************************************************** * Metrics Server * *********************************************************************** Chart version: 3.8.2 App version: 0.6.1 Image tag: k8s.gcr.io\/metrics-server\/metrics-server:v0.6.1 ***********************************************************************<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Once you have deployed, you can utilize the helm ls command to confirm the addition of metrics-server to your deployment.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">helm <span class=\"token function\">ls<\/span> <span class=\"token parameter variable\">-n<\/span> metrics-server<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION metrics-server metrics-server 1 2022-02-24 14:58:23.785875 +0200 EET deployed metrics-server-3.8.2 0.6.1<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Afterward, you have the option to verify the condition of all Kubernetes resources that have been deployed to the metrics-server namespace.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl get all <span class=\"token parameter variable\">-n<\/span> metrics-server<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>According to the configuration you used for deployment, you should have a total of two available instances for both deployment.apps and replicaset.apps.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME READY STATUS RESTARTS AGE pod\/metrics-server-694d47d564-9sp5h 1\/1 Running 0 8m54s pod\/metrics-server-694d47d564-cc4m2 1\/1 Running 0 8m54s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service\/metrics-server ClusterIP 10.245.92.63 &lt;none&gt; 443\/TCP 8m54s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps\/metrics-server 2\/2 2 2 8m55s NAME DESIRED CURRENT READY AGE replicaset.apps\/metrics-server-694d47d564 2 2 2 8m55s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>You have successfully installed metrics-server in your Kubernetes cluster. Next, you will examine a few parameters of a HorizontalPodAutoscaler Custom Resource Definition.<\/p>\n<h2>Step 2 &#8211; Familiarizing oneself with HPAs<\/h2>\n<p>Until now, your setup has been using a constant value to deploy the ReplicaSet instances. In this next phase, you will discover how to define a HorizontalPodAutoscaler CRD, which will enable the value to expand or contract dynamically.<\/p>\n<p>The structure of a regular HorizontalPodAutoscaler CRD appears as follows:<\/p>\n<div>\n<p>Please provide an alternative for &#8220;crd.yaml&#8221; in a more native way:<\/p>\n<p>file.crd<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>apiVersion: autoscaling\/v2beta2\r\nkind: HorizontalPodAutoscaler\r\nmetadata:\r\n  name: my-app-hpa\r\nspec:\r\n  scaleTargetRef:\r\n    apiVersion: apps\/v1\r\n    kind: Deployment\r\n    name: my-app-deployment\r\n  minReplicas: 1\r\n  maxReplicas: 3\r\n  metrics:\r\n    - type: Resource\r\n      resource:\r\n        name: cpu\r\n        target:\r\n          type: Utilization\r\n          averageUtilization: 50\r\n<\/code><\/pre>\n<p>The parameters utilized in this setup are listed below:<\/p>\n<ul class=\"post-ul\">\n<li>spec.scaleTargetRef: A named reference to the resource being scaled.<\/li>\n<li>spec.minReplicas: The lower limit for the number of replicas to which the autoscaler can scale down.<\/li>\n<li>spec.maxReplicas: The upper limit.<\/li>\n<li>spec.metrics.type: The metric to use to calculate the desired replica count. This example is using the Resource type, which tells the HPA to scale the deployment based on average CPU (or memory) utilization. averageUtilization is set to a threshold value of 50.<\/li>\n<\/ul>\n<p>You can choose between two options when creating an HPA for your application deployment.<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Just follow these steps:<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>1. Employ the kubectl autoscale command for a current deployment.<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>2. Generate a HPA YAML manifest and apply the alterations to your cluster using kubectl.<\/ol>\n<p>You will start with option #1, utilizing a different setup provided by Silicon Cloud Kubernetes Starter Kit. This setup includes a deployment named myapp-test.yaml, which will showcase the functionality of Horizontal Pod Autoscaling (HPA) by generating a random CPU workload.<\/p>\n<p>You are able to examine that document by utilizing either nano or your preferred text editor.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/myapp-test.yaml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div>Could you provide more context or information about &#8220;myapp-test.yaml&#8221; to help me provide an appropriate paraphrase?<\/div>\n<pre class=\"post-pre\"><code>apiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: myapp-test\r\nspec:\r\n  selector:\r\n    matchLabels:\r\n      run: myapp-test\r\n  replicas: 1\r\n  template:\r\n    metadata:\r\n      labels:\r\n        run: myapp-test\r\n    spec:\r\n      containers:\r\n        - name: busybox\r\n          image: busybox\r\n          resources:\r\n            limits:\r\n              cpu: 50m\r\n            requests:\r\n              cpu: 20m\r\n          command: [\"sh\", \"-c\"]\r\n          args:\r\n            - <mark>while [ 1 ]; do<\/mark>\r\n              <mark>echo \"Test\";<\/mark>\r\n              <mark>sleep 0.01;<\/mark>\r\n              <mark>done<\/mark>\r\n<\/code><\/pre>\n<p>Take note of the closing lines in this document. They incorporate shell syntax to continuously display the word &#8220;Test&#8221; one hundred times per second, imitating a load. Once you finish evaluating the document, you can utilize kubectl to deploy it into your cluster.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl apply <span class=\"token parameter variable\">-f<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/myapp-test.yaml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Afterwards, proceed to utilize kubectl autoscale for the myapp-test deployment, thus creating a HorizontalPodAutoscaler.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl autoscale deployment myapp-test &#8211;cpu-percent<span class=\"token operator\">=<\/span><span class=\"token number\">50<\/span> <span class=\"token parameter variable\">&#8211;min<\/span><span class=\"token operator\">=<\/span><span class=\"token number\">1<\/span> <span class=\"token parameter variable\">&#8211;max<\/span><span class=\"token operator\">=<\/span><span class=\"token number\">3<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Take note of the parameters given to this command. It implies that your deployment will automatically adjust the number of replicas between 1 and 3 based on CPU utilization, triggered when it reaches 50 percent.<\/p>\n<p>To determine if the HPA resource has been created, execute the command &#8220;kubectl get hpa&#8221;.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl get hpa<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>The TARGETS column in the output will eventually display the current usage percentage compared to the target usage percentage.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE myapp-test Deployment\/myapp-test 240%\/50% 1 3 3 52s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>Please be aware that for a brief period of about 15 seconds, the TARGETS column will show \/50%. This is a normal occurrence as HPA requires some time to gather average values and it will not have sufficient data before the initial 15-second interval. HPA follows a default setting of checking metrics every 15 seconds.<\/div>\n<\/div>\n<p>To view the logged events generated by a Horizontal Pod Autoscaler, you can utilize kubectl describe command.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl describe hpa myapp-test<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Name: myapp-test Namespace: default Labels: &lt;none&gt; Annotations: &lt;none&gt; CreationTimestamp: Mon, 28 May 2022 10:10:50 -0800 Reference: Deployment\/myapp-test Metrics: ( current \/ target ) resource cpu on pods (as a percentage of request): 240% (48m) \/ 50% Min replicas: 1 Max replicas: 3 Deployment pods: 3 current \/ 3 desired &#8230; Events: Type Reason Age From Message &#8212;- &#8212;&#8212; &#8212;- &#8212;- &#8212;&#8212;- Normal SuccessfulRescale 17s horizontal-pod-autoscaler New size: 2; reason: cpu resource utilization (percentage of request) above target Normal SuccessfulRescale 37s horizontal-pod-autoscaler New size: 3; reason: cpu resource utilization (percentage of request) above target<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>The recommended approach for creating Horizontal Pod Autoscalers (HPA) in a production environment is to utilize a dedicated YAML manifest instead of the kubectl autoscale method. By maintaining the manifest in a Git repository, you can easily monitor changes and make necessary modifications.<\/p>\n<p>In the final step of this tutorial, you will go through an example of this. However, before proceeding, make sure to delete the myapp-test deployment and its corresponding HPA resource.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl delete hpa myapp-test<\/li>\n<li data-prefix=\"$\">kubectl delete deployment myapp-test<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h2>Step 3 &#8211; Automatically scale applications using the Metrics Server.<\/h2>\n<p>In this final stage, you will conduct experiments using two methods to generate server load and scale through a YAML manifest.<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>One possible paraphrasing could be:<\/ol>\n<\/li>\n<\/ol>\n<p>A software deployment that generates a consistent workload by executing computationally intensive tasks.<br \/>\nA shell script emulates that external workload by making rapid and consecutive HTTP requests for a web application.<\/p>\n<h3>Continuous Load Test<\/h3>\n<p>You will be developing a sample application utilizing Python in this situation. The application will execute some computationally intensive tasks. This Python code is present in one of the example manifests in the starter kit, just like the shell script in the previous step. To access it, you can use nano or any other preferred text editor to open the constant-load-deployment-test.yaml file.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/constant-load-deployment-test.yaml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div>constant-load-deployment-test.yaml can be paraphrased as a YAML file for testing continuous deployment under consistent load.<\/div>\n<pre class=\"post-pre\"><code>---\r\napiVersion: v1\r\nkind: ConfigMap\r\nmetadata:\r\n  name: python-test-code-configmap\r\ndata:\r\n  entrypoint.sh: |-\r\n    #!\/usr\/bin\/env python\r\n\r\n    <mark>import math<\/mark>\r\n\r\n    <mark>while True:<\/mark>\r\n      <mark>x = 0.0001<\/mark>\r\n      <mark>for i in range(1000000):<\/mark>\r\n        <mark>x = x + math.sqrt(x)<\/mark>\r\n        <mark>print(x)<\/mark>\r\n      <mark>print(\"OK!\")<\/mark>\r\n\r\n---\r\napiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: constant-load-deployment-test\r\nspec:\r\n  selector:\r\n    matchLabels:\r\n      run: python-constant-load-test\r\n  replicas: 1\r\n  template:\r\n    metadata:\r\n      labels:\r\n        run: python-constant-load-test\r\n    spec:\r\n      containers:\r\n        - name: python-runtime\r\n          image: python:alpine3.15\r\n          resources:\r\n            limits:\r\n              cpu: 50m\r\n            requests:\r\n              cpu: 20m\r\n          command:\r\n            - \/bin\/entrypoint.sh\r\n          volumeMounts:\r\n            - name: python-test-code-volume\r\n              mountPath: \/bin\/entrypoint.sh\r\n              readOnly: true\r\n              subPath: entrypoint.sh\r\n      volumes:\r\n        - name: python-test-code-volume\r\n          configMap:\r\n            defaultMode: 0700\r\n            name: python-test-code-configmap\r\n<\/code><\/pre>\n<p>Above, you can see the highlighted Python code that continuously generates random square roots. To execute this code, the deployment process will retrieve a docker image containing the necessary python runtime. It will then connect a ConfigMap to the application Pod that hosts the Python script given earlier.<\/p>\n<p>To improve observability, begin by generating a distinct namespace for this deployment. Subsequently, deploy it using kubectl.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl create ns hpa-constant-load<\/li>\n<li data-prefix=\"$\"><\/li>\n<li data-prefix=\"$\">kubectl apply <span class=\"token parameter variable\">-f<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/constant-load-deployment-test.yaml <span class=\"token parameter variable\">-n<\/span> hpa-constant-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>configmap\/python-test-code-configmap created deployment.apps\/constant-load-deployment-test created<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>Please ensure that resource request limits are set for the Pods of the sample application as it is crucial for the HPA logic to function properly. It is recommended to set resource request limits for all your application Pods to prevent any unforeseen bottlenecks.<\/div>\n<\/div>\n<p>Please confirm that the deployment was successfully created and is operational.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl get deployments <span class=\"token parameter variable\">-n<\/span> hpa-constant-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME READY UP-TO-DATE AVAILABLE AGE constant-load-deployment-test 1\/1 1 1 8s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Afterward, you must proceed with the deployment of an additional HPA to this cluster. You can access an example specifically designed for this situation in constant-load-hpa-test.yaml, which you can open using nano or any text editor of your preference.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/constant-load-hpa-test.yaml <span class=\"token parameter variable\">-n<\/span> hpa-constant-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div>constant-load-hpa-test.yaml file will remain unchanged.<\/div>\n<pre class=\"post-pre\"><code>apiVersion: autoscaling\/v2beta2\r\nkind: HorizontalPodAutoscaler\r\nmetadata:\r\n  name: constant-load-test\r\nspec:\r\n  scaleTargetRef:\r\n    apiVersion: apps\/v1\r\n    kind: Deployment\r\n    name: constant-load-deployment-test\r\n  minReplicas: 1\r\n  maxReplicas: 3\r\n  metrics:\r\n    - type: Resource\r\n      resource:\r\n        name: cpu\r\n        target:\r\n          type: Utilization\r\n          averageUtilization: 50\r\n<\/code><\/pre>\n<p>Use kubectl to implement it.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl apply <span class=\"token parameter variable\">-f<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/constant-load-hpa-test.yaml <span class=\"token parameter variable\">-n<\/span> hpa-constant-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>To monitor the state of the constant-load-test HPA, you can use the command &#8220;kubectl get hpa&#8221;. This command will create a HPA resource that focuses on the sample Python deployment.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl get hpa constant-load-test <span class=\"token parameter variable\">-n<\/span> hpa-constant-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Take note of the REFERENCE column that focuses on constant-load-deployment-test, along with the TARGETS column displaying the current CPU resource requests compared to the threshold value, similar to the previous example.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE constant-load-test Deployment\/constant-load-deployment-test 255%\/50% 1 3 3 49s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>In the HPA CRD spec, it mentions that the number of replicas in the REPLICAS column for the sample application deployment increased from 1 to 3. This increase occurred rapidly due to the high CPU load generated by the application used in this demonstration. Similar to the previous example, you can examine the HPA events logged by using the command kubectl describe hpa -n hpa-constant-load.<\/p>\n<h3>Testing the Load from an External Source<\/h3>\n<p>One alternative way to make things more intriguing and believable is to monitor the generation of external load. In this last instance, you will utilize a separate namespace and collection of documents to ensure no data is recycled from the previous experiment.<\/p>\n<p>This illustration is going to utilize the sample server known as &#8220;quote of the moment&#8221; server. Each time this server receives an HTTP request, it will send back a distinct quote as a response. By sending HTTP requests every 1ms, you will generate load on your cluster. The deployment for this scenario can be found in the quote_deployment.yaml file. You can review this file using nano or any text editor of your preference.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/quote_deployment.yaml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div>rewrite the quote_deployment.yaml<\/div>\n<pre class=\"post-pre\"><code>---\r\napiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: quote\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    matchLabels:\r\n      app: quote\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: quote\r\n    spec:\r\n      containers:\r\n        - name: quote\r\n          image: docker.io\/datawire\/quote:0.4.1\r\n          ports:\r\n            - name: http\r\n              containerPort: 8080\r\n          resources:\r\n            requests:\r\n              cpu: 100m\r\n              memory: 50Mi\r\n            limits:\r\n              cpu: 200m\r\n              memory: 100Mi\r\n\r\n---\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: quote\r\nspec:\r\n  ports:\r\n    - name: http\r\n      port: 80\r\n      targetPort: 8080\r\n  selector:\r\n    app: quote\r\n<\/code><\/pre>\n<p>Please be aware that the current HTTP query script is not included in the manifest at this point. The manifest is only responsible for setting up the application to execute the queries. Once you have finished reviewing the file, use kubectl to create the quote namespace and deployment.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl create ns hpa-external-load<\/li>\n<li data-prefix=\"$\"><\/li>\n<li data-prefix=\"$\">kubectl apply <span class=\"token parameter variable\">-f<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/quote_deployment.yaml <span class=\"token parameter variable\">-n<\/span> hpa-external-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Please confirm that the deployment and services of the quote application are functioning properly.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl get all <span class=\"token parameter variable\">-n<\/span> hpa-external-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME READY STATUS RESTARTS AGE pod\/quote-dffd65947-s56c9 1\/1 Running 0 3m5s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service\/quote ClusterIP 10.245.170.194 &lt;none&gt; 80\/TCP 3m5s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps\/quote 1\/1 1 1 3m5s NAME DESIRED CURRENT READY AGE replicaset.apps\/quote-6c8f564ff 1 1 1 3m5s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Afterwards, you will generate the HPA for the quote deployment. This can be set up in quote-deployment-hpa-test.yaml. Examine the contents of the file using the nano text editor or any other preferred text editor.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/quote-deployment-hpa-test.yaml<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div>&#8220;Please provide a single paraphrased version of the following file name: &#8216;quote-deployment-hpa-test.yaml&#8217;.&#8221;<\/div>\n<pre class=\"post-pre\"><code>apiVersion: autoscaling\/v2beta2\r\nkind: HorizontalPodAutoscaler\r\nmetadata:\r\n  name: external-load-test\r\nspec:\r\n  scaleTargetRef:\r\n    apiVersion: apps\/v1\r\n    kind: Deployment\r\n    name: quote\r\n  behavior:\r\n    scaleDown:\r\n      <mark>stabilizationWindowSeconds: 60<\/mark>\r\n  minReplicas: 1\r\n  maxReplicas: 3\r\n  metrics:\r\n    - type: Resource\r\n      resource:\r\n        name: cpu\r\n        target:\r\n          type: Utilization\r\n          <mark>averageUtilization: 20<\/mark>\r\n<\/code><\/pre>\n<p>Please keep in mind that in this situation, the CPU utilization resource metric has a distinct threshold value (20%). Additionally, the scaling behavior is different. This setup modifies the behavior of scaleDown.stabilizationWindowSeconds, reducing it to 60 seconds. This adjustment may not always be necessary, but in this particular scenario, it helps accelerate the process to observe how the autoscaler performs the scale-down action more rapidly. By default, the HorizontalPodAutoscaler has a cooldown period of 5 minutes. This duration is typically adequate and prevents any fluctuations during replica scaling.<\/p>\n<p>Once you are prepared, use kubectl to deploy it.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl apply <span class=\"token parameter variable\">-f<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/hpa\/metrics-server\/quote-deployment-hpa-test.yaml <span class=\"token parameter variable\">-n<\/span> hpa-external-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Now, verify the availability and functionality of the HPA resource.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl get hpa external-load-test <span class=\"token parameter variable\">-n<\/span> hpa-external-load<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE external-load-test Deployment\/quote 1%\/20% 1 3 1 108s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>In the end, you will execute the real HTTP queries by running the shell script called quote_service_load_test.sh. The reason for not including this script in the manifest earlier is to allow you to monitor its execution in your cluster and view the logs directly in your terminal. Take a look at the script using nano or any text editor you prefer.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">nano<\/span> Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/scripts\/quote_service_load_test.sh<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div>script to test the load of the quote service<\/div>\n<pre class=\"post-pre\"><code>#!\/usr\/bin\/env sh\r\n\r\necho\r\necho \"[INFO] Starting load testing in 10s...\"\r\nsleep 10\r\necho \"[INFO] Working (press Ctrl+C to stop)...\"\r\nkubectl run -i --tty load-generator \\\r\n    --rm \\\r\n    --image=busybox \\\r\n    --restart=Never \\\r\n    -n hpa-external-load \\\r\n    -- \/bin\/sh -c \"while sleep 0.001; do wget -q -O- http:\/\/quote; done\" &gt; \/dev\/null 2&gt;&amp;1\r\necho \"[INFO] Load testing finished.\"\r\n<\/code><\/pre>\n<p>To carry out this demonstration, please open two different terminal windows. In the first window, execute the shell script called quote_service_load_test.sh.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">Kubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/scripts\/quote_service_load_test.sh<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Afterwards, in the second window, execute a kubectl watch command on the HPA resource with the -w flag.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">kubectl get hpa <span class=\"token parameter variable\">-n<\/span> hpa-external-load <span class=\"token parameter variable\">-w<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>You should observe the load increasing gradually and adjusting automatically.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE external-load-test Deployment\/quote 1%\/20% 1 3 1 2m49s external-load-test Deployment\/quote 29%\/20% 1 3 1 3m1s external-load-test Deployment\/quote 67%\/20% 1 3 2 3m16s<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>When the load increases, you can see the autoscaler in action as it increases the number of replicas in the quote server deployment. Once the load generator script is stopped, there will be a cooldown period. After approximately 1 minute, the number of replicas is reduced back to the initial value of 1. To stop the running script, you can press Ctrl+C after returning to the first terminal window.<\/p>\n<h2>In summary<\/h2>\n<p>You have successfully implemented and studied the functionality of Horizontal Pod Autoscaling (HPA) using Kubernetes Metrics Server in various situations. HPA plays a vital role in Kubernetes by allowing your infrastructure to efficiently manage increased traffic when necessary.<\/p>\n<p>The Metrics Server has a notable drawback as it is only capable of measuring CPU and memory usage. To gain a comprehensive understanding of its functionality, it is advisable to refer to the Metrics Server documentation. However, if you have a need to scale based on metrics like disk usage or network load, you can utilize Prometheus with the assistance of a dedicated adapter known as prometheus-adapter.<\/p>\n<p>More Tutorials<\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/one-option-for-paraphrasing-the-given-phrase-could-be-different-server-configurations-frequently-used-for-your-web-application\/\" target=\"_blank\" rel=\"noopener\">Server Configurations Frequently Used for Your Web Application<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/insertmany-function-for-bulk-insertion\/\" target=\"_blank\" rel=\"noopener\">insertMany function for bulk insertion into a MongoDB database.<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/adding-a-string-to-a-python-variable\/\" target=\"_blank\" rel=\"noopener\">Adding a string to a Python variable<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/permissions-in-postgresql\/\" target=\"_blank\" rel=\"noopener\">permissions in PostgreSQL<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/common-errors-that-occur-when-using-nginx-for-connections\/\" target=\"_blank\" rel=\"noopener\">Common errors that occur when using Nginx for connections.<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;The inception of this matter&#8221; Kubernetes aims to achieve both resilience and scalability by deploying multiple pods with varying resource allocations, ensuring redundancy for your applications. While you have the option to manually adjust your deployments according to your requirements, Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-652","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>automatic scaling of Kubernetes pods using Metrics Server? - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed loop system\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"automatic scaling of Kubernetes pods using Metrics Server?\" \/>\n<meta property=\"og:description\" content=\"Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed loop system\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-04T23:10:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-07T15:10:32+00:00\" \/>\n<meta name=\"author\" content=\"Ava Mitchell\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ava Mitchell\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\"},\"author\":{\"name\":\"Ava Mitchell\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64\"},\"headline\":\"automatic scaling of Kubernetes pods using Metrics Server?\",\"datePublished\":\"2023-06-04T23:10:57+00:00\",\"dateModified\":\"2024-03-07T15:10:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\"},\"wordCount\":3191,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\",\"name\":\"automatic scaling of Kubernetes pods using Metrics Server? - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2023-06-04T23:10:57+00:00\",\"dateModified\":\"2024-03-07T15:10:32+00:00\",\"description\":\"Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed loop system\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"automatic scaling of Kubernetes pods using Metrics Server?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64\",\"name\":\"Ava Mitchell\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g\",\"caption\":\"Ava Mitchell\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/avamitchell\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"automatic scaling of Kubernetes pods using Metrics Server? - Blog - Silicon Cloud","description":"Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed loop system","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/","og_locale":"en_US","og_type":"article","og_title":"automatic scaling of Kubernetes pods using Metrics Server?","og_description":"Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed loop system","og_url":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2023-06-04T23:10:57+00:00","article_modified_time":"2024-03-07T15:10:32+00:00","author":"Ava Mitchell","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Ava Mitchell","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/"},"author":{"name":"Ava Mitchell","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64"},"headline":"automatic scaling of Kubernetes pods using Metrics Server?","datePublished":"2023-06-04T23:10:57+00:00","dateModified":"2024-03-07T15:10:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/"},"wordCount":3191,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/","url":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/","name":"automatic scaling of Kubernetes pods using Metrics Server? - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2023-06-04T23:10:57+00:00","dateModified":"2024-03-07T15:10:32+00:00","description":"Kubernetes offers excellent support for on-demand scaling through its Horizontal Pod Autoscaling feature. This closed loop system","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/one-possible-paraphrase-for-the-given-sentence-ishow-to-set-up-automatic-scaling-of-kubernetes-pods-using-metrics-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"automatic scaling of Kubernetes pods using Metrics Server?"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/a3e2658c2cb9fb2be95ae0a8861f4a64","name":"Ava Mitchell","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/15c63cd0564b4a2e07d611bcdffa296f6ea80e8db07c3091f43a84010514899d?s=96&d=mm&r=g","caption":"Ava Mitchell"},"url":"https:\/\/www.silicloud.com\/blog\/author\/avamitchell\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=652"}],"version-history":[{"count":3,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/652\/revisions"}],"predecessor-version":[{"id":1799,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/652\/revisions\/1799"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}