2

使用时AWS EKS,是否可以在现场实例上设置工作节点?

  • 我怎样才能做到这一点?
  • 在这样的设置中,我应该注意什么特别之处?
4

1 回答 1

2

是的,您可以,您必须修改部分中的Cloudformation 模板(在本文档中提到)LaunchConfiguration以指定现货价格。

NodeLaunchConfig:
  Type: AWS::AutoScaling::LaunchConfiguration
  Properties:
    SpotPrice: "20" # <=== Here
    AssociatePublicIpAddress: 'true'
    IamInstanceProfile: !Ref NodeInstanceProfile
    ImageId: !Ref NodeImageId
    InstanceType: !Ref NodeInstanceType
    KeyName: !Ref KeyName
    SecurityGroups:
    - !Ref NodeSecurityGroup
    BlockDeviceMappings:
      - DeviceName: /dev/xvda
        Ebs:
          VolumeSize: !Ref NodeVolumeSize
          VolumeType: gp2
          DeleteOnTermination: true
    UserData:
      Fn::Base64:
        !Sub |
          #!/bin/bash
          set -o xtrace
          /etc/eks/bootstrap.sh ${ClusterName} ${BootstrapArguments}
          /opt/aws/bin/cfn-signal --exit-code $? \
                   --stack  ${AWS::StackName} \
                   --resource NodeGroup  \
                   --region ${AWS::Region}
于 2018-10-19T06:44:18.583 回答