在 Google 云上在哪里配置 Kubernetes Cluster Autoscaler?
Where to config the Kubernetes Cluster Autoscaler on Google Cloud?
我在 Google Kubernetes Engine
上创建集群并启用 Cluster Autoscaler
选项。
我想根据 https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md .
配置缩放行为,例如 --scale-down-delay-after-delete
但是我在集群自动缩放器 kube-system 上没有发现 Pod 或 Deployment。
有人有想法吗?
编辑:
我不是说Horizontal Pod Autoscaler
。
我希望我可以这样配置它:
$ gcloud container clusters update cluster-1 --enable-autoscaling --scan-interval=5 --scale-down-unneeded-time=3m
ERROR: (gcloud.container.clusters.update) unrecognized arguments:
--scan-interval=5
--scale-down-unneeded-time=3m
如果我正确理解你需要这个:
通过以下方式检查您的部署名称:
kubectl get deployments
并按以下方式自动缩放:
kubectl autoscale deployment your_deployment_name --cpu-percent=100 --min=1 --max=10
根据https://github.com/kubernetes/autoscaler/issues/966
是不可能的
可能是因为无法访问 GKE 上的可执行文件(似乎是)。
您甚至无法在 GKE 上查看自动缩放器的日志:https://github.com/kubernetes/autoscaler/issues/972
一种方法是不启用 GKE 自动缩放器,然后在工作节点上手动安装它 - 根据项目的文档:
Users can put it into kube-system namespace (Cluster Autoscaler doesn't scale down node with non-mirrored kube-system pods running on them) and set a priorityClassName: system-cluster-critical property on your pod spec (to prevent your pod from being evicted).
https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#deployment
我还认为您可以使用以下内容对自动缩放器 pod 进行注释:
"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"
我在 Google Kubernetes Engine
上创建集群并启用 Cluster Autoscaler
选项。
我想根据 https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md .
--scale-down-delay-after-delete
但是我在集群自动缩放器 kube-system 上没有发现 Pod 或 Deployment。
有人有想法吗?
编辑:
我不是说Horizontal Pod Autoscaler
。
我希望我可以这样配置它:
$ gcloud container clusters update cluster-1 --enable-autoscaling --scan-interval=5 --scale-down-unneeded-time=3m
ERROR: (gcloud.container.clusters.update) unrecognized arguments:
--scan-interval=5
--scale-down-unneeded-time=3m
如果我正确理解你需要这个:
通过以下方式检查您的部署名称:
kubectl get deployments
并按以下方式自动缩放:
kubectl autoscale deployment your_deployment_name --cpu-percent=100 --min=1 --max=10
根据https://github.com/kubernetes/autoscaler/issues/966
是不可能的可能是因为无法访问 GKE 上的可执行文件(似乎是)。
您甚至无法在 GKE 上查看自动缩放器的日志:https://github.com/kubernetes/autoscaler/issues/972
一种方法是不启用 GKE 自动缩放器,然后在工作节点上手动安装它 - 根据项目的文档:
Users can put it into kube-system namespace (Cluster Autoscaler doesn't scale down node with non-mirrored kube-system pods running on them) and set a priorityClassName: system-cluster-critical property on your pod spec (to prevent your pod from being evicted).
https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler#deployment
我还认为您可以使用以下内容对自动缩放器 pod 进行注释:
"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"