故障排除


Red Hat build of MicroShift 4.12

常见问题故障排除

Red Hat OpenShift Documentation Team

摘要

本文档提供有关如何对 MicroShift 进行故障排除的信息。

第 1 章 检查您已安装了哪个版本

要开始故障排除,请确定您安装了哪个 MicroShift 版本。

要开始故障排除,您必须知道您的红帽构建的 MicroShift 版本。获取此信息的一种方法是使用 CLI。

流程

  • 运行以下命令来检查版本信息:

    $ microshift version
    Copy to Clipboard Toggle word wrap

    输出示例

    Red Hat build of MicroShift Version: 4.12-0.microshift-e6980e25
    Base OCP Version: 4.12
    Copy to Clipboard Toggle word wrap

1.2. 使用 API 检查 MicroShift 版本的红帽构建

要开始故障排除,您必须知道您的红帽构建的 MicroShift 版本。获取此信息的一种方法是使用 API。

流程

  • 要使用 OpenShift CLI (oc) 获取版本号,请运行以下命令来查看 kube-public/microshift-version 配置映射:

    $ oc get configmap -n kube-public microshift-version -o yaml
    Copy to Clipboard Toggle word wrap

    输出示例

    apiVersion: v1
    data:
      major: "4"
      minor: "10"
      version: 4.10.0-0.microshift-e6980e25
    kind: ConfigMap
    metadata:
      creationTimestamp: "2022-08-08T21:06:11Z"
      name: microshift-version
      namespace: kube-public
    Copy to Clipboard Toggle word wrap

第 2 章 响应重启和安全证书

红帽构建的 MicroShift 会响应系统配置更改,并在检测到更改后重启,包括 IP 地址更改、时钟调整和安全证书期限。

2.1. IP 地址更改或时钟调整

红帽构建的 MicroShift 依赖于设备 IP 地址和系统范围的时钟设置,以便在运行时保持一致。但是,这些设置偶尔可能会在边缘设备上更改,如 DHCP 或网络时间协议 (NTP) 更新。

当进行此类更改时,一些红帽构建的 MicroShift 组件可能会停止正常工作。为缓解这种情况,红帽构建的 MicroShift 会监控 IP 地址和系统时间,并在检测到任一设置更改时重新启动。

触发时钟更改的阈值是,时间的调整超过 10 秒(早或晚)。网络时间协 议(NTP) 服务会定期执行小的时间调整,这不会造成重启。

2.2. 安全证书生命周期

红帽构建的 MicroShift 证书被分为两个基本组:

  1. 短期证书的有效期为一年。
  2. 长期证书的有效期为 10 年。

大多数服务器或叶证书都是短期的。

一个长期的证书示例是用于 system:admin 用户身份验证的客户端证书,或 kube-apiserver 外部服务证书的证书。

2.2.1. 证书轮转

随着证书的年龄,红帽构建的 MicroShift 可以重启以轮转证书。在一个证书临近过期时也可以自动导致重启。阅读以下情况概述以了解相关操作:

  1. 绿区:

    1. 当短期证书存在 5 个月时,不会发生轮转。
    2. 当长期证书存在 8.5 年时,不会发生轮转。
  2. 黄区:

    1. 当短期证书存在 8 个月时,它会在红帽构建的 MicroShift 启动或重启时进行轮转。
    2. 当长期证书存在 9 年时,它会在红帽构建的 MicroShift 启动或重启时进行轮转。
  3. 红区

    1. 当短期证书存在 8 个月时,红帽构建的 MicroShift 会重启以轮转并应用新证书。
    2. 当长期证书存在 9 年时,红帽构建的 MicroShift 会重启以轮转并应用新证书。
注意

如果轮转的证书是证书颁发机构(CA),则其签署的所有证书都会轮转。

图 2.1. 红帽构建的 MicroShift 证书有效性的 stoplight 时间表。

第 3 章 故障排除

阅读已知问题故障排除和可能的解决方案。

3.1. 对 NodePort 服务 iptable 规则进行故障排除

OVN-Kubernetes 在网络地址转换 (NAT) 表中设置 iptable 链,以处理到 NodePort 服务的传入流量。当 NodePort 服务无法访问或连接被拒绝时,请检查主机上的 iptable 规则,以确保正确插入相关的规则。

流程

  1. 运行以下命令,查看 NodePort 服务的 iptable 规则:

    $ iptables-save | grep NODEPORT
    Copy to Clipboard Toggle word wrap

    输出示例

    -A OUTPUT -j OVN-KUBE-NODEPORT
    -A OVN-KUBE-NODEPORT -p tcp -m addrtype --dst-type LOCAL -m tcp --dport 30326 -j DNAT --to-destination 10.43.95.170:80
    Copy to Clipboard Toggle word wrap

    OVN-Kubernetes 在 NAT 表中配置 OVN-KUBE-NODEPORT iptable 链,以匹配目标端口和目的地网络地址转换 (DNAT) 数据包到 clusterIP 服务。数据包随后通过网关网桥 br-ex 通过主机上的路由规则路由到 OVN 网络。

  2. 运行以下命令,使用路由规则通过网络路由数据包:

    $ ip route
    Copy to Clipboard Toggle word wrap

    输出示例

    10.43.0.0/16 via 192.168.122.1 dev br-ex mtu 1400
    Copy to Clipboard Toggle word wrap

    此路由规则与 Kubernetes 服务 IP 地址范围匹配,并将数据包转发到网关网桥 br-ex。您必须在主机上启用 ip_forward。数据包转发到 OVS 网桥 br-ex 后,它由 OVS 中的 OpenFlow 规则处理,该规则将数据包窃取到 OVN 网络,最终发送到 pod。

法律通告

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat