A.5. 容器化 Ansible Automation Platform 参考


使用此信息了解容器化 Ansible Automation Platform 部署的架构。

您可以提供 Ansible Automation Platform 容器化设计的架构详情吗?

我们尽可能使用尽可能多的底层原生 Red Hat Enterprise Linux 技术。Podman 用于容器运行时和管理服务。

使用 podman ps 列出系统中正在运行的容器:

$ podman ps

CONTAINER ID  IMAGE                                                                        COMMAND               CREATED         STATUS         PORTS       NAMES
88ed40495117  registry.redhat.io/rhel8/postgresql-13:latest                                run-postgresql        48 minutes ago  Up 47 minutes              postgresql
8f55ba612f04  registry.redhat.io/rhel8/redis-6:latest                                      run-redis             47 minutes ago  Up 47 minutes              redis
56c40445c590  registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8:latest  /usr/bin/receptor...  47 minutes ago  Up 47 minutes              receptor
f346f05d56ee  registry.redhat.io/ansible-automation-platform-24/controller-rhel8:latest    /usr/bin/launch_a...  47 minutes ago  Up 45 minutes              automation-controller-rsyslog
26e3221963e3  registry.redhat.io/ansible-automation-platform-24/controller-rhel8:latest    /usr/bin/launch_a...  46 minutes ago  Up 45 minutes              automation-controller-task
c7ac92a1e8a1  registry.redhat.io/ansible-automation-platform-24/controller-rhel8:latest    /usr/bin/launch_a...  46 minutes ago  Up 28 minutes              automation-controller-web
Copy to Clipboard Toggle word wrap

使用 podman images 显示有关本地存储的镜像的信息:

$ podman images

REPOSITORY                                                            TAG         IMAGE ID      CREATED      SIZE
registry.redhat.io/ansible-automation-platform-24/ee-supported-rhel8  latest      b497bdbee59e  10 days ago  3.16 GB
registry.redhat.io/ansible-automation-platform-24/controller-rhel8    latest      ed8ebb1c1baa  10 days ago  1.48 GB
registry.redhat.io/rhel8/redis-6                                      latest      78905519bb05  2 weeks ago  357 MB
registry.redhat.io/rhel8/postgresql-13                                latest      9b65bc3d0413  2 weeks ago  765 MB
Copy to Clipboard Toggle word wrap

默认情况下,容器化 Ansible Automation Platform 作为无根容器运行,以提高安全性。这意味着您可以使用任何本地非特权用户帐户安装容器化的 Ansible Automation Platform。只有某些根级别任务需要特权升级,默认情况下不需要直接使用 root 用户。

安装程序将以下文件添加到在底层 Red Hat Enterprise Linux 主机上运行安装程序的文件系统中:

$ tree -L 1
    .
    ├── aap_install.log
    ├── ansible.cfg
    ├── collections
    ├── galaxy.yml
    ├── inventory
    ├── LICENSE
    ├── meta
    ├── playbooks
    ├── plugins
    ├── README.md
    ├── requirements.yml
    ├── roles
Copy to Clipboard Toggle word wrap

安装根目录包括使用 Podman 卷的其他容器化服务。

以下是进一步参考的一些示例:

containers 目录包括一些为 execution plane 使用并安装的 Podman 细节:

    containers/
    ├── podman
    ├── storage
    │   ├── defaultNetworkBackend
    │   ├── libpod
    │   ├── networks
    │   ├── overlay
    │   ├── overlay-containers
    │   ├── overlay-images
    │   ├── overlay-layers
    │   ├── storage.lock
    │   └── userns.lock
    └── storage.conf
Copy to Clipboard Toggle word wrap

控制器 目录具有一些已安装的配置和运行时数据点:

    controller/
    ├── data
    │   ├── job_execution
    │   ├── projects
    │   └── rsyslog
    ├── etc
    │   ├── conf.d
    │   ├── launch_awx_task.sh
    │   ├── settings.py
    │   ├── tower.cert
    │   └── tower.key
    ├── nginx
    │   └── etc
    ├── rsyslog
    │   └── run
    └── supervisor
        └── run
Copy to Clipboard Toggle word wrap

receptor 目录有自动化网格配置:

    receptor/
    ├── etc
    │   └── receptor.conf
    └── run
        ├── receptor.sock
        └── receptor.sock.lock
