繁体   English   中英

使用 Terraform,如何使用 Fargate 创建 AWS Kubernetes 集群?

[英]Using Terraform, how would I create a AWS Kubernetes cluster with Fargate?

我正在寻找使用 Terraform 在 AWS 上使用 Fargate 创建 Kubernetes 集群的配方。 我找不到任何端到端的文档来做到这一点。

我正在使用 SSO,因此 terraform 需要使用我的 AWS 凭证来执行此操作。

没有示例我可以使用 AWS 凭证和 Fargate 找到地址。

如果有人这样做并且有以上所有方法的食谱,请分享。

您可以对该terraform-aws-eks使用流行的模块。 它也支持 Fargate EKS。 由于它是开源的,如果你想分叉和自定义模块,或者创建自己的临时文件,你还可以看看如何创建这样的集群。

Fargate EKS 的使用示例来自其文档:

module "eks" {
  source          = "../.."
  cluster_name    = local.cluster_name
  cluster_version = "1.17"
  subnets         = module.vpc.private_subnets

  tags = {
    Environment = "test"
    GithubRepo  = "terraform-aws-eks"
    GithubOrg   = "terraform-aws-modules"
  }

  vpc_id = module.vpc.vpc_id

  fargate_profiles = {
    example = {
      namespace = "default"

      # Kubernetes labels for selection
      # labels = {
      #   Environment = "test"
      #   GithubRepo  = "terraform-aws-eks"
      #   GithubOrg   = "terraform-aws-modules"
      # }

      # using specific subnets instead of all the ones configured in eks
      # subnets = ["subnet-0ca3e3d1234a56c78"]

      tags = {
        Owner = "test"
      }
    }
  }

  map_roles    = var.map_roles
  map_users    = var.map_users
  map_accounts = var.map_accounts
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM