amazon-web-services - 创建 EKS 工作节点时如何在云形成模板中指定现有节点安全组

标签 amazon-web-services kubernetes aws-cloudformation amazon-eks

我想使用 EKS 集群中的现有节点安全组创建 EKS 工作节点。

目前,有以下cloudformation template ,使用新的安全组创建 EKS 工作节点。

如何为我的工作节点引用预先存在的节点安全组?

最佳答案

Arundathi,我将使用相同的模板来解释它。

正在此模板中创建 NodeSecurityGroup (#L200)。如果您想使用现有的安全组,则可以将其作为用户输入,就像ClusterControlPlaneSecurityGroup(#L136):

  ClusterControlPlaneSecurityGroup:
    Description: The security group of the cluster control plane.
    Type: AWS::EC2::SecurityGroup::Id

然后,在需要的地方引用它(#L226)。例如:

  NodeSecurityGroupFromControlPlaneIngress:
    Type: AWS::EC2::SecurityGroupIngress
    DependsOn: NodeSecurityGroup
    Properties:
      Description: Allow worker Kubelets and pods to receive communication from the cluster control plane
      GroupId: !Ref NodeSecurityGroup
      SourceSecurityGroupId: !Ref ClusterControlPlaneSecurityGroup
      IpProtocol: tcp
      FromPort: 1025
      ToPort: 65535

如果您还有任何疑问,请告诉我。

关于amazon-web-services - 创建 EKS 工作节点时如何在云形成模板中指定现有节点安全组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57556628/

相关文章:

aws-cloudformation - 如何在单个参数发生变化的情况下创建多个cloudformation堆栈?

apache - 在亚马逊 VPC 上设置多个 SSL 证书

mysql - 如何处理不同数据中心的多个EBS之间的数据库同步?

node.js - AWS.DynamoDB.DocumentClient 未提供放置数据

java - 无法从 DynamoDB 加载数据,因为 List<Object> 类型的属性无法未转换并使用@DynamoDBDocument 保存

windows - 如何确保 az kubectl 凭据不会过期并且 kubectl 可以通过生产中的脚本运行?

bash - 如何通过 AWS cloudformation 用户数据 bash 脚本安装服务并在 cloud-init 阶段启动它?

azure - Elasticsearch Pod 在 Init 状态后失败且没有日志

kubernetes - 由于验证错误,无法使用 kubectl 创建作业

aws-cloudformation - 在 cloudformation 中启用 SNS 传递状态日志记录配置