Copy to Clipboard Toggle word wrap

安装后,您还将在本地用户的 /home 目录中找到其他文件,如 .cache 目录:

    .cache/
    ├── containers
    │   └── short-name-aliases.conf.lock
    └── rhsm
        └── rhsm.log
Copy to Clipboard Toggle word wrap

由于服务默认使用无根 Podman 运行,您可以使用其他服务,如以非特权用户身份运行 systemd。在 systemd 下,您可以看到一些可用的组件服务控制:

.config 目录:

    .config/
    ├── cni
    │   └── net.d
    │       └── cni.lock
    ├── containers
    │   ├── auth.json
    │   └── containers.conf
    └── systemd
        └── user
            ├── automation-controller-rsyslog.service
            ├── automation-controller-task.service
            ├── automation-controller-web.service
            ├── default.target.wants
            ├── podman.service.d
            ├── postgresql.service
            ├── receptor.service
            ├── redis.service
            └── sockets.target.wants
Copy to Clipboard Toggle word wrap

这特定于 Podman,符合开放容器项目(OCI)规格。当您以 root 用户身份运行 Podman 时,默认使用 /var/lib/containers。对于标准用户,使用 $HOME/.local 下的层次结构。

.local 目录:

    .local/
    └── share
        └── containers
            ├── cache
            ├── podman
            └── storage
Copy to Clipboard Toggle word wrap

例如 .local/storage/volumes 包含 podman volume ls 提供的输出信息:

$ podman volume ls

DRIVER      VOLUME NAME
local       d73d3fe63a957bee04b4853fd38c39bf37c321d14fdab9ee3c9df03645135788
local       postgresql
local       redis_data
local       redis_etc
local       redis_run
Copy to Clipboard Toggle word wrap

执行平面与 control plane 主服务隔离,以确保它不会影响主服务。

control plane 服务使用标准 Podman 配置运行,并可在以下位置找到: ~/.local/share/containers/storage

执行平面服务(自动化控制器、EventDriven Ansible 和执行节点)使用 ~/aap/containers/storage.conf 中的专用配置。这种分离可防止执行 plane 容器影响 control plane 服务。

您可以使用以下命令之一查看 execution plane 配置:

CONTAINERS_STORAGE_CONF=~/aap/containers/storage.conf podman <subcommand>
Copy to Clipboard Toggle word wrap
CONTAINER_HOST=unix://run/user/<user uid>/podman/podman.sock podman <subcommand>
Copy to Clipboard Toggle word wrap

如何查看主机资源利用率统计信息?

运行以下命令以显示主机资源使用率统计信息:

$ podman container stats -a
Copy to Clipboard Toggle word wrap

基于 Dell 销售并提供容器化 Ansible Automation Platform 解决方案(DAAP)安装的输出示例,该安装采用 ~1.8 GB RAM:

ID            NAME                           CPU %       MEM USAGE / LIMIT  MEM %       NET IO      BLOCK IO    PIDS        CPU TIME    AVG CPU %
0d5d8eb93c18  automation-controller-web      0.23%       959.1MB / 3.761GB  25.50%      0B / 0B     0B / 0B     16          20.885142s  1.19%
3429d559836d  automation-controller-rsyslog  0.07%       144.5MB / 3.761GB  3.84%       0B / 0B     0B / 0B     6           4.099565s   0.23%
448d0bae0942  automation-controller-task     1.51%       633.1MB / 3.761GB  16.83%      0B / 0B     0B / 0B     33          34.285272s  1.93%
7f140e65b57e  receptor                       0.01%       5.923MB / 3.761GB  0.16%       0B / 0B     0B / 0B     7           1.010613s   0.06%
c1458367ca9c  redis                          0.48%       10.52MB / 3.761GB  0.28%       0B / 0B     0B / 0B     5           9.074042s   0.47%
ef712cc2dc89  postgresql                     0.09%       21.88MB / 3.761GB  0.58%       0B / 0B     0B / 0B     21          15.571059s  0.80%
Copy to Clipboard Toggle word wrap

使用多少存储以及在哪里?

