gpt4 book ai didi

kubernetes 指标服务器不启动

转载 作者:行者123 更新时间:2023-12-02 11:44:21 25 4
gpt4 key购买 nike

我尝试在 kubernetes 的仪表板中连接。

我在服务器中安装了带有 kubeadm 的最新版本的 kubernetes v1.12。

我从 github 下载 metrics-server 并运行:

Kubctl create -f deploy/1.8+

但是我得到这个错误

kube-system metrics-server-5cbbc84f8c-tjfxd 0/1 Pending 0 12m

没有调试日志

error: the server doesn't have a resource type "logs"

我不想安装 heapster,因为它已被弃用。

更新

您好,谢谢。

我运行得到的污点命令:

error: at least one taint update is required

和命令

kubectl describe deployment metrics-server -n kube-system

我得到这个输出:

Name:                   metrics-server
Namespace: kube-system
CreationTimestamp: Thu, 18 Oct 2018 14:34:42 +0000
Labels: k8s-app=metrics-server
Annotations: deployment.kubernetes.io/revision: 1
kubectl.kubernetes.io/last-applied-configuration: {"apiVersion":"extensions/v1beta1","kind":"Deployment","metadata": {"annotations":{},"labels":{"k8s-app":"metrics-server"},"name":"metrics-...
Selector: k8s-app=metrics-server
Replicas: 1 desired | 1 updated | 1 total | 0 available | 1 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 1 max unavailable, 1 max surge
Pod Template:
Labels: k8s-app=metrics-server
Service Account: metrics-server
Containers:
metrics-server:
Image: k8s.gcr.io/metrics-server-amd64:v0.3.1
Port: <none>
Host Port: <none>
Environment: <none>
Mounts:
/tmp from tmp-dir (rw)
Volumes:
tmp-dir:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
OldReplicaSets: <none>
NewReplicaSet: metrics-server-5cbbc84f8c (1/1 replicas created)
Events: <none>

命令:

kubectl get nodes

此输出只是节点的 IP,没有什么特别的。

任何想法,或如何操作 kubernetes 的仪表板。

最佳答案

我想您正在尝试在您的主节点上设置 metrics-server。

如果你发出 kubectl describe deployment metrics-server -n kube-system 我相信你会看到这样的东西:

Name: metrics-server Namespace:
kube-system CreationTimestamp: Thu, 18 Oct 2018 15:57:34 +0000 Labels: k8s-app=metrics-server Annotations:
deployment.kubernetes.io/revision: 1 Selector:
k8s-app=metrics-server Replicas: 1 desired | 1 updated | 1 total | 0 available | 1 unavailable

但是如果你描述你的节点,你会看到阻止你在主节点上调度新 pod 的污点:

kubectl get nodes

NAME STATUS ROLES AGE VERSION
kube-master-1 Ready master 17m v1.12.1

kubectl describe node kube-master-1

Name: kube-master-1
...
Taints: node-role.kubernetes.io/master:NoSchedule

你必须移除这个污点:

kubectl taint node kube-master-1 node-role.kubernetes.io/master:NoSchedule-
node/kube-master-1 untainted

结果:

 kubectl get pods --all-namespaces

NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-node-xvc77 2/2 Running 0 20m
kube-system coredns-576cbf47c7-rj4wh 1/1 Running 0 21m
kube-system coredns-576cbf47c7-vsjsf 1/1 Running 0 21m
kube-system etcd-kube-master-1 1/1 Running 0 20m
kube-system kube-apiserver-kube-master-1 1/1 Running 0 20m
kube-system kube-controller-manager-kube-master-1 1/1 Running 0 20m
kube-system kube-proxy-xp5zh 1/1 Running 0 21m
kube-system kube-scheduler-kube-master-1 1/1 Running 0 20m
kube-system metrics-server-5cbbc84f8c-l2t76 1/1 Running 0 18m

但这不是最好的方法。好的方法是加入 worker 并在那里设置 metrics-server。不会有任何问题,也不需要在主节点上接触污点。

希望对你有所帮助。

关于kubernetes 指标服务器不启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52876792/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com