第 3 章 配置和部署自动扩展
要配置和部署自动扩展,您必须完成以下先决条件:
- 在部署用于自动扩展的云前,为自动扩展服务创建环境模板和资源 registry。
- 部署云。
3.1. 为自动扩展启用 control plane 资源 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
使用以下步骤启用自动扩展所需的 control plane 资源。
先决条件
- 在 OpenShift (RHOSO)环境中部署了 Red Hat OpenStack Services。
流程
编辑
OpenStackControlPlane自定义资源,以启用编排(heat)和 telemetry 服务。在 .yaml 文件的 telemetry 部分中,启用 Ceilometer、Autoscaling 和 MetricStorage 对象:$ oc edit oscp ... heat: enabled: true ... telemetry: apiOverride: {} enabled: true template: autoscaling: enabled: true heatInstance: heat ... ceilometer: enabled: true ... metricStorage: enabled: true ... ...
验证
验证所需的自定义资源是否已就绪:
$ oc get heat heat -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}' True $ oc get ceilometer ceilometer -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}' True $ oc get autoscaling autoscaling -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}' True $ oc get metricstorage metric-storage -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}' True验证是否有 Alarming 服务端点:
$ oc rsh openstackclient openstack endpoint list --service alarming +----------------------------------+-----------+--------------+--------------+---------+-----------+------------------------------------------------+ | ID | Region | Service Name | Service Type | Enabled | Interface | URL | +----------------------------------+-----------+--------------+--------------+---------+-----------+------------------------------------------------+ | 62d20961a3354daa8adf52db62cc809d | regionOne | aodh | alarming | True | public | https://aodh-public-openstack.apps.example.testing | | 8e526119b01248aba8d304de627a6267 | regionOne | aodh | alarming | True | internal | http://aodh-internal.openstack.svc:8042 | +----------------------------------+-----------+--------------+--------------+---------+-----------+------------------------------------------------+验证是否有编排服务端点:
$ oc rsh openstackclient openstack endpoint list --service orchestration +----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------------------------+ | ID | Region | Service Name | Service Type | Enabled | Interface | URL | +----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------------------------+ | 77190103ae3b479290138ebeca4a54d7 | regionOne | heat | orchestration | True | internal | http://heat-api-internal.openstack.svc:8004/v1/%(tenant_id)s | | c302ee5ff5cc45709d20b2d4a872d08f | regionOne | heat | orchestration | True | public | https://heat-api-public-openstack.apps.example.testing/v1/%(tenant_id)s | +----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------------------------+验证 Prometheus 是否已启用,并可提取每个端点。确认输出中的值为 1,但 Prometheus 容器除外,在启用 TLS 时为 0。
$ oc rsh openstackclient openstack metric query up --disable-rbac -c instance -c container -c value +----------------------+----------------------+-------+ | instance | container | value | +----------------------+----------------------+-------+ | 10.217.1.27:9093 | alertmanager | 1 | | 10.217.1.27:9093 | prometheus | 0 | | 10.217.1.52:3000 | proxy-httpd | 1 | | 10.217.0.169:3000 | | 1 | | 192.168.122.100:9100 | | 1 | | 192.168.122.101:9100 | | 1 | +----------------------+----------------------+-------+