MicroShift is Technology Preview software only.
For more information about the support scope of Red Hat Technology Preview software, see Technology Preview Support Scope.1.2. 创建 OVN-Kubernetes 配置文件
如果没有创建 OVN-Kubernetes 配置文件,红帽构建的 MicroShift 将使用内置默认 OVN-Kubernetes 值。您可以将 OVN-Kubernetes 配置文件写入 /etc/microshift/ovn.yaml。为您的配置提供了一个示例文件。
流程
要创建
ovn.yaml文件,请运行以下命令:$ sudo cp /etc/microshift/ovn.yaml.default /etc/microshift/ovn.yaml
$ sudo cp /etc/microshift/ovn.yaml.default /etc/microshift/ovn.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 要列出您创建的配置文件的内容,请运行以下命令:
$ cat /etc/microshift/ovn.yaml.default
$ cat /etc/microshift/ovn.yaml.defaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow 带有默认值的 'yaml' 配置文件示例
ovsInit: disableOVSInit: false gatewayInterface: "" mtu: 1400
ovsInit: disableOVSInit: false gatewayInterface: ""1 mtu: 1400Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 默认值为空字符串,表示 "not-specified"。CNI 网络插件会自动探测到带有默认路由的接口。
要自定义配置,请使用列出您可以使用的有效值:
Expand 表 1.1. 支持红帽构建的 MicroShift 的可选 OVN-Kubernetes 配置 字段 类型 Default(默认) 描述 示例 ovsInit.disableOVSInitbool
false
跳过在
microshift-ovs-init.service中配置 OVS 网桥br-extrue [1]
ovsInit.gatewayInterfaceAlpha
eth0
Ingress,即 API 网关
eth0
mtu
uint32
auto
用于 pod 的 MTU 值
1300
需要 OVS 网桥。当
disableOVSInit为 true 时,必须手动配置 OVS 网桥br-ex。重要如果更改了
ovn.yaml文件中的mtu配置值,您必须重启红帽构建的 MicroShift 运行的主机以应用更新的设置。
自定义 ovn.yaml 配置文件示例
ovsInit: disableOVSInit: true gatewayInterface: eth0 mtu: 1300
ovsInit:
disableOVSInit: true
gatewayInterface: eth0
mtu: 1300
当在 ovn.yaml 配置文件中将 disableOVSInit 设置为 true 时,必须手动配置 br-ex OVS 网桥。