This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第 19 章 AWS Load Balancer Operator
AWS Load Balancer (ALB) Operator 部署和管理 aws-load-balancer-controller
的实例。您可以使用 OpenShift Container Platform Web 控制台或 CLI 从 OperatorHub 安装 ALB Operator。
19.1.1. AWS Load Balancer Operator 的注意事项 复制链接链接已复制到粘贴板!
在安装和使用 AWS Load Balancer Operator 前,请查看以下限制。
- IP 流量模式仅适用于 AWS Elastic Kubernetes Service (EKS)。AWS Load Balancer Operator 禁用 AWS Load Balancer Controller 的 IP 流量模式。禁用 IP 流量模式后,AWS Load Balancer Controller 无法使用 pod 就绪度。
-
AWS Load Balancer Operator 将命令行标记(如
--disable-ingress-class-annotation
和--disable-ingress-group-name-annotation
)添加到 AWS Load Balancer Controller。因此,AWS Load Balancer Operator 不允许在Ingress
资源中使用kubernetes.io/ingress.class
和alb.ingress.kubernetes.io/group.name
注解。
19.1.2. AWS Load Balancer Operator 复制链接链接已复制到粘贴板!
如果缺少 kubernetes.io/role/elb
标签,AWS Load Balancer Operator 可以标记公共子网。另外,AWS Load Balancer Operator 从底层 AWS 云检测到以下内容:
- 托管 Operator 的集群的虚拟私有云 (VPC) 的 ID。
- 发现 VPC 的公共和私有子网。
先决条件
- 您必须具有 AWS 凭证 secret。凭证用于提供子网标记和 VPC 发现功能。
流程
您可以通过创建一个
Subscription
对象,部署来自 OperatorHub 的 AWS Load Balancer Operator:oc -n aws-load-balancer-operator get sub aws-load-balancer-operator --template='{{.status.installplan.name}}{{"\n"}}'
$ oc -n aws-load-balancer-operator get sub aws-load-balancer-operator --template='{{.status.installplan.name}}{{"\n"}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
install-zlfbt
install-zlfbt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 检查安装计划的状态。安装计划的状态必须是
Complete
:oc -n aws-load-balancer-operator get ip <install_plan_name> --template='{{.status.phase}}{{"\n"}}'
$ oc -n aws-load-balancer-operator get ip <install_plan_name> --template='{{.status.phase}}{{"\n"}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
Complete
Complete
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用
oc get
命令来查看部署
状态 :oc get -n aws-load-balancer-operator deployment/aws-load-balancer-operator-controller-manager
$ oc get -n aws-load-balancer-operator deployment/aws-load-balancer-operator-controller-manager
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
NAME READY UP-TO-DATE AVAILABLE AGE aws-load-balancer-operator-controller-manager 1/1 1 1 23h
NAME READY UP-TO-DATE AVAILABLE AGE aws-load-balancer-operator-controller-manager 1/1 1 1 23h
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
19.1.3. AWS Load Balancer Operator 日志 复制链接链接已复制到粘贴板!
使用 oc logs
命令查看 AWS Load Balancer Operator 日志。
流程
查看 AWS Load Balancer Operator 的日志:
oc logs -n aws-load-balancer-operator deployment/aws-load-balancer-operator-controller-manager -c manager
$ oc logs -n aws-load-balancer-operator deployment/aws-load-balancer-operator-controller-manager -c manager
Copy to Clipboard Copied! Toggle word wrap Toggle overflow