{"id":294,"date":"2023-04-08T02:53:52","date_gmt":"2022-11-04T07:46:01","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/"},"modified":"2025-07-31T22:24:47","modified_gmt":"2025-07-31T13:24:47","slug":"%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/","title":{"rendered":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d"},"content":{"rendered":"<h2>\u306f\u3058\u3081\u306b<\/h2>\n<p>Kubernetes\u306f\u3001\u8010\u969c\u5bb3\u6027\u3068\u62e1\u5f35\u6027\u306e\u4e21\u65b9\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3092\u76ee\u6307\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u306f\u3001\u7570\u306a\u308b\u30ea\u30bd\u30fc\u30b9\u5272\u308a\u5f53\u3066\u3092\u6301\u3064\u8907\u6570\u306e\u30dd\u30c3\u30c9\u3092\u5c55\u958b\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5197\u9577\u6027\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u81ea\u5206\u81ea\u8eab\u306e\u5c55\u958b\u3092\u624b\u52d5\u3067\u62e1\u5f35\u307e\u305f\u306f\u7e2e\u5c0f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001Kubernetes\u306fHorizontal Pod Autoscaling\u3068\u547c\u3070\u308c\u308b\u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u3066\u3001\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30fc\u30b9\u30c8\u30af\u30e9\u30b9\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u73fe\u5728\u306e\u30cb\u30fc\u30ba\u306b\u57fa\u3065\u3044\u3066\u30ea\u30bd\u30fc\u30b9\uff08\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30dd\u30c3\u30c9\uff09\u3092\u81ea\u52d5\u7684\u306b\u62e1\u5927\u307e\u305f\u306f\u7e2e\u5c0f\u3059\u308b\u30af\u30ed\u30fc\u30ba\u30c9\u30eb\u30fc\u30d7\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u81ea\u52d5\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u304c\u5fc5\u8981\u306a\u5404\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5c55\u958b\u306bHorizontalPodAutoscaler\uff08\u307e\u305f\u306fHPA\uff09\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u306b\u81ea\u52d5\u7684\u306b\u4e16\u8a71\u3092\u3057\u3066\u3082\u3089\u3044\u307e\u3059\u3002<\/p>\n<p>\u9ad8\u3044\u6c34\u6e96\u3067\u306eHPA\u306e\u5f79\u5272\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\uff08Pods\uff09\u304b\u3089\u30ea\u30bd\u30fc\u30b9\u8981\u6c42\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u76e3\u8996\u3057\u3001\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u306b\u554f\u3044\u5408\u308f\u305b\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>HPA\u306e\u5b9a\u7fa9\u3067\u8a2d\u5b9a\u3057\u305f\u76ee\u6a19\u95be\u5024\u3068\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30ef\u30fc\u30af\u30ed\u30fc\u30c9\uff08CPU\u3068\u30e1\u30e2\u30ea\uff09\u306e\u5e73\u5747\u30ea\u30bd\u30fc\u30b9\u5229\u7528\u72b6\u6cc1\u3092\u6bd4\u8f03\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u76ee\u6a19\u95be\u5024\u306b\u9054\u3059\u308b\u3068\u3001HPA\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5c55\u958b\u3092\u30b9\u30b1\u30fc\u30eb\u30a2\u30c3\u30d7\u3057\u3066\u3001\u9700\u8981\u306e\u5897\u52a0\u306b\u5bfe\u5fdc\u3057\u307e\u3059\u3002\u95be\u5024\u3092\u4e0b\u56de\u308b\u5834\u5408\u306f\u3001\u5c55\u958b\u3092\u30b9\u30b1\u30fc\u30eb\u30c0\u30a6\u30f3\u3057\u307e\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5c55\u958b\u3092\u30b9\u30b1\u30fc\u30eb\u3059\u308b\u305f\u3081\u306eHPA\u306e\u30ed\u30b8\u30c3\u30af\u306b\u3064\u3044\u3066\u306f\u3001\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u8a73\u7d30\u30da\u30fc\u30b8\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/ol>\n<p>\u30db\u30ea\u30be\u30f3\u30bf\u30eb\u30dd\u30c3\u30c9\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30e9\u30fc\u306f\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u5236\u5fa1\u30d7\u30ec\u30fc\u30f3\u5185\u306b\u3042\u308b\u5c02\u7528\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4ecb\u3057\u3066\u5b9f\u88c5\u3055\u308c\u305fKubernetes\u5236\u5fa1\u30eb\u30fc\u30d7\u3092\u99c6\u52d5\u3059\u308bCRD\uff08\u30ab\u30b9\u30bf\u30e0\u30ea\u30bd\u30fc\u30b9\u5b9a\u7fa9\uff09\u3067\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3092\u30bf\u30fc\u30b2\u30c3\u30c8\u3068\u3057\u305fHorizontalPodAutoscaler\u306eYAML\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u5f8c\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u3067HPA\u30ea\u30bd\u30fc\u30b9\u3092\u9069\u7528\u3059\u308b\u305f\u3081\u306bkubectl\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>HPA\u304c\u6b63\u5e38\u306b\u52d5\u4f5c\u3059\u308b\u305f\u3081\u306b\u306f\u3001CPU\u4f7f\u7528\u7387\u3084\u30e1\u30e2\u30ea\u4f7f\u7528\u7387\u306a\u3069\u5fc5\u8981\u306a\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u53ce\u96c6\u3059\u308b\u305f\u3081\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u304c\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u3067\u5229\u7528\u53ef\u80fd\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002Kubernetes Metrics Server\u306f\u3001\u305d\u306e1\u3064\u306e\u76f4\u611f\u7684\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002Metrics Server\u306f\u3001Kubelet\u304b\u3089\u30ea\u30bd\u30fc\u30b9\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u53ce\u96c6\u3057\u3001\u305d\u308c\u3089\u3092Kubernetes API\u30b5\u30fc\u30d0\u30fc\u7d4c\u7531\u3067Horizontal Pod Autoscaler\u306b\u516c\u958b\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u6a5f\u80fd\u3057\u307e\u3059\u3002\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001Metrics API\u306fkubectl top\u3092\u4ecb\u3057\u3066\u3082\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u6b21\u306e\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/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>\u3082\u3057\u7ba1\u7406\u3055\u308c\u305fKubernetes\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u3092\u304a\u63a2\u3057\u306e\u5834\u5408\u306f\u3001\u6210\u9577\u3092\u91cd\u8996\u3057\u305f\u5f53\u793e\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u7ba1\u7406\u3055\u308c\u305fKubernetes\u30b5\u30fc\u30d3\u30b9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u524d\u63d0\u6761\u4ef6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5f93\u3046\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3082\u306e\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/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>\u30b9\u30c6\u30c3\u30d71\uff1aHelm\u3092\u4f7f\u3063\u3066Metrics Server\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/h2>\n<p>\u307e\u305a\u3001\u30d8\u30eb\u30e0\u30d1\u30c3\u30b1\u30fc\u30b8\u30ea\u30b9\u30c8\u306b\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002 helm repo add \u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u6b21\u306b\u3001helm repo update\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5229\u7528\u53ef\u80fd\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u30d8\u30eb\u30e0\u306b\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u305f\u306e\u3067\u3001Kubernetes\u306e\u5c55\u958b\u306b\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u72ec\u81ea\u306e\u5c55\u958b\u8a2d\u5b9a\u3092\u66f8\u304f\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306fSilicon Cloud\u306eKubernetes\u30b9\u30bf\u30fc\u30bf\u30fc\u30ad\u30c3\u30c8\u306b\u5f93\u3044\u3001\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3092\u884c\u3046\u305f\u3081\u306b\u3001Kubernetes \u30b9\u30bf\u30fc\u30bf\u30fc\u30ad\u30c3\u30c8\u306e Git \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u300cmetrics-server\u300d\u306e\u69cb\u6210\u306f\u300cKubernetes-Starter-Kit-Developers\/09-scaling-application-workloads\/assets\/manifests\/metrics-server-values-v3.8.2.yaml\u300d\u306b\u3042\u308a\u307e\u3059\u3002nano\u3084\u304a\u597d\u304d\u306a\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066\u8868\u793a\u3084\u7de8\u96c6\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u3044\u304f\u3064\u304b\u306e\u5728\u5eab\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u30ec\u30d7\u30ea\u30ab\u306f\u56fa\u5b9a\u5024\u3067\u3042\u308a\u30012\u3067\u3059\u3002<\/p>\n<div>\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u306e\u5024v3.8.2\u306eyaml\u30d5\u30a1\u30a4\u30eb<\/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>\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u306e\u5229\u7528\u53ef\u80fd\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8aac\u660e\u306b\u3064\u3044\u3066\u306f\u3001\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u30c1\u30e3\u30fc\u30c8\u30da\u30fc\u30b8\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f: Kubernetes\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3092\u5b9f\u884c\u4e2d\u306eKubernetes\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u30de\u30c3\u30c1\u30f3\u30b0\u3059\u308b\u969b\u306b\u306f\u3001\u304b\u306a\u308a\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u307e\u305f\u3001Helm\u30c1\u30e3\u30fc\u30c8\u81ea\u4f53\u3082\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3055\u308c\u3066\u304a\u308a\u3001\u3053\u308c\u3082\u5f37\u5236\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u73fe\u5728\u306e\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u306emetrics-server\u306eHelm\u30c1\u30e3\u30fc\u30c8\u306f3.8.2\u3067\u3042\u308a\u3001\u305d\u308c\u81ea\u4f53\u306emetrics-server\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f0.6.1\u3092\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059\u3002Metrics Server\u306e\u4e92\u63db\u6027\u30de\u30c8\u30ea\u30c3\u30af\u30b9\u304b\u3089\u306f\u3001\u30d0\u30fc\u30b8\u30e7\u30f30.6.x\u304cKubernetes 1.19+\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3057\u3001\u5fc5\u8981\u306a\u5909\u66f4\u3092\u884c\u3063\u305f\u5f8c\u306f\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092helm install\u30b3\u30de\u30f3\u30c9\u3068\u4e00\u7dd2\u306b\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3067\u3001metrics-server\u306e\u30c7\u30d7\u30ed\u30a4\u3092\u9032\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u3053\u308c\u306b\u3088\u308a\u3001\u8a2d\u5b9a\u3055\u308c\u305fKubernetes\u30af\u30e9\u30b9\u30bf\u306b\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u304c\u5c55\u958b\u3055\u308c\u307e\u3059\u3002<\/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>\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u5f8c\u306b\u3001helm ls\u3092\u4f7f\u7528\u3057\u3066\u3001metrics-server\u304c\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u306b\u8ffd\u52a0\u3055\u308c\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/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>\u6b21\u306b\u3001metrics-server\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u306b\u5c55\u958b\u3055\u308c\u305f\u3059\u3079\u3066\u306eKubernetes\u30ea\u30bd\u30fc\u30b9\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u8a2d\u5b9a\u306b\u57fa\u3065\u3044\u3066\u30c7\u30d7\u30ed\u30a4\u3057\u305f\u5834\u5408\u3001deployment.apps\u304a\u3088\u3073replicaset.apps\u306e\u5024\u306f2\u3064\u306e\u5229\u7528\u53ef\u80fd\u306a\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30ab\u30a6\u30f3\u30c8\u3059\u308b\u306f\u305a\u3067\u3059\u3002<\/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>\u3042\u306a\u305f\u306f\u73fe\u5728\u3001Kubernetes\u30af\u30e9\u30b9\u30bf\u30fc\u306b\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u5c55\u958b\u3057\u307e\u3057\u305f\u3002\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001HorizontalPodAutoscaler\u30ab\u30b9\u30bf\u30e0\u30ea\u30bd\u30fc\u30b9\u5b9a\u7fa9\u306e\u3044\u304f\u3064\u304b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d72 &#8211; HPA\u306e\u7406\u89e3<\/h2>\n<p>\u3053\u308c\u307e\u3067\u3001\u3042\u306a\u305f\u306e\u8a2d\u5b9a\u3067\u306f\u3001\u5c55\u958b\u3059\u308bReplicaSet\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u6570\u306b\u56fa\u5b9a\u5024\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001HorizontalPodAutoscaler CRD\u3092\u5b9a\u7fa9\u3059\u308b\u65b9\u6cd5\u3092\u5b66\u3073\u3001\u3053\u306e\u5024\u3092\u52d5\u7684\u306b\u5897\u6e1b\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u5178\u578b\u7684\u306aHorizontalPodAutoscaler CRD\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<div>\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u306e.yaml<\/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>\u3053\u306e\u8a2d\u5b9a\u3067\u4f7f\u7528\u3055\u308c\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/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>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5c55\u958b\u306b\u306f\u30012\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059\u3002HPA\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u9078\u3076\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u65e2\u5b58\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u306b\u5bfe\u3057\u3066 kubectl autoscale \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>HPA\u306eYAML\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u5f8c\u3001kubectl\u3092\u4f7f\u7528\u3057\u3066\u30af\u30e9\u30b9\u30bf\u30fc\u3078\u306e\u5909\u66f4\u3092\u9069\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/ol>\n<p>\u6700\u521d\u306b\u30aa\u30d7\u30b7\u30e7\u30f31\u3092\u8a66\u3057\u307e\u3059\u3002Silicon Cloud Kubernetes Starter Kit\u304b\u3089\u5225\u306e\u8a2d\u5b9a\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002myapp-test.yaml\u3068\u3044\u3046\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u304c\u542b\u307e\u308c\u3066\u3044\u3066\u3001\u4efb\u610f\u306eCPU\u8ca0\u8377\u3092\u4f5c\u6210\u3057\u3066HPA\u3092\u5b9f\u6f14\u3057\u307e\u3059\u3002<\/p>\n<p>\u304a\u6c17\u306b\u5165\u308a\u306e\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u30fc\u3001\u307e\u305f\u306fnano\u3092\u4f7f\u3063\u3066\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u79c1\u306e\u30a2\u30d7\u30ea\u306e\u30c6\u30b9\u30c8\u7528\u306e.yaml\u30d5\u30a1\u30a4\u30eb<\/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>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u306e\u6570\u884c\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u308c\u3089\u306f\u30b7\u30a7\u30eb\u306e\u69cb\u6587\u3092\u542b\u3093\u3067\u304a\u308a\u3001\u8ca0\u8377\u3092\u30b7\u30df\u30e5\u30ec\u30fc\u30c8\u3059\u308b\u305f\u3081\u306b1\u79d2\u306b100\u56de\u300c\u30c6\u30b9\u30c8\u300d\u3068\u3044\u3046\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u7e70\u308a\u8fd4\u3057\u8868\u793a\u3059\u308b\u3082\u306e\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u30ec\u30d3\u30e5\u30fc\u304c\u7d42\u4e86\u3057\u305f\u3089\u3001kubectl\u3092\u4f7f\u7528\u3057\u3066\u30af\u30e9\u30b9\u30bf\u306b\u5c55\u958b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u6b21\u306b\u3001 kubectl autoscale \u3092\u4f7f\u7528\u3057\u3066\u3001myapp-test \u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3092\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u3057\u305f HorizontalPodAutoscaler \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/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>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306b\u6e21\u3055\u308c\u308b\u5f15\u6570\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u306f\u3001CPU\u5229\u7528\u7387\u304c50\u30d1\u30fc\u30bb\u30f3\u30c8\u306b\u9054\u3059\u308b\u3068\u3001\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u304c1\u304b\u30893\u306e\u30ec\u30d7\u30ea\u30ab\u306b\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3055\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<p>\u300ckubectl get hpa\u300d\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001HPA\u30ea\u30bd\u30fc\u30b9\u304c\u4f5c\u6210\u3055\u308c\u305f\u304b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/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>\u51fa\u529b\u306eTARGETS\u5217\u306f\u3001\u6700\u7d42\u7684\u306b\u73fe\u5728\u306e\u4f7f\u7528\u7387\uff05\/\u76ee\u6a19\u306e\u4f7f\u7528\u7387\uff05\u306e\u6570\u5024\u3092\u793a\u3057\u307e\u3059\u3002<\/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>\u6ce8\u610f\uff1aTARGETS\u5217\u306e\u5024\u306f\u3001\u3057\u3070\u3089\u304f\uff08\u7d0415\u79d2\uff09\/50%\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u6b63\u5e38\u3067\u3059\u3002\u306a\u305c\u306a\u3089\u3001HPA\u306f\u6642\u9593\u306e\u7d4c\u904e\u306b\u4f34\u3046\u5e73\u5747\u5024\u3092\u53ce\u96c6\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u6700\u521d\u306e15\u79d2\u9593\u306b\u306f\u5341\u5206\u306a\u30c7\u30fc\u30bf\u304c\u306a\u3044\u304b\u3089\u3067\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001HPA\u306f15\u79d2\u3054\u3068\u306b\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002<\/div>\n<\/div>\n<p>HPA\u304c\u751f\u6210\u3059\u308b\u30ed\u30b0\u30a4\u30d9\u30f3\u30c8\u306f\u3001kubectl describe\u3092\u4f7f\u7528\u3057\u3066\u89b3\u5bdf\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/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>\u3053\u308c\u306fkubectl autoscale\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u672c\u756a\u74b0\u5883\u3067\u306f\u3001\u901a\u5e38\u306f\u5c02\u7528\u306eYAML\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3001\u5404HPA\u3092\u5b9a\u7fa9\u3059\u308b\u3079\u304d\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u3092Git\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30b3\u30df\u30c3\u30c8\u3057\u3066\u5909\u66f4\u3092\u8ffd\u8de1\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4fee\u6b63\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u3001\u5b9f\u4f8b\u3092\u9032\u3081\u307e\u3059\u3002\u6b21\u306b\u9032\u3080\u524d\u306b\u3001myapp-test\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3068\u95a2\u9023\u3059\u308bHPA\u30ea\u30bd\u30fc\u30b9\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u30b9\u30c6\u30c3\u30d73 &#8211; \u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u81ea\u52d5\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0<\/h2>\n<p>\u3053\u306e\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u3067\u306f\u3001YAML\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3092\u751f\u6210\u3057\u3001\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u3059\u308b2\u3064\u306e\u7570\u306a\u308b\u65b9\u6cd5\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>CPU\u5bc6\u96c6\u578b\u306e\u6f14\u7b97\u3092\u884c\u3046\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u4e00\u5b9a\u306e\u8ca0\u8377\u3092\u751f\u6210\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5c55\u958b\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u305f\u3081\u306b\u9ad8\u901f\u306a\u9023\u7d9a\u3057\u305fHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u5916\u90e8\u8ca0\u8377\u3092\u30b7\u30df\u30e5\u30ec\u30fc\u30b7\u30e7\u30f3\u3057\u307e\u3059\u3002<\/ol>\n<h3>\u5b9a\u5e38\u8ca0\u8377\u8a66\u9a13 (Teij\u014d fuka shiken)<\/h3>\n<p>\u3053\u306e\u30b7\u30ca\u30ea\u30aa\u3067\u306f\u3001Python\u3092\u4f7f\u7528\u3057\u3066\u5b9f\u88c5\u3055\u308c\u305f\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u3001\u3044\u304f\u3064\u304b\u306eCPU\u96c6\u4e2d\u578b\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002\u524d\u306e\u30b9\u30c6\u30c3\u30d7\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u540c\u69d8\u306b\u3001\u3053\u306ePython\u30b3\u30fc\u30c9\u306f\u30b9\u30bf\u30fc\u30bf\u30fc\u30ad\u30c3\u30c8\u306e\u4f8b\u306e\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306e1\u3064\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002nano\u307e\u305f\u306f\u304a\u6c17\u306b\u5165\u308a\u306e\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066constant-load-deployment-test.yaml\u3092\u958b\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u5b9a\u671f\u7684\u306a\u8ca0\u8377\u5c55\u958b\u30c6\u30b9\u30c8\u306e\u305f\u3081\u306econstant-load-deployment-test.yaml<\/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>\u4e0a\u8a18\u306ePython\u30b3\u30fc\u30c9\u306f\u3001\u7e70\u308a\u8fd4\u3057\u4efb\u610f\u306e\u5e73\u65b9\u6839\u3092\u751f\u6210\u3057\u307e\u3059\u3002\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3067\u306f\u3001\u5fc5\u8981\u306aPython\u30e9\u30f3\u30bf\u30a4\u30e0\u3092\u30db\u30b9\u30c8\u3059\u308bDocker\u30a4\u30e1\u30fc\u30b8\u3092\u53d6\u5f97\u3057\u3001\u305d\u308c\u304b\u3089\u4ee5\u524d\u306b\u793a\u3057\u305f\u30b5\u30f3\u30d7\u30ebPython\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30db\u30b9\u30c8\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30dd\u30c3\u30c9\u306bConfigMap\u3092\u30a2\u30bf\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u3053\u306e\u5c55\u958b\u306e\u305f\u3081\u306b\u5225\u306e\u540d\u524d\u7a7a\u9593\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\uff08\u89b3\u5bdf\u306e\u305f\u3081\uff09\u3001\u305d\u308c\u304b\u3089kubectl\u3092\u4f7f\u7528\u3057\u3066\u5c55\u958b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u6ce8\u610f\uff1a\u30b5\u30f3\u30d7\u30eb\u306e\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3067\u306f\u3001\u30b5\u30f3\u30d7\u30eb\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30dd\u30c3\u30c9\u306b\u5bfe\u3057\u3066\u30ea\u30bd\u30fc\u30b9\u8981\u6c42\u5236\u9650\u3082\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002HPA\u306e\u30ed\u30b8\u30c3\u30af\u306b\u306f\u3001\u30dd\u30c3\u30c9\u306b\u30ea\u30bd\u30fc\u30b9\u8981\u6c42\u5236\u9650\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u4e00\u822c\u7684\u306b\u306f\u3001\u4e88\u6e2c\u4e0d\u80fd\u306a\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3001\u3059\u3079\u3066\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30dd\u30c3\u30c9\u306b\u30ea\u30bd\u30fc\u30b9\u8981\u6c42\u5236\u9650\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/div>\n<\/div>\n<p>\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u304c\u6b63\u5e38\u306b\u4f5c\u6210\u3055\u308c\u3001\u7a3c\u50cd\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u6b21\u306b\u3001\u3053\u306e\u30af\u30e9\u30b9\u30bf\u306b\u5225\u306eHPA\u3092\u5c55\u958b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002constant-load-hpa-test.yaml\u306b\u306f\u3001\u3053\u306e\u30b7\u30ca\u30ea\u30aa\u306b\u5408\u81f4\u3059\u308b\u4f8b\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306fnano\u3084\u304a\u6c17\u306b\u5165\u308a\u306e\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3067\u958b\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/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>\u5b9a\u5e38\u8ca0\u8377HPA\u30c6\u30b9\u30c8.yaml<\/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>kubectl\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30d7\u30ed\u30a4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u3053\u308c\u306b\u3088\u308a\u3001\u30b5\u30f3\u30d7\u30eb\u306ePython\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u3092\u30bf\u30fc\u30b2\u30c3\u30c8\u306b\u3057\u305fHPA\u30ea\u30bd\u30fc\u30b9\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002kubectl get hpa\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066constant-load-test HPA\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/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>\u5b9a\u5e38\u8ca0\u8377\u30c7\u30d7\u30ed\u30a4\u30c6\u30b9\u30c8\u3092\u5bfe\u8c61\u3068\u3059\u308b\u300cREFERENCE\u300d\u5217\u3001\u304a\u3088\u3073\u6700\u5f8c\u306e\u4f8b\u3068\u540c\u69d8\u306e\u73fe\u5728\u306eCPU\u30ea\u30bd\u30fc\u30b9\u8981\u6c42\u3068\u95be\u5024\u5024\u3092\u793a\u3059\u300cTARGETS\u300d\u5217\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5c55\u958b\u306b\u304a\u3044\u3066\u3001REPLICAS\u5217\u306e\u5024\u304cHPA CRD\u4ed5\u69d8\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u901a\u308a\u306b1\u304b\u30893\u306b\u5897\u52a0\u3057\u305f\u3053\u3068\u306b\u3082\u6c17\u3065\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u975e\u5e38\u306b\u8fc5\u901f\u306bCPU\u8ca0\u8377\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u3001\u3053\u308c\u304c\u975e\u5e38\u306b\u901f\u304f\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u524d\u306e\u4f8b\u3068\u540c\u69d8\u306b\u3001kubectl describe hpa -n hpa-constant-load\u3092\u4f7f\u7528\u3057\u3066\u8a18\u9332\u3055\u308c\u305fHPA\u30a4\u30d9\u30f3\u30c8\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u5916\u90e8\u8ca0\u8377\u30c6\u30b9\u30c8<\/h3>\n<p>\u3088\u308a\u8208\u5473\u6df1\u304f\u73fe\u5b9f\u7684\u306a\u30b7\u30ca\u30ea\u30aa\u306f\u3001\u5916\u90e8\u8ca0\u8377\u304c\u751f\u6210\u3055\u308c\u308b\u5834\u6240\u3092\u89b3\u5bdf\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u3053\u306e\u6700\u5f8c\u306e\u4f8b\u3067\u306f\u3001\u524d\u306e\u30c6\u30b9\u30c8\u304b\u3089\u306e\u30c7\u30fc\u30bf\u3092\u518d\u5229\u7528\u3057\u306a\u3044\u305f\u3081\u306b\u3001\u7570\u306a\u308b\u540d\u524d\u7a7a\u9593\u3068\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306e\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u73fe\u5728\u306e\u5f15\u7528\u30b5\u30f3\u30d7\u30eb\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u30b5\u30fc\u30d0\u30fc\u306bHTTP\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u9001\u4fe1\u3055\u308c\u308b\u305f\u3073\u306b\u3001\u7570\u306a\u308b\u5f15\u7528\u304c\u5fdc\u7b54\u3068\u3057\u3066\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u30921\u30df\u30ea\u79d2\u3054\u3068\u306b\u9001\u4fe1\u3059\u308b\u3053\u3068\u3067\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u306b\u8ca0\u8377\u3092\u304b\u3051\u307e\u3059\u3002\u3053\u306e\u5c55\u958b\u306f\u3001quote_deployment.yaml\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002nano\u307e\u305f\u306f\u304a\u597d\u304d\u306a\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u4ee5\u4e0b\u306e\u3082\u306e\u3092\u65e5\u672c\u8a9e\u3067\u81ea\u7136\u306a\u5f62\u306b\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\uff1a\u300cquote_deployment.yaml\u300d<\/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>\u3053\u306e\u5834\u5408\u3001\u5b9f\u969b\u306eHTTP\u30af\u30a8\u30ea\u30fc\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u3053\u306e\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306f\u3001\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30a2\u30d7\u30ea\u3092\u6e96\u5099\u3059\u308b\u3060\u3051\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u306e\u30ec\u30d3\u30e5\u30fc\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001kubectl\u3092\u4f7f\u7528\u3057\u3066\u5f15\u7528\u540d\u524d\u7a7a\u9593\u3068\u5c55\u958b\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u5f15\u7528\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5c55\u958b\u3068\u30b5\u30fc\u30d3\u30b9\u304c\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u6b21\u306b\u3001\u898b\u7a4d\u3082\u308a\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u306eHPA\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001quote-deployment-hpa-test.yaml\u3067\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002nano\u307e\u305f\u306f\u304a\u6c17\u306b\u5165\u308a\u306e\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u5f15\u7528-\u5c55\u958b-HPA\u30c6\u30b9\u30c8.yaml<\/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>\u3053\u306e\u5834\u5408\u3001CPU\u5229\u7528\u7387\u306e\u30ea\u30bd\u30fc\u30b9\u30e1\u30c8\u30ea\u30c3\u30af\uff0820%\uff09\u306b\u306f\u7570\u306a\u308b\u95be\u5024\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u306e\u6319\u52d5\u3082\u7570\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u306b\u3088\u308a\u3001scaleDown.stabilizationWindowSeconds\u306e\u52d5\u4f5c\u304c\u5909\u66f4\u3055\u308c\u3001\u5024\u304c60\u79d2\u306b\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u5fc5\u305a\u3057\u3082\u5e38\u306b\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u5834\u5408\u306f\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30e9\u30fc\u304c\u30b9\u30b1\u30fc\u30eb\u30c0\u30a6\u30f3\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u884c\u3046\u69d8\u5b50\u3092\u3088\u308a\u65e9\u304f\u898b\u305f\u3044\u5834\u5408\u306b\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001HorizontalPodAutoscaler\u306b\u306f5\u5206\u306e\u30af\u30fc\u30eb\u30c0\u30a6\u30f3\u671f\u9593\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u307b\u3068\u3093\u3069\u306e\u5834\u5408\u306b\u5341\u5206\u3067\u3042\u308a\u3001\u30ec\u30d7\u30ea\u30ab\u306e\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\u6642\u306e\u5909\u52d5\u3092\u56de\u907f\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p>\u6e96\u5099\u304c\u3067\u304d\u305f\u3089\u3001kubectl\u3092\u4f7f\u3063\u3066\u305d\u308c\u3092\u5c55\u958b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u73fe\u5728\u3001HPA\u30ea\u30bd\u30fc\u30b9\u304c\u6b63\u3057\u304f\u8a2d\u5b9a\u3055\u308c\u3066\u304a\u308a\u7a3c\u50cd\u3057\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u6700\u5f8c\u306b\u3001shell\u30b9\u30af\u30ea\u30d7\u30c8quote_service_load_test.sh\u3092\u4f7f\u7528\u3057\u3066\u5b9f\u969b\u306eHTTP\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\u3053\u306eshell\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5148\u306b\u30de\u30cb\u30d5\u30a7\u30b9\u30c8\u306b\u57cb\u3081\u8fbc\u307e\u306a\u304b\u3063\u305f\u7406\u7531\u306f\u3001\u30af\u30e9\u30b9\u30bf\u3067\u5b9f\u884c\u3057\u306a\u304c\u3089\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u76f4\u63a5\u30ed\u30b0\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u3067\u3059\u3002nano\u3084\u304a\u6c17\u306b\u5165\u308a\u306e\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u5f15\u7528\u30b5\u30fc\u30d3\u30b9\u306e\u8ca0\u8377\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u300cquote_service_load_test.sh\u300d\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/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>\u3053\u306e\u30c7\u30e2\u30f3\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u305f\u3081\u306b\u3001\u5225\u3005\u306e2\u3064\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u6700\u521d\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u3067quote_service_load_test.sh\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u6b21\u306b\u30012\u756a\u76ee\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u3067\u3001HPA\u30ea\u30bd\u30fc\u30b9\u306b-w\u30d5\u30e9\u30b0\u3092\u4f7f\u7528\u3057\u3066kubectl watch\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/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>\u8ca0\u8377\u304c\u5897\u3048\u3066\u3044\u304f\u306e\u304c\u8868\u793a\u3055\u308c\u3066\u3001\u81ea\u52d5\u7684\u306b\u30b9\u30b1\u30fc\u30eb\u304c\u8abf\u6574\u3055\u308c\u308b\u306e\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/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>\u8ca0\u8377\u304c\u5897\u52a0\u3059\u308b\u3068\u3001\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30e9\u30fc\u304c\u4f5c\u52d5\u3057\u3001\u30af\u30a9\u30fc\u30c8\u30b5\u30fc\u30d0\u30fc\u30c7\u30d7\u30ed\u30a4\u30e1\u30f3\u30c8\u306e\u30ec\u30d7\u30ea\u30ab\u30bb\u30c3\u30c8\u3092\u3088\u308a\u9ad8\u3044\u5024\u306b\u5897\u3084\u3057\u307e\u3059\u3002\u8ca0\u8377\u751f\u6210\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u505c\u6b62\u3059\u308b\u3068\u3001\u30af\u30fc\u30eb\u30c0\u30a6\u30f3\u671f\u9593\u304c\u8a2d\u3051\u3089\u308c\u30011\u5206\u307b\u3069\u7d4c\u3063\u305f\u5f8c\u306b\u30ec\u30d7\u30ea\u30ab\u30bb\u30c3\u30c8\u306f\u521d\u671f\u5024\u306e1\u306b\u623b\u308a\u307e\u3059\u3002\u6700\u521d\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u623b\u3063\u3066\u304b\u3089\u3001\u5b9f\u884c\u4e2d\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7d42\u4e86\u3059\u308b\u305f\u3081\u306bCtrl+C\u3092\u62bc\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u7570\u306a\u308b\u30b7\u30ca\u30ea\u30aa\u3067Kubernetes\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u6c34\u5e73\u30dd\u30c3\u30c9\u30aa\u30fc\u30c8\u30b9\u30b1\u30fc\u30ea\u30f3\u30b0\uff08HPA\uff09\u306e\u52d5\u4f5c\u3092\u5c55\u958b\u3057\u3001\u89b3\u5bdf\u3057\u307e\u3057\u305f\u3002HPA\u306f\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u304c\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u3088\u308a\u591a\u304f\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306b\u3001Kubernetes\u306e\u91cd\u8981\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u6587\u7ae0\u3092\u65e5\u672c\u8a9e\u306b\u81ea\u7136\u306b\u8a00\u3044\u63db\u3048\u307e\u3059\uff08\u9078\u629e\u80a2\u306f1\u3064\u3060\u3051\u3067\u3059\uff09\uff1a<br \/>\n\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u306b\u306f\u91cd\u5927\u306a\u5236\u9650\u304c\u3042\u308a\u3001CPU\u3084\u30e1\u30e2\u30ea\u4f7f\u7528\u72b6\u6cc1\u3092\u8d85\u3048\u305f\u30e1\u30c8\u30ea\u30af\u30b9\u306f\u63d0\u4f9b\u3067\u304d\u307e\u305b\u3093\u3002\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u8a73\u3057\u304f\u78ba\u8a8d\u3059\u308c\u3070\u3001\u4f7f\u7528\u30b1\u30fc\u30b9\u5185\u3067\u306e\u64cd\u4f5c\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3082\u3057\u30c7\u30a3\u30b9\u30af\u4f7f\u7528\u72b6\u6cc1\u3084\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8ca0\u8377\u306a\u3069\u4ed6\u306e\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u4f7f\u7528\u3057\u3066\u30b9\u30b1\u30fc\u30eb\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306f\u3001\u7279\u5225\u306a\u30a2\u30c0\u30d7\u30bf\u30fc\u3067\u3042\u308b\u30d7\u30ed\u30e1\u30c6\u30a6\u30b9\u30a2\u30c0\u30d7\u30bf\u30fc\u3092\u4ecb\u3057\u3066\u30d7\u30ed\u30e1\u30c6\u30a6\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b Kubernetes\u306f\u3001\u8010\u969c\u5bb3\u6027\u3068\u62e1\u5f35\u6027\u306e\u4e21\u65b9\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3092\u76ee\u6307\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u306f\u3001\u7570\u306a\u308b\u30ea\u30bd\u30fc\u30b9\u5272\u308a\u5f53\u3066\u3092\u6301\u3064\u8907\u6570\u306e\u30dd\u30c3\u30c9\u3092\u5c55\u958b\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5197\u9577\u6027\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u81ea\u5206\u81ea\u8eab\u306e\u5c55\u958b\u3092 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,18],"class_list":["post-294","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-18"],"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>\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\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\/ja\/blog\/\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001kubernetes\u306ehorizontal-pod-autoscaler\u306e\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\" \/>\n<meta property=\"og:description\" content=\"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001kubernetes\u306ehorizontal-pod-autoscaler\u306e\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-04T07:46:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T13:24:47+00:00\" \/>\n<meta name=\"author\" content=\"\u967d, \u5411\u5b87\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u967d, \u5411\u5b87\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"45\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/\",\"name\":\"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2022-11-04T07:46:01+00:00\",\"dateModified\":\"2025-07-31T13:24:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4aef6196128551a0f5d66db46c42866c\"},\"description\":\"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4aef6196128551a0f5d66db46c42866c\",\"name\":\"\u967d, \u5411\u5b87\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ad96b120e219751fa368cbd7d2c48ca01b59185e6ed394449bac72614a760bf3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ad96b120e219751fa368cbd7d2c48ca01b59185e6ed394449bac72614a760bf3?s=96&d=mm&r=g\",\"caption\":\"\u967d, \u5411\u5b87\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/hinatasora\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d - Blog - Silicon Cloud","description":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","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\/ja\/blog\/\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001kubernetes\u306ehorizontal-pod-autoscaler\u306e\/","og_locale":"ja_JP","og_type":"article","og_title":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d","og_description":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001kubernetes\u306ehorizontal-pod-autoscaler\u306e\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-11-04T07:46:01+00:00","article_modified_time":"2025-07-31T13:24:47+00:00","author":"\u967d, \u5411\u5b87","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u967d, \u5411\u5b87","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"45\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/","name":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2022-11-04T07:46:01+00:00","dateModified":"2025-07-31T13:24:47+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4aef6196128551a0f5d66db46c42866c"},"description":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"\u300c\u30e1\u30c8\u30ea\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001Kubernetes\u306eHorizontal Pod Autoscaler\u306e\u8a2d\u5b9a\u65b9\u6cd5\u300d"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/4aef6196128551a0f5d66db46c42866c","name":"\u967d, \u5411\u5b87","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ad96b120e219751fa368cbd7d2c48ca01b59185e6ed394449bac72614a760bf3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ad96b120e219751fa368cbd7d2c48ca01b59185e6ed394449bac72614a760bf3?s=96&d=mm&r=g","caption":"\u967d, \u5411\u5b87"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/hinatasora\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%80%8c%e3%83%a1%e3%83%88%e3%83%aa%e3%82%af%e3%82%b9%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%80%81kubernetes%e3%81%aehorizontal-pod-autoscaler%e3%81%ae\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":38770,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/294\/revisions\/38770"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}