zoukankan      html  css  js  c++  java
  • k8s执行kubectl相关命令报错:Unable to connect to the server: x509

    一、执行kubectl报错

    -rw------- 1 root root 5432 1月   4 11:29 scheduler.conf
    [root@localhost kubernetes]# kubectl get nodes
    Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
    [root@localhost kubernetes]# kubectl get svc
    Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

    二、重新执行以下命令

    [root@localhost kubernetes]# mkdir -p $HOME/.kube
    [root@localhost kubernetes]# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    cp:是否覆盖"/root/.kube/config"? y
    [root@localhost kubernetes]# chown $(id -u):$(id -g) $HOME/.kube/config

    三、测试解决问题

    [root@localhost kubernetes]# kubectl get nodes
    NAME             STATUS   ROLES    AGE     VERSION
    localhost        Ready    master   9h      v1.18.5
    redis-01.hlqxt   Ready    <none>   4h51m   v1.18.5
    redis-02.hlqxt   Ready    <none>   4h4m    v1.18.5
    redis-03.hlqxt   Ready    <none>   4h4m    v1.18.5
  • 相关阅读:
    文本阴影
    文本样式
    字体样式
    type类型
    表单元素格式
    HTML5的结构元素
    HTML标签常用属性
    如何创建事务?
    什么是主键、外键?
    Docker(2)数据管理
  • 原文地址:https://www.cnblogs.com/sky-cheng/p/14232228.html
Copyright © 2011-2022 走看看