错误标记主机:等待条件超时 [kubernetes]

2023-12-03

我刚刚开始学习 Kubernetes。我已经通过 Kubernetes YUM 存储库安装了 CentOS 7.5,并禁用了 SELinux 的 kubectl、kubeadm 和 kubelet。

然而,当我想开始一个kubeadm init命令。我收到此错误消息:

[init] using Kubernetes version: v1.12.2
[preflight] running pre-flight checks
    [WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
[preflight/images] Pulling images required for setting up a Kubernetes cluster
[preflight/images] This might take a minute or two, depending on the speed of your internet connection
[preflight/images] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[preflight] Activating the kubelet service
[certificates] Generated front-proxy-ca certificate and key.
[certificates] Generated front-proxy-client certificate and key.
[certificates] Generated etcd/ca certificate and key.
[certificates] Generated etcd/peer certificate and key.
[certificates] etcd/peer serving cert is signed for DNS names [vps604805.ovh.net localhost] and IPs [51.75.201.75 127.0.0.1 ::1]
[certificates] Generated apiserver-etcd-client certificate and key.
[certificates] Generated etcd/server certificate and key.
[certificates] etcd/server serving cert is signed for DNS names [vps604805.ovh.net localhost] and IPs [127.0.0.1 ::1]
[certificates] Generated etcd/healthcheck-client certificate and key.
[certificates] Generated ca certificate and key.
[certificates] Generated apiserver certificate and key.
[certificates] apiserver serving cert is signed for DNS names [vps604805.ovh.net kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 51.75.201.75]
[certificates] Generated apiserver-kubelet-client certificate and key.
[certificates] valid certificates and keys now exist in "/etc/kubernetes/pki"
[certificates] Generated sa key and public key.
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/admin.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/controller-manager.conf"
[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/scheduler.conf"
[controlplane] wrote Static Pod manifest for component kube-apiserver to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[controlplane] wrote Static Pod manifest for component kube-controller-manager to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[controlplane] wrote Static Pod manifest for component kube-scheduler to "/etc/kubernetes/manifests/kube-scheduler.yaml"
[etcd] Wrote Static Pod manifest for a local etcd instance to "/etc/kubernetes/manifests/etcd.yaml"
[init] waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests" 
[init] this might take a minute or longer if the control plane images have to be pulled
[apiclient] All control plane components are healthy after 26.003496 seconds
[uploadconfig] storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.12" in namespace kube-system with the configuration for the kubelets in the cluster
[markmaster] Marking the node vps604805.ovh.net as master by adding the label "node-role.kubernetes.io/master=''"
[markmaster] Marking the node vps604805.ovh.net as master by adding the taints [node-role.kubernetes.io/master:NoSchedule]
error marking master: timed out waiting for the condition

根据 Linux 基础课程,我不需要执行更多命令来在我的虚拟机中创建我的第一个启动集群。

Wrong?

Firewalld 确实开放了防火墙端口。 6443/TCP 和 10248-10252


我建议按照官方指南引导 Kubernetes 集群文档。我已继续执行一些步骤在同一 CentOS 版本上构建集群CentOS Linux release 7.5.1804 (Core)并与您分享,希望对您解决安装过程中的问题有所帮助。

首先擦除当前的集群安装:

# kubeadm reset -f && rm -rf /etc/kubernetes/

添加 Kubernetes 存储库以进一步了解kubeadm, kubelet, kubectl安装:

[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kube*
EOF

检查是否SELinux处于宽容模式:

# getenforce
Permissive

Ensure net.bridge.bridge-nf-call-iptables在 sysctl 中设置为 1:

# cat <<EOF >  /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system

安装所需的 Kubernetes 组件并启动服务:

# yum update && yum upgrade && yum install -y docker kubelet kubeadm kubectl --disableexcludes=kubernetes

# systemctl start docker kubelet && systemctl enable docker kubelet

通过以下方式部署集群kubeadm:

kubeadm init --pod-network-cidr=10.244.0.0/16

我更喜欢安装Flannel作为主要的CNI在我的集群中,尽管有一些适当的先决条件吊舱网络安装,我已经通过了--pod-network-cidr=10.244.0.0/16标记为kubeadm init命令。

为您的用户和存储创建 Kubernetes 主目录config file:

$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config

安装 Pod 网络,就我而言是Flannel:

$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml

最后检查 Kubernetes 核心 Pod 状态:

$ kubectl get pods --all-namespaces

NAMESPACE     NAME                                 READY   STATUS    RESTARTS   AGE
kube-system   coredns-576cbf47c7-4x7zq             1/1     Running   0          36m
kube-system   coredns-576cbf47c7-666jm             1/1     Running   0          36m
kube-system   etcd-centos-7-5                      1/1     Running   0          35m
kube-system   kube-apiserver-centos-7-5            1/1     Running   0          35m
kube-system   kube-controller-manager-centos-7-5   1/1     Running   0          35m
kube-system   kube-flannel-ds-amd64-2bmw9          1/1     Running   0          33m
kube-system   kube-proxy-pcgw8                     1/1     Running   0          36m
kube-system   kube-scheduler-centos-7-5            1/1     Running   0          35m

如果您仍有任何疑问,请在此答案下方写下评论。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

错误标记主机:等待条件超时 [kubernetes] 的相关文章

随机推荐

  • 从 OS X 通知中心获取通知列表

    有可能发送通知在 Mac 上使用通知中心NS用户通知 and NS用户通知中心API 类 但有没有any如何从通知中心读取通知 没有可用的公共 API 所以没有任何 App Store 符合 BUT 作为我的小技术演示应用程序 DiscoN
  • 通过 chromedriver 生成与 PayPal 相关的“无法识别的内容安全策略指令“reflected-xss””错误

    由于某些原因 我们的持续集成测试自 2017 年 2 月 7 日 星期二 以来一直失败 日志是通过生成的https github com SeleniumHQ selenium wiki JsonWireProtocol user cont
  • 没有启用的应用程序监视器代表队列 XYZ

    我创建了一个控制台应用程序 将由 Service BrokerExternal Activator 服务使用 C Program Files Service Broker External Activator Config 中的配置文件已更
  • 正确的编码方式——避免 for 循环

    我正在检查我的一个 R 文件 并通过稍微清理它 我试图更熟悉如何以正确的方式编写代码 作为初学者 我最喜欢的起点之一就是摆脱for 循环并尝试将表达式转换为函数式编程形式 所以这是场景 我正在组装一堆data frames into a l
  • 融化数据框和分割值

    我有以下数据框 其中测量值连接成单列 并由一些分隔符分隔 df lt data frame v1 c 1 2 v2 c a b c d e f df v1 v2 1 1 a b c 2 2 d e f g 我想将其融化 转换为以下格式 v1
  • 默认构造函数在 java 中的静态块之前执行

    当我们在java中加载一个类时 首先静态块被执行然后默认构造函数 但在下面的代码中 我观察到默认构造函数在静态块之前执行 public class Hello private static Hello hello new Hello pub
  • 在 PHP 中提取字符串的特定部分

    我只是想知道在 PHP 中提取动态字符串的特定部分最简单 最有效的方法是什么 例如 在此字符串中 http www dailymotion com video xclep1 school gyrls something like a par
  • Android Firebase云功能通知

    我已成功设置 firebase 云功能来向主题发送通知 问题是它发送给包括发件人在内的所有用户 我如何设置我的云功能 以便它不向发件人显示通知 请帮忙 以下是我如何发送到主题 exports sendNotesNotification fu
  • 父级上的 CKEditor“溢出:滚动”导致工具栏冻结在初始位置

    当您使用以下命令将 CKEditor 添加到 div 内的 div 时 overflow scroll 滚动父 div 时工具栏不会移动 div div This is the ckedito div div 可以在这里找到一个例子 htt
  • 当我导入客户端库时,为什么会出现 ReferenceError: self is not Defined ?

    试图创建一个xterm反应组件Next js我陷入了困境 因为我无法克服以前从未收到过的错误消息 我正在尝试导入一个名为的 npm 客户端模块xterm 但是如果我添加导入行 应用程序就会崩溃 import Terminal from xt
  • 正则表达式按空格分割但不转义空格

    我想按标准空白进行分割 但没有转义空格 例如 使用字符串 my name is max 单引号所以 是字面意思 我想要得到 my name is max 我试过这个正则表达式 s 但结果是这样的 gt m name is max 这很接近
  • 如何在 Dartlang 中检索元数据?

    Dartlang教程介绍package metahttps www dartlang org docs dart up and running contents ch02 html ch02 metadata DartEditor 识别元数
  • 从字符串中提取电话号码

    我正在尝试从给定的字符串中提取java中的电话号码 即电话号码可以位于字符串中的任何位置 例如 bla bla TELEPHONE NUMBER bla bla 现在我想在另一个字符串中提取这个电话号码 在使用时 matcher match
  • 如何将保存的 localStorage Web 数据传递到 php 脚本?

    好吧 所以我在尝试找出如何将我保存在 localStorage 中的一些数据传递到我编写的 php 脚本时遇到了一些问题 这样我就可以将其发送到服务器上的数据库 我之前确实找到了一些代码 https developer mozilla or
  • 发送 Outlook 日历邀请 PHP

    该代码的目标是使用 PHP 发送约会和阻止人员日历 我这里有两页 测试 php
  • 通过缓存电子表格值提高脚本性能

    我正在尝试使用 Google Apps 脚本开发一个网络应用程序 将其嵌入到 Google 站点中 该站点仅显示 Google 表格的内容并使用一些简单的参数对其进行过滤 至少目前是这样 稍后我可能会添加更多功能 我得到了一个功能齐全的应用
  • 将密码重置发送到其他电子邮件 - Devise

    我正在使用 Ruby on Rails 5 和 devise 我需要将密码重置电子邮件发送到与我的用户表中存储的电子邮件不同的电子邮件 如何才能实现这一目标 请注意 这是非常不推荐的实现方式 它不在最佳实践的范围内 它又脏又脆弱 但如果你真
  • Apple 文件系统从照片库读取的权限

    我的 ios 应用程序中有一个 UIWebView 它将响应式网站加载到我的 webview 中 在 asp net 中开发 网站有一个按钮用于从设备照片库中选择视频 另一个按钮用于上传视频 在 ios 版本 10 2 之前 它可以成功地将
  • 在帆和水线中混合使用 AND 和 OR 子句

    如何在 Sailsjs 及其 ORM Waterline 中使用 OR 和 AND 子句 例如我有一张书表 book name author free public Book A Author 1 false true Book B Aut
  • 错误标记主机:等待条件超时 [kubernetes]

    我刚刚开始学习 Kubernetes 我已经通过 Kubernetes YUM 存储库安装了 CentOS 7 5 并禁用了 SELinux 的 kubectl kubeadm 和 kubelet 然而 当我想开始一个kubeadm ini