K3s 常见问题

资讯 2024-06-24 阅读:25 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

K3s 几乎可以胜任 k8s 的所有工作, 它只是一个更轻量级的版本。有关更多详细信息,请参见主要文档页面。

K3s  almost all jobs   k8s    it's only a lighter version. For more detailed information, see document page.

只需用启动 K3s server,然后部署你需要的 ingress。

Just start with   K3s server, then deploy what you need & nbsp;ingress.

目前,K3s 本身不支持 Windows,但是我们对将来的想法持开放态度。

At present, K3s  it does not support & nbsp; Windows, but we are open to ideas for the future.

请参考 K3s BUILDING.md的说明。

Please refer to the notes & nbsp; K3s  BUILDING.md.

安装脚本会自动检测你的操作系统是 systemd 或 openrc 并启动服务。

Installing scripts will automatically detect your operating systems & nbsp; systemd  or   openrc  and start the service.

当使用 openrc 运行时,日志将在中创建。

Logs will be created when running using & nbsp;openrc .

当使用 systemd 运行时,日志将在中创建,并使用查看。

When running with  systemd , the log will be created and the view will be used.

执行官网提供的安装脚本安装 K3s,无返回:

Installed scripts provided by the executive network & nbsp; K3s, no return:


解决方案:

Solution:

  1. 使用国内安装脚本安装 k3s,详情参考快速入门指南
    
    
        
  2. 或采用离线安装方式安装 k3s
  3. 
    
    

报错:

Wrong report:



原因分析:

Analysis of causes:

根据日志提示大概的原因是两个 k3s 节点主机名重复,或者 与 k3s server 的 node-passwd 不匹配造成。

The presumably reason given by the log is that two   k3s  node hostname repeats, or   & nbsp; k3s  server    node-passwd  is not matched.

节点注册到 k3s 集群,会在节点的生成一串随机的 password。如果 agent 首次注册,master 节点会把 agent 发送的 node-name 和 node-passwd 解析出来存储到/var/lib/rancher/k3s/server/cred/node-passwd 中。如果 agent 是非首次注册,k3s master 会结合 node-name 和 node-passwd 进行比对,如果信息不一致会拒绝添加节点请求。

Nodes register to   k3s  clusters generate a random set of   password at nodes. If   agent  first registration, master    sending   node-name      node-passwd  parsed out for storage to /var/lib/rancher/k3s/server/cred/node-passwd    if   if the registration is not for the first time, k3s  master  combining & nbsp; nde-name& nbsp; and & nbsp; and & nbsp; nde-passwd & nbsp; if the request is denied.

解决方案:

Solutions:

为什么会出现 passwd 不一致呢?正常来说如果用 k3s-agent-uninstall.sh 来清理安装过的 agent node,并不会删除 password 文件(/etc/rancher/node/password),那么问题很可能是 VM 重建或者手动操作删除的这个文件。因为 agent 上删除了 password,agent 再次注册时会重新生成 password,就导致了新的 password 和 k3s master 上原先存储的不一致。

Why & nbsp; passwd  Inconsistent? Normally, if   k3s-agent-uninstall.sh  to clean up installed   agent  node, not to delete   password  documents (/etc/rancher/node/password), then the problem is likely to be   VM  reconstruction or manual operation of the deleted document. For   &nent    password, angent  re-generated   password, leading to a new   password & nbsp; and & & nbsp; k3s& nbsp; master& nbsp; previous storage inconsistencies.

  1. 手动在 agent 上创建 password,内容和 server 中存储保持一致
  2. 修改 server 中的原始内容,让 password 和 agent 上新生成的保持一致
  3. 可以试试 agent 注册时使用--with-node-id,这样 server 中认为这完全是新 node,不会用原始信息比对
  4. 如果是因为主机名冲突导致的报错,可以修改主机名之后从新注册集群

默认情况下,k3s 启动 master 节点也同时具有 worker 角色,是可调度的,因此可以在它们上启动工作

By default, k3s  start & nbsp; master  node also has & nbsp; worker  role, is scalable and can therefore start work on them


解决方案

Solutions

  1. 通过 --node-taint
  2. 
    
        


  3. 通过 --disable-agent
  4. 
    
            