容器卷存储位于 $HOME/.local/share/containers/storage/volumes 下。

  1. 要查看每个卷的详情,请运行以下命令:

    $ podman volume ls
    Copy to Clipboard Toggle word wrap
  2. 运行以下命令显示有关特定卷的详细信息:

    $ podman volume inspect <volume_name>
    Copy to Clipboard Toggle word wrap

例如:

$ podman volume inspect postgresql
Copy to Clipboard Toggle word wrap

输出示例:

[
    {
        "Name": "postgresql",
        "Driver": "local",
        "Mountpoint": "/home/aap/.local/share/containers/storage/volumes/postgresql/_data",
        "CreatedAt": "2024-01-08T23:39:24.983964686Z",
        "Labels": {},
        "Scope": "local",
        "Options": {},
        "MountCount": 0,
        "NeedsCopyUp": true
    }
]
Copy to Clipboard Toggle word wrap

安装程序创建的几个文件位于 $HOME/aap/ 中,绑定挂载到不同的正在运行的容器中。

  1. 要查看与容器关联的挂载,请运行以下命令:

    $ podman ps --format "{{.ID}}\t{{.Command}}\t{{.Names}}"
    Copy to Clipboard Toggle word wrap

    输出示例:

    89e779b81b83	run-postgresql	postgresql
    4c33cc77ef7d	run-redis	redis
    3d8a028d892d	/usr/bin/receptor...	receptor
    09821701645c	/usr/bin/launch_a...	automation-controller-rsyslog
    a2ddb5cac71b	/usr/bin/launch_a...	automation-controller-task
    fa0029a3b003	/usr/bin/launch_a...	automation-controller-web
    20f192534691	gunicorn --bind 1...	automation-eda-api
    f49804c7e6cb	daphne -b 127.0.0...	automation-eda-daphne
    d340b9c1cb74	/bin/sh -c nginx ...	automation-eda-web
    111f47de5205	aap-eda-manage rq...	automation-eda-worker-1
    171fcb1785af	aap-eda-manage rq...	automation-eda-worker-2
    049d10555b51	aap-eda-manage rq...	automation-eda-activation-worker-1
    7a78a41a8425	aap-eda-manage rq...	automation-eda-activation-worker-2
    da9afa8ef5e2	aap-eda-manage sc...	automation-eda-scheduler
    8a2958be9baf	gunicorn --name p...	automation-hub-api
    0a8b57581749	gunicorn --name p...	automation-hub-content
    68005b987498	nginx -g daemon o...	automation-hub-web
    cb07af77f89f	pulpcore-worker	automation-hub-worker-1
    a3ba05136446	pulpcore-worker	automation-hub-worker-2
    Copy to Clipboard Toggle word wrap
  2. 运行以下命令:

    $ podman inspect <container_name> | jq -r .[].Mounts[].Source
    Copy to Clipboard Toggle word wrap

    输出示例:

    /home/aap/.local/share/containers/storage/volumes/receptor_run/_data
    /home/aap/.local/share/containers/storage/volumes/redis_run/_data
    /home/aap/aap/controller/data/rsyslog
    /home/aap/aap/controller/etc/tower.key
    /home/aap/aap/controller/etc/conf.d/callback_receiver_workers.py
    /home/aap/aap/controller/data/job_execution
    /home/aap/aap/controller/nginx/etc/controller.conf
    /home/aap/aap/controller/etc/conf.d/subscription_usage_model.py
    /home/aap/aap/controller/etc/conf.d/cluster_host_id.py
    /home/aap/aap/controller/etc/conf.d/insights.py
    /home/aap/aap/controller/rsyslog/run
    /home/aap/aap/controller/data/projects
    /home/aap/aap/controller/etc/settings.py
    /home/aap/aap/receptor/etc/receptor.conf
    /home/aap/aap/controller/etc/conf.d/execution_environments.py
    /home/aap/aap/tls/extracted
    /home/aap/aap/controller/supervisor/run
    /home/aap/aap/controller/etc/uwsgi.ini
    /home/aap/aap/controller/etc/conf.d/container_groups.py
    /home/aap/aap/controller/etc/launch_awx_task.sh
    /home/aap/aap/controller/etc/tower.cert
    Copy to Clipboard Toggle word wrap
  3. 如果没有安装 jq RPM,请运行以下命令安装它:

    $ sudo dnf -y install jq
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat