简体   繁体   English

K8s V1.24.3 kublete 崩溃,显示与服务器主服务器的连接:6443 被拒绝 - 您是否指定了正确的主机或端口?

[英]K8s V1.24.3 the kublete is crashdown,show The connection to the server master:6443 was refused - did you specify the right host or port?

enviroment:centos7.0 I want to build K8s cluster that have 3 nodes,one of them is the master;every pod'status is running,but there is a pod name test-claim is pending, the pvc is pending status:环境:centos7.0 我想搭建一个有3个节点的K8s集群,其中一个是master;每个pod的状态都在运行,但是有一个pod名称test-claim is pending,pvc是pending状态: 在此处输入图像描述

then I eidt the /etc/kubernetes/manifests/kube-apiserver.yaml,added a row然后我在 /etc/kubernetes/manifests/kube-apiserver.yaml 中添加了一行

    - --feature-gates=RemoveSelfLink=false

the problem is appear:问题出现了:

The connection to the server master:6443 was refused - did you specify the right host or port?

is there any problem I was missing?why the kubelet is crushdown?有什么我遗漏的问题吗?为什么 kubelet 被压垮了? could somebody answer this question?有人可以回答这个问题吗? thanks a lot previously.非常感谢以前。

this the content about kube-apiserver.yaml, could find some synatic error?这是关于 kube-apiserver.yaml 的内容,能找到一些语法错误吗?

apiVersion: v1
kind: Pod
metadata:
  annotations:
    kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 192.168.199.13:6443
  creationTimestamp: null
  labels:
    component: kube-apiserver
    tier: control-plane
  name: kube-apiserver
  namespace: kube-system
spec:
  containers:
  - command:
    - kube-apiserver
    - --advertise-address=192.168.199.13
    - --allow-privileged=true
    - --authorization-mode=Node,RBAC
    - --client-ca-file=/etc/kubernetes/pki/ca.crt
    - --enable-admission-plugins=NodeRestriction
    - --enable-bootstrap-token-auth=true
    - --etcd-cafile=/etc/kubernetes/pki/etcd/ca.crt
    - --etcd-certfile=/etc/kubernetes/pki/apiserver-etcd-client.crt
    - --etcd-keyfile=/etc/kubernetes/pki/apiserver-etcd-client.key
    - --etcd-servers=https://127.0.0.1:2379
    - --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt
    - --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key
    - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
    - --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt
    - --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key
    - --requestheader-allowed-names=front-proxy-client
    - --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
    - --requestheader-extra-headers-prefix=X-Remote-Extra-
    - --requestheader-group-headers=X-Remote-Group
    - --requestheader-username-headers=X-Remote-User
    - --secure-port=6443
    - --service-account-issuer=https://kubernetes.default.svc.cluster.local
    - --service-account-key-file=/etc/kubernetes/pki/sa.pub
    - --service-account-signing-key-file=/etc/kubernetes/pki/sa.key
    - --service-cluster-ip-range=10.1.0.0/16
    - --tls-cert-file=/etc/kubernetes/pki/apiserver.crt
    - --tls-private-key-file=/etc/kubernetes/pki/apiserver.key
    - --feature-gates=RemoveSelfLink=false
    image: registry.aliyuncs.com/google_containers/kube-apiserver:v1.24.3
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 8
      httpGet:
        host: 192.168.199.13
        path: /livez
        port: 6443
        scheme: HTTPS
      initialDelaySeconds: 10
      periodSeconds: 10
      timeoutSeconds: 15
    name: kube-apiserver
    readinessProbe:
      failureThreshold: 3
      httpGet:
        host: 192.168.199.13
        path: /readyz
        port: 6443
        scheme: HTTPS
      periodSeconds: 1
      timeoutSeconds: 15
    resources:
      requests:
        cpu: 250m
    startupProbe:
      failureThreshold: 24
      httpGet:
        host: 192.168.199.13
        path: /livez
        port: 6443
        scheme: HTTPS
      initialDelaySeconds: 10
      periodSeconds: 10
      timeoutSeconds: 15
    volumeMounts:
    - mountPath: /etc/ssl/certs
      name: ca-certs
      readOnly: true
    - mountPath: /etc/pki
      name: etc-pki
      readOnly: true
    - mountPath: /etc/kubernetes/pki
      name: k8s-certs
      readOnly: true
  hostNetwork: true
  priorityClassName: system-node-critical
  securityContext:
    seccompProfile:
      type: RuntimeDefault
  volumes:
  - hostPath:
      path: /etc/ssl/certs
      type: DirectoryOrCreate
    name: ca-certs
  - hostPath:
      path: /etc/pki
      type: DirectoryOrCreate
    name: etc-pki
  - hostPath:
      path: /etc/kubernetes/pki
      type: DirectoryOrCreate
    name: k8s-certs
