本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
(可选)在 Amazon EKS DaemonSet 中以 a Amazon AppConfig 身份运行
使用 Amazon EKS,您可以将 Amazon AppConfig 代理作为边车运行,这样每个应用程序 pod 就会有一个代理容器。或者,如果您愿意,也可以将 Amazon AppConfig
Agent 作为运行 DaemonSet
注意
如果您以身份运行 Amazon AppConfig Agent DaemonSet,则代理将在单独的 pod 中运行,这意味着您无法通过调用来访问它localhost。您必须注入或以其它方式发现代理容器组(pod)的 IP 地址,才能调用它。
要以身份运行 Amazon AppConfig Agent DaemonSet,请创建一个包含以下内容的清单文件。将highlighted文本替换为应用程序和环境的详细信息。对于 Amazon Web Services 区域,请指定 Amazon Web Services 区域 代码(例如,us-west-1)。
apiVersion: apps/v1 kind: DaemonSet metadata: name: aws-appconfig-agent namespace:my_namespacelabels: app:my_application_labelspec: selector: matchLabels: app:my_application_labeltemplate: metadata: labels: app:my_application_labelspec: containers: - name: aws-appconfig-agent image: public.ecr.aws/aws-appconfig/aws-appconfig-agent:2.x ports: - name: http containerPort: 2772 protocol: TCP env: - name: SERVICE_REGION value:Amazon Web Services 区域imagePullPolicy: IfNotPresent # set a high priority class to ensure the agent is running on every node priorityClassName: system-node-critical
运行以下命令将 Amazon AppConfig 代理应用 DaemonSet 到您的集群。aws_appconfig_agent_daemonset替换为 DaemonSet清单的名称。
kubectl apply -faws_appconfig_agent_daemonset.yml