【问题标题】:Can't install autoscaler on AWS now?现在无法在 AWS 上安装自动扩缩器?
【发布时间】:2018-07-04 11:11:10
【问题描述】:

在 AWS 上安装 autoscaler 时:

https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/aws

出现错误:

cluster-autoscaler-5f69cdcd84-4kpqw  0/1  RunContainerError   0   3s

查看详情:

$ kubectl describe po cluster-autoscaler-5b454d874c-4f85w -n kube-system
...
Last State:  Terminated
      Reason:    ContainerCannotRun
      Message:   oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\\"/etc/ssl/certs/ca-certificates.crt\\\" to rootfs \\\"/var/lib/docker/overlay/f45f8b9b739167c3b6bb5
275c7ca6285508b52ecf940b3759e3ca99b87fadd53/merged\\\" at \\\"/var/lib/docker/overlay/f45f8b9b739167c3b6bb5275c7ca6285508b52ecf940b3759e3ca99b87fadd53/merged/etc/ssl/certs/ca-certificates.crt\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
...
Events:
  Type     Reason                 Age   From                                                      Message
  ----     ------                 ----  ----                                                      -------
  Normal   Scheduled              55s   default-scheduler                                         Successfully assigned cluster-autoscaler-5b454d874c-4f85w to ip-100.200.0.1.ap-northeast-1.compute.internal
  Normal   SuccessfulMountVolume  55s   kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  MountVolume.SetUp succeeded for volume "ssl-certs"
  Normal   SuccessfulMountVolume  55s   kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  MountVolume.SetUp succeeded for volume "default-token-2wmct"
  Warning  Failed                 53s   kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  Error: failed to start container "cluster-autoscaler": Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux
.go:359: container init caused \"rootfs_linux.go:54: mounting \\\"/etc/ssl/certs/ca-certificates.crt\\\" to rootfs \\\"/var/lib/docker/overlay/3796432b43abb86f70886e31d3bc555bd6beb54a2854d1e09ee6cdc74cab3af3/merged\\\" at \\\"/var/lib/docker/overlay/3796432b43abb86f70886e
31d3bc555bd6beb54a2854d1e09ee6cdc74cab3af3/merged/etc/ssl/certs/ca-certificates.crt\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
  Warning  Failed  51s  kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  Error: failed to start container "cluster-autoscaler": Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: contain
er init caused \"rootfs_linux.go:54: mounting \\\"/etc/ssl/certs/ca-certificates.crt\\\" to rootfs \\\"/var/lib/docker/overlay/2c1fac03d81e1e77df060a70035adf2442840705198e5c887825bc3b1eb80f8f/merged\\\" at \\\"/var/lib/docker/overlay/2c1fac03d81e1e77df060a70035adf24428407
05198e5c887825bc3b1eb80f8f/merged/etc/ssl/certs/ca-certificates.crt\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
  Warning  Failed  33s  kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  Error: failed to start container "cluster-autoscaler": Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: contain
er init caused \"rootfs_linux.go:54: mounting \\\"/etc/ssl/certs/ca-certificates.crt\\\" to rootfs \\\"/var/lib/docker/overlay/f45f8b9b739167c3b6bb5275c7ca6285508b52ecf940b3759e3ca99b87fadd53/merged\\\" at \\\"/var/lib/docker/overlay/f45f8b9b739167c3b6bb5275c7ca6285508b52
ecf940b3759e3ca99b87fadd53/merged/etc/ssl/certs/ca-certificates.crt\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
  Warning  BackOff     22s (x2 over 47s)  kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  Back-off restarting failed container
  Normal   Pulling     8s (x4 over 55s)   kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  pulling image "k8s.gcr.io/cluster-autoscaler:v0.6.0"
  Normal   Created     7s (x4 over 53s)   kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  Created container
  Warning  FailedSync  7s (x6 over 53s)   kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  Error syncing pod
  Normal   Pulled      7s (x4 over 53s)   kubelet, ip-100.200.0.1.ap-northeast-1.compute.internal  Successfully pulled image "k8s.gcr.io/cluster-autoscaler:v0.6.0"

是图片k8s.gcr.io/cluster-autoscaler:v0.6.0的问题吗?

【问题讨论】:

    标签: image amazon-web-services kubernetes containers autoscaling


    【解决方案1】:

    在 AWS EKS(Elastic Kubernetes Service)上,cluster-autoscaler 所需的 sslCertPath 似乎确实是/etc/ssl/certs/ca-bundle.crt

    例子:

    helm install stable/cluster-autoscaler 
      --set "autoscalingGroups[0].name=myasgname-worker-nodes-3-NodeGroup-HHTVNI2VF9DF,autoscalingGroups[0].maxSize=10,autoscalingGroups[0].minSize=2" 
      --name cluster-autoscaler
      --namespace kube-system 
      --set rbac.create=true 
      --set sslCertPath=/etc/ssl/certs/ca-bundle.crt
    

    【讨论】:

      【解决方案2】:

      问题似乎与 CA 证书挂载有关。上面写着Check if the specified host path exists and is the expected type

      cluster-autoscaler 镜像不附带任何 CA 证书,因此您必须将它们从主机挂载到容器中。也许您使用的操作系统将这些证书放在不同的位置?检查您的主机上是否存在 /etc/ssl/certs/ca-certificates.crt,如果不存在,请找出您主机上 CA 证书的正确路径,并相应地更新部署的 volume: 配置。

      【讨论】:

      • 非常感谢。可能是这个原因!我在主机上检查了/etc/ssl/certs/ 路径下的crt 文件。没有找到ca-certificates.crt,但有ca-bundle.crtca-bundle.trust.crt。我使用ca-bundle.crt 设置为清单文件并再次运行。它也失败了。这一次,错误是:Warning FailedSync 3m (x4411 over 16h) kubelet, ip-11.22.33.44.ap-northeast-1.compute.internal Error syncing pod(我更改了IP名称)。
      • 是的,ca-bundle.crt 听起来不错。如果没有更多信息,很难说这个新错误是什么。如果您不确定,请发布另一个包含更多详细信息的问题,或者跳到 Kubernetes slack 并在那里提出问题(那里有很多乐于助人的人)。
      • 稍等片刻。豆荚成功!我不确定为什么会出现FailedSync 错误。而且,当我尝试在 k8s 集群中安装 alertmanager 时,它遇到了相同的 FailedSync 问题。但其他prometheus 相关的豆荚进展顺利。
      【解决方案3】:

      您在 AWS 上运行的是什么版本的 Kubernetes?请参考compatibility matrix。如果您正在运行 Kubernetes 1.8+,您还可能会发现 my pull request 对 Kops 很有帮助

      【讨论】:

      • 我使用的是 1.8.4。
      猜你喜欢
      • 2018-05-22
      • 1970-01-01
      • 2018-11-14
      • 1970-01-01
      • 2016-10-20
      • 1970-01-01
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多