status: {}

I finally find the solution don't need to edit the /etc/kubernetes/manifests/kube-apiserver.yaml file to add this row:- --feature-gates=RemoveSelfLink=false;this is not help for me.我终于找到解决方案不需要编辑 /etc/kubernetes/manifests/kube-apiserver.yaml 文件来添加这一行:- --feature-gates=RemoveSelfLink=false;这对我没有帮助。 the solution is:解决方案是:

1、docker pull vbouchaud/nfs-client-provisioner

Status: Downloaded newer image for vbouchaud/nfs-client-provisioner:latest docker.io/vbouchaud/nfs-client-provisioner:latest状态:为 vbouchaud/nfs-client-provisioner 下载更新的图像:最新 docker.io/vbouchaud/nfs-client-provisioner:latest

2、editing your deployment.yaml file vi deployment.yaml 2、编辑你的部署.yaml文件vi部署.yaml

change the images from quay.io/external_storage/nfs-client-provisioner:latest to docker.io/vbouchaud/nfs-client-provisioner:latest将图像从 quay.io/external_storage/nfs-client-provisioner:latest 更改为 docker.io/vbouchaud/nfs-client-provisioner:latest 在此处输入图像描述 3、 kubectl apply -f deployment.yaml 3、 kubectl apply -f 部署.yaml

finally the pvc'state would change from pending to bounding like this:最后 pvc'state 将从pending变为bounding,如下所示: 在此处输入图像描述

There are 2 issues:有2个问题:

  1. Your Pod & PVC is in pending state because you haven't created a relevant PV.您的 Pod 和 PVC 处于待处理 state 中,因为您尚未创建相关 PV。 Your StorageProvisioner for some reason isn't creating the PersistentVolume automatically so you need to create it manually.由于某种原因,您的StorageProvisioner不会自动创建PersistentVolume ,因此您需要手动创建它。

  2. Kube API server isn't working due to which the kubectl is facing connection refused error after adding the --feature-gates=RemoveSelfLink=false . Kube API 服务器无法正常工作,因为 kubectl 在添加--feature-gates=RemoveSelfLink=false后面临connection refused错误。 Maybe, there's some syntatic error in the modified manifest.也许,修改后的清单中有一些语法错误。 Can share the contents of your kube-apiserver.yaml file?可以分享你的kube-apiserver.yaml文件的内容吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 与服务器 xxxx:6443 的连接被拒绝 - 您是否指定了正确的主机或端口? Kubernetes - The connection to the server x.x.x.x:6443 was refused - did you specify the right host or port? Kubernetes 与服务器 xxxx:6443 的连接被拒绝 - 您是否指定了正确的主机或端口? - The connection to the server xxxx:6443 was refused - did you specify the right host or port? 与服务器 xxx:6443 的连接被拒绝 - 您是否指定了正确的主机或端口? Kube.netes - The connection to the server x.x.x.:6443 was refused - did you specify the right host or port? Kubernetes 与服务器 10.117.xxx.xxx:6443 的连接被拒绝 - 您是否指定了正确的主机或端口? - The connection to the server 10.117.xxx.xxx:6443 was refused - did you specify the right host or port? 与服务器 xxxx:6443 的连接被拒绝。 您是否指定了正确的主机或端口? - The connection to the server x.x.x.x:6443 was refused. Did you specify the right host or port? Minikube:kubectl 连接被拒绝 - 您是否指定了正确的主机或端口? - Minikube: kubectl connection refused - did you specify the right host or port? Kubernetes - 与服务器 localhost:8080 的连接被拒绝 - 您是否指定了正确的主机或端口? - Kubernetes - The connection to the server localhost:8080 was refused - did you specify the right host or port? 与服务器rancher.xxx.xxx的连接被拒绝 - 您是否指定了正确的主机或端口? - The connection to the server rancher.xxx.xxx was refused - did you specify the right host or port? Kubectl 命令出错:与服务器 localhost:8080 的连接被拒绝 - 您是否指定了正确的主机或端口? - Error in Kubectl command: The connection to the server localhost:8080 was refused - did you specify the right host or port? KIND 和 kubectl:与服务器 localhost:8080 的连接被拒绝 - 您是否指定了正确的主机或端口? - KIND and kubectl: The connection to the server localhost:8080 was refused - did you specify the right host or port?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM