第 3 章 配置和部署自动扩展


要配置和部署自动扩展,您必须完成以下先决条件:

  1. 在部署用于自动扩展的云前,为自动扩展服务创建环境模板和资源 registry。
  2. 部署云。

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
            ...
    ...

验证

  1. 验证所需的自定义资源是否已就绪:

    $ 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
  2. 验证是否有 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        |
    +----------------------------------+-----------+--------------+--------------+---------+-----------+------------------------------------------------+
  3. 验证是否有编排服务端点:

    $ 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 |
    +----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------------------------+
  4. 验证 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     |
    +----------------------+----------------------+-------+
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2026 Red Hat
返回顶部