配置


Red Hat build of MicroShift 4.12

配置 MicroShift

Red Hat OpenShift Documentation Team

摘要

本文档提供有关配置 MicroShift 的说明。

第 1 章 配置工具的工作方式

YAML 文件可根据您的偏好、设置和参数自定义红帽构建的 MicroShift 实例。

1.1. 使用 YAML 配置文件

红帽构建的 MicroShift 会在特定于用户的目录 ~/.microshift/config.yaml 中搜索配置文件,然后搜索系统范围的 /etc/microshift/config.yaml 目录。您必须创建配置文件并指定任何应在启动 MicroShift 的红帽构建前覆盖默认值的设置。

1.1.1. 默认设置

如果没有创建 config.yaml 文件,则使用默认值。以下示例配置包含默认设置。您必须在启动红帽构建的 MicroShift 前更改任何应覆盖默认值的设置。

默认 YAML 文件示例

dns:
  baseDomain: microshift.example.com 
1

network:
  clusterNetwork:
    - cidr: 10.42.0.0/16 
2

  serviceNetwork:
    - 10.43.0.0/16 
3

  serviceNodePortRange: 30000-32767 
4

node:
  hostnameOverride: "" 
5

  nodeIP: "" 
6

apiServer:
  subjectAltNames: [] 
7

debugging:
  logLevel: "Normal" 
8
Copy to Clipboard Toggle word wrap

1
集群的基域。所有管理的 DNS 记录都将是这个基础的子域。
2
从中分配 Pod IP 地址的 IP 地址块。
3
Kubernetes 服务的虚拟 IP 地址块。
4
端口范围允许用于 NodePort 类型的 Kubernetes 服务。
5
节点的名称。默认值为 hostname。
6
节点的 IP 地址。默认值是默认路由的 IP 地址。
7
API 服务器证书的主题备用名称。
8
日志详细程度。此字段的有效值为 Normal,Debug,Trace, 或 TraceAll
注意

红帽构建的 MicroShift 仅在启动时读取配置文件。在更改任何配置设置后,重启红帽构建的 MicroShift 使其生效。

1.2. 为 NodePort 服务扩展端口范围

serviceNodePortRange 设置允许扩展 NodePort 服务可用的端口范围。当需要公开 30000-32767 下的特定标准端口时,此选项很有用。例如,您的设备需要公开网络上的 1883/tcp MQ 遥测传输 (MQTT) 端口,因为某些客户端设备无法使用不同的端口。

重要

NodePort 可以与系统端口重叠,从而导致系统失败或红帽构建的 MicroShift。

配置 NodePort 服务范围时的注意事项:

  • 不要在没有明确选择了 nodePort 的情况下创建任何 NodePort 服务。在这种情况下,该端口由 kube-apiserver 随机分配。
  • 不要为任何系统服务端口、红帽构建的 MicroShift 端口或您在设备 HostNetwork 上公开的其他服务创建任何 NodePort 服务。
  • 表一指定在扩展端口范围时要避免的端口:
Expand
表 1.1. 避免的端口。
端口描述

22/tcp

SSH 端口

80/tcp

OpenShift Router HTTP 端点

443/tcp

OpenShift Router HTTPS 端点

1936/tcp

openshift-router 的指标服务,目前不会公开

2379/tcp

etcd 端口

2380/tcp

etcd 端口

6443

kubernetes API

8445/tcp

openshift-route-controller-manager

9537/tcp

cri-o 指标

10250/tcp

kubelet

10248/tcp

kubelet healthz port

10259/tcp

kube 调度程序

法律通告

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