首页 > 其他分享 >kubectl get cs显示unhealthy的解决办法

kubectl get cs显示unhealthy的解决办法

时间:2023-06-19 18:35:06浏览次数:23  
标签:kubectl unhealthy get controller manager scheduler cs

01、问题描述

使用kubectl get cs查看K8s组件状态,发现scheduler和controller-manager状态为Unhealthy,但集群可以正常使用。

[root@k8s-master ~]# kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS      MESSAGE                                                                                       ERROR
scheduler            Unhealthy   Get "http://127.0.0.1:10251/healthz": dial tcp 127.0.0.1:10251: connect: connection refused   
controller-manager   Unhealthy   Get "http://127.0.0.1:10252/healthz": dial tcp 127.0.0.1:10252: connect: connection refused   
etcd-0               Healthy     {"health":"true"}  

02、解决方式

健康检查报错,10250和10251端口不存在,开启scheduler, control-manager的10251,10252端口即可。

(1)修改以下配置文件:

静态pod的路径:/etc/kubernetes/manifests

将kube-scheduler.yaml和kube-controller-manager.yaml,把port=0那行注释

[root@k8s-master ~]# cd /etc/kubernetes/manifests/
[root@k8s-master manifests]# vi kube-scheduler.yaml 

vi kube-controller-manager.yaml

(2)无需重启即可生效,使用kubectl get cs重新查看组件状态,显示正常。

[root@k8s-master manifests]# kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS    MESSAGE             ERROR
controller-manager   Healthy   ok                  
scheduler            Healthy   ok                  
etcd-0               Healthy   {"health":"true"} 

 

标签:kubectl,unhealthy,get,controller,manager,scheduler,cs
From: https://www.cnblogs.com/xiaozi/p/17491864.html

相关文章

  • Android-Kotlin-GET/SET 方法的使用
    上篇博客我们讲了kotlin的继承,今天接着往下讲解kotlin的get/set方法的使用。Student.ktpackagecn.kotlin.kotlin_oop04openclassPerson{openvarpersonName:String="我是父类的名字"}classStudent:Person(){/***name用private私有修饰,外界其他地方......
  • 2023-06-19 API `getMenuButtonBoundingClientRect` is not yet implemented
    前言:想使用该Api来获取设备导航栏高度,结果报错了:API`getMenuButtonBoundingClientRect`isnotyetimplemented尚未实现API`getMenuButtonBoundingClientRect`原因:该Api不支持在app端或者h5端使用。平台兼容如下: AppH5微信小程序支付宝小程序百度小程序抖音小程序飞书小......
  • K8s Kubectl 技巧集锦
    kubectl是Kubernetes的一个命令行管理工具,可用于Kubernetes上的应用部署和日常管理。本文列举了9个常见的kubectl命令,并总结了一些使用技巧,希望可以帮助系统管理员简化管理工作。一、使用Kubectl查询、创建、编辑和删除资源对于刚开始使用命令行工具的开发者,最保险的方......
  • Target: arm-none-linux-gnueabi
    [root@localhostsoftware]#whicharm-linux-gcc/usr/local/arm/4.3.2/bin/arm-linux-gcc[root@localhostsoftware]#arm-linux-gcc-Varm-none-linux-gnueabi-gcc:'-V'mustcomeatthestartofthecommandline[root@localhostsoftware]#......
  • GetModuleHandle("qq.dll");hDll_debug2=LoadLibrary("..\\qq\\Debug\\qq.dll")
    //qq.cpp:DefinestheentrypointfortheDLLapplication.//#include"stdafx.h"#include<stdio.h>BOOLAPIENTRYDllMain(HANDLEhModule,DWORDul_reason_for_call,LPVOIDlpReserved ......
  • GetSelfnameDlg::OnButton1()
    voidCGetSelfnameDlg::OnButton1(){ //HANDLEhThread; charszLibPath[_MAX_PATH]; //void*pLibRemote=0; //theaddress(intheremoteprocess)where //szLibPathwillbecopiedto; //DWORDhLibModule=0; //baseadressofloadedmodule......
  • PySide6(Qt for Python) QTableWidget表头边框线问题
    这个问题是在Windows10平台下特有问题。网络上有很多QtC++的解决方案。但是没有特定的PySide6的解决方案(以下是参考的QtC++的解决方案)。链接:https://blog.csdn.net/qq_22642239/article/details/122863344问题描述C++的解决方案是设置纵横表头的样式表:horizontalHeader,v......
  • qt——设置widget透明度,别的设置透明度办法实在行不通
     //实体列表窗体背景透明m_entityList->setWindowFlags(windowFlags()|Qt::FramelessWindowHint);//无边框m_entityList->setAttribute(Qt::WA_TranslucentBackground,true);//窗体背景全透明 ......
  • 使用Postman的Get请求遇到:"type": "parsing_exception","reason": "Unknown
    错误如图原因postman自身的的bug问题。body里面写了json参数,结果postman将GET请求当成POST请求了。解决办法删掉json数据,或者重新建立一个连接。......
  • /*创建消息队列*/ msgid=msgget(IPC_PRIVATE,0666 | IPC_CREAT);
    #include<stdlib.h>#include<stdio.h>#include<string.h>#include<errno.h>#include<unistd.h>#include<sys/types.h>#include<sys/ipc.h>#include<sys/msg.h>#defineMAX_TEXT512structmy_msg_st{......