使用时AWS EKS
,是否可以在现场实例上设置工作节点?
- 我怎样才能做到这一点?
- 在这样的设置中,我应该注意什么特别之处?
使用时AWS EKS
,是否可以在现场实例上设置工作节点?
是的,您可以,您必须修改部分中的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}