Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

20.4. 为 AWS 配置 OpenShift Container Platform

您可以通过两种方式在 OpenShift Container Platform 上设置 AWS 配置:

20.4.1. 使用 Ansible 为 AWS 配置 OpenShift Container Platform

在集群安装过程中,可以使用 openshift_cloudprovider_aws_access_key, openshift_cloudprovider_aws_secret_key, openshift_cloudprovider_kind, openshift_clusterid 参数配置 AWS,这些参数可以在 inventory 文件 中进行配置。

使用 Ansible 的 AWS 配置示例

# Cloud Provider Configuration
#
# Note: You may make use of environment variables rather than store
# sensitive configuration within the ansible inventory.
# For example:
#openshift_cloudprovider_aws_access_key="{{ lookup('env','AWS_ACCESS_KEY_ID') }}"
#openshift_cloudprovider_aws_secret_key="{{ lookup('env','AWS_SECRET_ACCESS_KEY') }}"
#
#openshift_clusterid=unique_identifier_per_availablility_zone
#
# AWS (Using API Credentials)
#openshift_cloudprovider_kind=aws
#openshift_cloudprovider_aws_access_key=aws_access_key_id
#openshift_cloudprovider_aws_secret_key=aws_secret_access_key
#
# AWS (Using IAM Profiles)
#openshift_cloudprovider_kind=aws
# Note: IAM roles must exist before launching the instances.

注意

当 Ansible 配置 AWS 时,它会自动对以下文件进行必要的更改:

  • /etc/origin/cloudprovider/aws.conf
  • /etc/origin/master/master-config.yaml
  • /etc/origin/node/node-config.yaml