问题标签 [kubelet]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
368 浏览

docker - Google Cloud 实例上的独立 kubelet 永久磁盘挂载

我有一个需要每天在 Docker 容器中运行的进程,将一些数据从存储桶同步到外部卷(谷歌云永久磁盘)。到目前为止,我设法通过创建一个单节点容器集群来启动该过程。

由于该过程在几个小时内完成,因此我想在完成后删除 VM 资源(当然永久磁盘除外)。启动/删除单个计算 VM(没有 kubernetes 集群设置)似乎更简单,所以我试图让单个 kubelet在容器优化的云实例上运行。永久磁盘安装是失败的地方。

我的启动命令:

内容container.yaml

内容cloudinit.yaml

虽然该选项根据此问题--cloud-provider=gce修复了“无法获取 GCE 云提供商”错误,但安装磁盘仍然存在一些问题。

容器操作系统日志中可能相关的一行说:

EXT4-fs (dm-0):由于功能不兼容,无法安装为 ext3

有什么方法可以在单个计算实例上工作(没有 kubernetes 集群)?我还应该在哪里寻找更多信息的错误日志?

0 投票
1 回答
1669 浏览

kubernetes - 图像垃圾收集失败:无法找到容器的数据 /

我知道有人问过这个问题(这里),但这对我没有帮助。我将详细描述我的问题。

我在操作系统上安装了我的 kubernetes 集群CentOS 7 vm,etcd 和 kubernetes 版本是:

当我启动 kubelet 时,出现以下错误:

E0620 09:57:38.178381 30625 kubelet.go:1165] 图像垃圾收集失败:无法找到容器的数据/E0620 09:57:38.203274 30625 factory.go:305] 不会报告 devicemapper 文件系统统计信息:thin_ls 的使用情况是禁用以保留 iops

在 kube-master vm 上,我检查节点状态并得到以下结果:

但是当详细检查节点时,我收到了警告:

我已经用谷歌搜索了这个问题,但无法弄清楚。我该如何解决?

0 投票
0 回答
372 浏览

kubernetes - 如何在 Kubernetes 1.6 中为 cAdvisor 启用 has_custom_metrics 为 true

谁能告诉我如何在 Kubernetes 1.6 中将 cAdvisor 的标志 has_custom_metrics 设置为 true?Kubelet 显示 --enable-custom-metrics=true 但通过网络浏览器访问 cAdvisor 时,我看不到它。卷 /etc/custom-metrics 已使用文件 definition.json 正确安装。

在此处输入图像描述

0 投票
1 回答
5427 浏览

kubernetes - 如何将 kubelet 作为 docker 容器运行

我可以将 kubelet 作为基于 kubernetes v1.6.6 的 docker 容器运行吗?如果可以,如何创建图像或从哪里获取图像,以及如何运行该图像?

以下是我的操作,但有一些问题。

Dockerfile FROM i71:5000/ubuntu:14.04 ADD iptables /usr/local/bin/iptables ADD bin/kubelet /usr/local/bin/kubelet

码头工人运行 sh #!/bin/bash docker rm -f $(docker ps -aq --filter "name=kubelet") docker run \ -d \ --restart="always" \ --net="host" \ -v /data/kubernetes-cluster/ssl:/data/kubernetes-cluster/ssl \ -v /data/kubernetes-cluster/kube-conf:/data/kubernetes-cluster/kube-conf \ -v /data/kubernetes-cluster/log:/data/kubernetes-cluster/log \ -v /data/kubelet:/var/lib/kubelet \ -v /etc/localtime:/etc/localtime \ -v /var/run/:/var/run/ \ -v /var/log/:/var/log/ \ --privileged=true \ --name kubelet \ i71:5000/kubelet:v1.6.6 \ /usr/local/bin/kubelet \ --logtostderr=true \ --v=0 \ --cgroup-driver=cgroupfs \ --api-servers=http://192.168.0.97:8080 \ --docker-endpoint=http://127.0.0.1:4243 \ --address=192.168.0.97 \ --hostname-override=192.168.0.97 \ --allow-privileged=true \ --pod-infra-container-image=i71:5000/pod-infrastructure:rhel7 \ --cluster-dns=10.3.0.2 \ --experimental-bootstrap-kubeconfig=/data/kubernetes-cluster/kube-conf/bootstrap.kubeconfig \ --kubeconfig=/data/kubernetes-cluster/kube-conf/kubelet.kubeconfig \ --require-kubeconfig \ --cert-dir=/data/kubernetes-cluster/ssl \ --cluster-domain=cluster.local. \ --hairpin-mode=promiscuous-bridge \ --serialize-image-pulls=false