请参考k3s 网络要求检查主机网络或防火墙,查看 vxlan 对应的 UDP/8472 端口是否开放。

Please refer to k3s  network request to check the host network or firewall for   vxlan  corresponding & nbsp; UDP/8472  port is open.

可以通过--advertise-address设置 apiserver 向集群成员发布的 IP 地址,详细说明参考K3s Server 配置参考

        IP  address, detailed reference

Demo:

主机 eth0 eth1
k3s1 10.0.2.15/24 (NAT) 192.168.99.211/24 (Host-Only)
k3s2 10.0.2.15/24 (NAT) 192.168.99.212/24 (Host-Only)

K3s1(master):



K3s2(worker):






K3s 使用 traefik 作为默认的 ingress controller。启动之后是通过 iptables 转发 80/443 端口,所以用无法查到对应端口,可以通过,等命令去确认端口是否开启。更多说明请参考k3s 功能扩展之 Helm、Traefik LB、ServiceLB 存储及 RootFS

K3s  using   tradefik  as default   ingress controller. After startup, by   iptables  forwarding   80/443  port, so the port can be confirmed by, among other commands. For more information, please refer to ;

这是因为下列默认 Kubernetes 设置共同产生的效果:

This is due to the following defaults & nbsp; Kubernetes  co-generated effects of setting up:

  • kubelet
    • :设置 kubelet 上报节点信息给 master 的频率。(默认 10s)
  • kube-controller-manager
    • :NodeController 中 NodeStatus 的同步周期(默认 5s)
    • :节点被认定为不健康前,节点不作响应的总的时间。(默认 40s)
    • :优雅删除故障节点上容器的周期。(默认 5m0s)

在 Kubernetes v1.13 版本中,特性是默认开启的。

In   Kubernetes  v1.13  the characteristic is opened by default.

  • kube-apiserver (Kubernetes v1.13 版本及以后)
    • : 表示 notReady:NoExecute 容忍的容忍时间。notReady:NoExecute 被默认添加到没有该容忍的所有 Pod。
    • : 表示 unreachable:NoExecute 容忍的容忍时间。unreachable:NoExecute 被默认添加到没有该容忍的所有 Pod。

可以参考下面这个示例调整时间:

The following example can be used to adjust the time:

可以通过为节点增加 worker 角色。

This can be done by adding & nbsp; worker  role.



解决方案参考集群访问章节。

Solutions refer to 美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
  • 0.00015693个比特币等于多少人民币/美金

    0.00015693个比特币等于多少人民币/美金
    0.000 15693比特币等于多少人民币?根据比特币对人民币的最新汇率,0.000 15693比特币等于10.6 1678529美元/76.86554996人民币。比特币(BTC)【比特币价格翻倍】美元(USDT)人民币(CNY)0.000/克洛克-0/5693【数字货币矿机】10.6 167852976.8655254996比特币对人民币的最新汇率为:489,807.72 CNY(1比特币= 489,807.72人民币)(1美元=7.24人民币)(0.00015693 U...
  • 币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析

    币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析
    利空出尽?华尔街多头坚信美股将摆脱泥潭 经济衰退风险被夸大A lot of people on Wall Street believe that beauty will escape the quagmire; the risk of recession is exaggerated. 从目前美国经济的情况加上美股先有的走势来判断,确信通胀已经或即将见顶,这为价格压力回落铺平了道路,这最终将使美联储得以放缓...
  • 2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?

    2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?
    GDP作为全球公认的实力基准,就像是一个大国实力的代言人,它是布雷顿森林体系下全球团结的声音。它不仅仅是数字的累积,更是大国综合实力的人格化,默默诉说着每个国家的辉煌与荣耀。虽然GDP不是衡量一个国家综合实力的唯一标准,但无疑是最关键的指标之一。作为一面镜子,它反映了国家的经济实力和发展水平,是国家综合实力的重要体现,不容忽视。2000年,中国GDP迈过/克洛克-0/万亿美元的重要门槛,达到/克洛克-0/。2/克洛克-0/万亿美元(折合人民币7。7万亿元)。然而,在全球经济的...
标签列表