Amazon web services 使用CloudFormation安装EKS和Fargate

Amazon web services 使用CloudFormation安装EKS和Fargate,amazon-web-services,amazon-eks,aws-fargate,Amazon Web Services,Amazon Eks,Aws Fargate,我能够使用Cloudformation创建EKS集群。我还可以有一个“节点组”和EC2+自动缩放。另一方面,我还可以安装FargateProfile并创建“FargateNodes”。这很有效。但我只想使用fargate(没有EC2节点等)。在这里,我需要在Fargate上托管我的管理吊舱(在kube系统中)。我该怎么办 我试过这个: Resources: FargateProfile: Type: AWS::EKS::FargateProfile Properties:

我能够使用Cloudformation创建EKS集群。我还可以有一个“节点组”和EC2+自动缩放。另一方面,我还可以安装FargateProfile并创建“FargateNodes”。这很有效。但我只想使用fargate(没有EC2节点等)。在这里,我需要在Fargate上托管我的管理吊舱(在kube系统中)。我该怎么办

我试过这个:

Resources:
  FargateProfile:
    Type: AWS::EKS::FargateProfile
    Properties:
      ClusterName: eks-test-cluster-001
      FargateProfileName: fargate
      PodExecutionRoleArn: !Sub 'arn:aws:iam::${AWS::AccountId}:role/AmazonEKSFargatePodExecutionRole'
      Selectors:
        - Namespace: kube-system
        - Namespace: default
        - Namespace: xxx
      Subnets:
        !Ref Subnets
但我的管理吊舱仍在EC2上。也许我丢失了一些标签,但这是正确的方法吗?有些标签是用散列生成的,所以我不能只在fargateProfile中添加它们

有了eksctl,这似乎是可能的:在上面的命令中添加--fargate选项将创建一个没有节点组的集群。但是,eksctl创建了一个pod执行角色,一个默认和kube系统名称空间的Fargate配置文件,并对coredns部署进行了修补,以便它可以在Fargate上运行

但是如何在云信息中做到这一点呢


我还尝试使用标签,但随后在CloudFormation中出现错误:模型
验证失败(#:不允许使用无关键[k8s app])

我没有复制此模板。 但是,由于我有类似的问题,模型验证失败,如果您使用标签,请确保您具有Key:XXX的格式
Value:XXX

以下配置对我有效,但在手动修补核心DNS部署文件之后。关于如何在Fargate上使用云形成运行核心DNS的任何想法

Resources:
  FargateProfile:
    Type: 'AWS::EKS::FargateProfile'
    DependsOn: ControlPlane
    Properties:
      ClusterName: my-cluster
      FargateProfileName: fp-default
      PodExecutionRoleArn: !GetAtt 
        - FargatePodExecutionRole
        - Arn
      Selectors:
        - Namespace: default
        - Namespace: kube-system
          Labels:
            - Key: k8s-app
              Value: kube-dns