kubelet 打印出这些错误(我的 docker damon pid 是 5140): E0706 12:11:46.061949 1 container_manager_linux.go:394] open /proc/5140/cgroup: no such file or directory E0706 12:11:46.137217 1 container_manager_linux.go:97] Unable to ensure the docker processes run in the desired containers E0706 12:16:46.062290 1 container_manager_linux.go:394] open /proc/5140/cgroup: no such file or directory E0706 12:16:46.138189 1 container_manager_linux.go:97] Unable to ensure the docker processes run in the desired containers

如果我执行卷主机目录“/proc”,则 docker damon 发生错误。 docker: 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\\\"/proc\\\" to rootfs \\\"/data/docker/local-storage/docker/aufs/mnt/6ad53fff3b30e8d709b1be326f5de1314371e174e34806d4d6c6436275b6fbd3\\\" at \\\"/proc\\\" caused \\\"\\\\\\\"/data/docker/local-storage/docker/aufs/mnt/6ad53fff3b30e8d709b1be326f5de1314371e174e34806d4d6c6436275b6fbd3/proc\\\\\\\" cannot be mounted because it is located inside \\\\\\\"/proc\\\\\\\"\\\"\"".

我该怎么办,谁能给我点灯?

0 投票
1 回答
914 浏览

kubernetes - kubelet tls 证书的用途是什么

我看到 kubelet 正在 /var/run/kubernetes/ 中创建一对自签名证书:

这些用于他自己的 tls 配置,并且还设置了“CA:TRUE”。如果删除,它们将被重新创建。

我的第一个问题是用 CA:true 制作它们的目的是什么?kubelet 是否使用这些证书创建其他证书?如果是,出于什么目的?

为什么 apiserver 会自动信任这些证书?

最好的问候, 克里斯蒂安

0 投票
0 回答
1520 浏览

kubernetes - Why does kubernetes produce multiple errors when CPU usage is high?

I'm using Kubernetes with GKE (one node), which is very nice to use. However, I'm experiencing multiple errors, making all the pods not responding :

  • kubectl exec command : Error from server: error dialing backend: ssh: rejected: connect failed (Connection refused)
  • logs from nginx-ingress controller : service staging/myservice does not have any active endpoints
  • kubectl top nodes : Error from server (InternalError): an error on the server ("unknown") has prevented the request from succeeding (get services http:heapster:)

It happens when CPU usage is high (100% or almost, due to parallel Jenkins builds in my case).

I do set some resource requests and limits (sometimes both) for few pods, but even those pods are not reachable and at one point, they restart. The reason is almost always "Completed", with exit code 0 and few times "Error" with different exit codes (2, 137, 255 for example).

I've also noticed this error from replication controllers : Error syncing pod, skipping: network is not ready: [runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: Kubenet does not have netConfig. This is most likely due to lack of PodCIDR]

Kubernetes normally allows to keep availability of services over the cluster.

How can we explain this behavior ? What's the recommended way to prevent it ?

0 投票
2 回答
1075 浏览

amazon-web-services - k8s:从 ECR 中提取图像时出错

