podman_kube_spec
|
描述要管理的 podman pod 和对应的 systemd 单元。
State :(默认: 创建的 )- 表示要通过 systemd 服务和 pod 执行的操作:
-
创建 :创建 pod 和 systemd 服务,但不运行它们
-
started : 创建 pod 和 systemd 服务并启动它们
-
缺少 :删除 pod 和 systemd 服务
run_as_user :(默认为 podman_run_as_user )- 每个 pod 用户。如果没有指定,则使用 root。
run_as_group (default: podman_run_as_group )- per-pod 组。如果没有指定,则使用 root。
-
systemd_unit_scope (default: podman_systemd_unit_scope )- 用于 systemd 单元的范围。如果没有指定,系统将 用于 root 容器 和用户 容器。
kube_file_src - 控制器节点上的 Kubernetes YAML 文件的名称,该文件将复制到受管节点上的 kube_file 中
如果指定了 kube_file_content 变量,则不要指定 kube_file_src 变量。kube_file_content 优先于 kube_file_src 。
kube_file_content - Kubernetes YAML 格式的字符串,或 Kubernetes YAML 格式的字典。它指定受管节点上的 kube_file 的内容。
如果指定了 kube_file_src 变量,则不要指定 kube_file_content 变量。kube_file_content 优先于 kube_file_src 。
kube_file - 受管节点上包含容器或 pod 规格的文件的名称。除非需要将 kube_file 文件复制到角色外的受管节点,否则通常不必指定 kube_file 变量。如果指定了 kube_file_src 或 kube_file_content ,则不必指定它。
强烈建议您省略 kube_file ,而是指定 kube_file_src 或 kube_file_content ,并允许角色管理文件路径和名称。
-
文件 basename 是 K8s yaml 中的 metadata.name 值,并附加了
.yml 后缀。
-
目录是系统服务的
/etc/containers/ansible-kubernetes.d 。
-
对于用户服务,目录为
$HOME/.config/containers/ansible-kubernetes.d 。
-
这将被复制到受管节点上的
/etc/containers/ansible-kubernetes.d/ <application_name& gt; .yml 文件。
|
podman_create_host_directories
|
如果为 true,该角色可确保在主机中指定的主机目录挂载到 podman_kube_specs 中给定的 Kubernetes YAML 中的 volumes.hostPath 规格中。默认值为 false。
目录必须指定为绝对路径(用于 root 容器),或者相对于主目录(非 root 容器)的路径,以便角色管理它们。其他任何内容都会被忽略。
该角色将其默认所有权或权限应用到目录。如果需要设置所有权或权限,请参阅 podman_host_directory 。
|
podman_host_directories
|
它是字典。如果使用 podman_create_host_directory 告知角色为卷挂载创建主机目录 ,并且您需要指定应用到这些创建主机目录的权限或所有权,请使用 podman_host_directory 。每个键都是要管理的主机目录的绝对路径。该值采用 file 模块的参数格式。如果没有指定值,该角色将使用其内置默认值。如果要指定用于所有主机目录的值,请使用特殊键 DEFAULT 。
|
podman_firewall
|
它是字典列表。指定您希望角色在防火墙中管理的端口。这使用与 firewall RHEL 系统角色使用的相同格式。
|
podman_selinux_ports
|
它是字典列表。指定您希望角色为角色使用的端口管理 SELinux 策略的端口。这使用与 selinux RHEL 系统角色使用的相同格式。
|
podman_run_as_user
|
指定用于所有无根容器的用户名称。您还可以使用 podman_kube_specs 中的 run_as_user 指定每个容器用户名。
|
podman_run_as_group
|
指定用于所有无根容器的组名称。您还可以在 podman_kube_specs 中使用 run_as_group 指定每个容器组名称。
|
podman_systemd_unit_scope
|
定义所有 systemd 单元默认使用的 systemd 范围。您还可以在 podman_kube_specs 中使用 systemd_unit_scope 指定每个容器范围。默认情况下,rootless 容器使用 user ,root 容器使用 系统 。
|
podman_containers_conf
|
将 containers.conf (5) 设置定义为字典。此设置在 containers.conf.d 目录中的置入文件中提供。如果以 root 身份运行(请参阅 podman_run_as_user ),系统将 管理系统设置。否则,会管理 用户设置 。有关目录位置,请参阅 containers.conf 手册页。
|
podman_registries_conf
|
将 containers-registries.conf (5) 设置定义为字典。设置在 registry.conf.d 目录中的置入文件中提供。如果以 root 身份运行(请参阅 podman_run_as_user ),系统将 管理系统设置。否则,会管理 用户设置 。有关 目录位置,请参见 registry.conf 手册页。
|
podman_storage_conf
|
将 containers-storage.conf (5) 设置定义为字典。如果以 root 身份运行(请参阅 podman_run_as_user ),系统将 管理系统设置。否则,会管理 用户设置 。有关目录位置,请参见 storage.conf 手册页。
|
podman_policy_json
|
将 containers-policy.conf (5) 设置定义为字典。如果以 root 身份运行(请参阅 podman_run_as_user ),系统将 管理系统设置。否则,会管理 用户设置 。有关目录位置,请参阅 policy.json 手册页。
|