第 6 章 安装 OpenStack 后配置网络设置
在安装后,您可以在 Red Hat OpenStack Platform (RHOSP) 集群中为 OpenShift Container Platform 配置网络设置。
6.1. 使用浮动 IP 地址配置应用程序访问 复制链接链接已复制到粘贴板!
安装 OpenShift Container Platform 后,请配置 Red Hat OpenStack Platform (RHOSP) 以允许应用程序网络流量。
如果您在 install-config.yaml
文件中为 platform.openstack.apiFloatingIP
和 platform.openstack.ingressFloatingIP
提供了值,或为 inventory.yaml
playbook 中的 os_api_fip
和 os_ingress_fip
提供了值,在安装过程中不需要执行此步骤。已设置浮动 IP 地址。
先决条件
- 必须已安装 OpenShift Container Platform 集群
- 启用浮动 IP 地址,如 RHOSP 安装文档中的 OpenShift Container Platform 所述。
流程
在安装 OpenShift Container Platform 集群后,将浮动 IP 地址附加到入口端口:
显示端口:
openstack port show <cluster_name>-<cluster_ID>-ingress-port
$ openstack port show <cluster_name>-<cluster_ID>-ingress-port
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将端口附加到 IP 地址:
openstack floating ip set --port <ingress_port_ID> <apps_FIP>
$ openstack floating ip set --port <ingress_port_ID> <apps_FIP>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在您的 DNS 文件中,为
*apps.
添加一条通配符A
记录。*.apps.<cluster_name>.<base_domain> IN A <apps_FIP>
*.apps.<cluster_name>.<base_domain> IN A <apps_FIP>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
如果您不控制 DNS 服务器,但希望为非生产用途启用应用程序访问,您可以将这些主机名添加到 /etc/hosts
:
<apps_FIP> console-openshift-console.apps.<cluster name>.<base domain> <apps_FIP> integrated-oauth-server-openshift-authentication.apps.<cluster name>.<base domain> <apps_FIP> oauth-openshift.apps.<cluster name>.<base domain> <apps_FIP> prometheus-k8s-openshift-monitoring.apps.<cluster name>.<base domain> <apps_FIP> <app name>.apps.<cluster name>.<base domain>
<apps_FIP> console-openshift-console.apps.<cluster name>.<base domain>
<apps_FIP> integrated-oauth-server-openshift-authentication.apps.<cluster name>.<base domain>
<apps_FIP> oauth-openshift.apps.<cluster name>.<base domain>
<apps_FIP> prometheus-k8s-openshift-monitoring.apps.<cluster name>.<base domain>
<apps_FIP> <app name>.apps.<cluster name>.<base domain>