我们Waiting: ImagePullBackOff在 CI 升级期间不断得到。有人知道发生了什么吗?通过 kops 安装的 k8s 集群 1.6.2。在升级期间,我们会kubectl set image在过去 2 天内看到以下错误 Failed to pull image "********.dkr.ecr.eu-west-1.amazonaws.com/backend:da76bb49ec9a": rpc error: code = 2 desc = net/http: request canceled Error syncing pod, skipping: failed to "StartContainer" for "backend" with ErrImagePull: "rpc error: code = 2 desc = net/http: request canceled"

journalctl -r -u kubelet Jul 26 09:32:40 ip-10-0-49-227 kubelet[840]: W0726 09:32:40.731903 840 docker_sandbox.go:263] NetworkPlugin kubenet failed on the status hook for pod "backend-1277054742-bb8zm_default": Unexpected command output nsenter: cannot open : No such file or directory Jul 26 09:32:40 ip-10-0-49-227 kubelet[840]: E0726 09:32:40.724387 840 generic.go:239] PLEG: Ignoring events for pod frontend-1493767179-84rkl/default: rpc error: code = 2 desc = Error: No such container: 2421109e0d1eb31242c5088b547c0f29377816ca068a283b8fe6c2d8e7e5874d Jul 26 09:32:40 ip-10-0-49-227 kubelet[840]: E0726 09:32:40.724371 840 kuberuntime_manager.go:858] getPodContainerStatuses for pod "frontend-1493767179-84rkl_default(0fff3b22-71c8-11e7-9679-02c1112ca4ec)" failed: rpc error: code = 2 desc = Error: No such container: 2421109e0d1eb31242c5088b547c0f29377816ca068a283b8fe6c2d8e7e5874d Jul 26 09:32:40 ip-10-0-49-227 kubelet[840]: E0726 09:32:40.724358 840 kuberuntime_container.go:385] ContainerStatus for 2421109e0d1eb31242c5088b547c0f29377816ca068a283b8fe6c2d8e7e5874d error: rpc error: code = 2 desc = Error: No such container: 2421109e0d1eb31242c5088b547c0f29377816ca068a283b8fe6c2d8e7e5874d Jul 26 09:32:40 ip-10-0-49-227 kubelet[840]: E0726 09:32:40.724329 840 remote_runtime.go:269] ContainerStatus "2421109e0d1eb31242c5088b547c0f29377816ca068a283b8fe6c2d8e7e5874d" from runtime service failed: rpc error: code = 2 desc = Error: No such container: 2421109e0d1eb31242c5088b547c0f29377816ca068a283b8fe6c2d8e7e5874d Jul 26 09:32:40 ip-10-0-49-227 kubelet[840]: with error: exit status 1

0 投票
2 回答
824 浏览

kubernetes - Running Kubernetes in multimaster mode

I have set a kubernetes (version 1.6.1) cluster with three servers in control plane. Apiserver is running with the following config:

#xA;

Now I am running kubelet with following config:

#xA;

This works great as long as kube1 is running. If I take kube1 down, the node does not communicate with kube2 or kube3. It always takes up the first apiserver passed to the --api-servers flag and does not failover in case the first apiserver crashes. What is the correct way to do a failover in case one of the apiserver fails?

0 投票
1 回答
74 浏览

kubernetes - Kubernetes 主服务器无法启动并运行

安装 kubeadm v1.6.0-alpha、kubectl v1.5.3、kubelet v1.5.3 执行命令 $kubeadm init,启动 Kubernetes Master。观察到的问题:卡在以下日志消息中

创建 API 客户端,等待控制平面准备就绪

如何使 Kubernetes 主服务器启动并运行或如何调试问题?

0 投票
0 回答
116 浏览

kubernetes - 是否可以使用 Google Container Engine 设置自定义 kubelet 标志?

根据 Kubernetes 文档,建议配置Node Allocatable。方法是设置一些 Kubelet 标志。这是关于节点可分配的,但可能需要别的东西。

但是,Google Container Engine 管理 kubelet 命令和参数。这怎么可能?如果不是,是否有解决方法?