簡體   English   中英

如何使用 C# 實現 Pulumi EKS RoleMappings

[英]How can I achieve Pulumi EKS RoleMappings with C#

Amazon EKS 中有 Kubernetes RBAC 和 TypeScript 的 Pulumi 指令。

const vpc = new awsx.ec2.Vpc("vpc", {});
const cluster = new eks.Cluster("eks-cluster", {
  vpcId             : vpc.id,
  subnetIds         : vpc.publicSubnetIds,
  instanceType      : "t2.medium",
  nodeRootVolumeSize: 200,
  desiredCapacity   : 1,
  maxSize           : 2,
  minSize           : 1,
  deployDashboard   : false,
  vpcCniOptions     : {
    warmIpTarget    : 4,
  },
  roleMappings      : [
    // Provides full administrator cluster access to the k8s cluster
    {
      groups    : ["system:masters"],
      roleArn   : clusterAdminRole.arn,
      username  : "pulumi:admin-usr",
    },
    // Map IAM role arn "AutomationRoleArn" to the k8s user with name "automation-usr", e.g. gitlab CI
    {
      groups    : ["pulumi:automation-grp"],
      roleArn   : AutomationRole.arn,
      username  : "pulumi:automation-usr",
    },
    // Map IAM role arn "EnvProdRoleArn" to the k8s user with name "prod-usr"
    {
      groups    : ["pulumi:prod-grp"],
      roleArn   : EnvProdRole.arn,
      username  : "pulumi:prod-usr",
    },
  ],
});

帶有開源 Pulumi 包的 AWS EKS 中的 Kubernetes RBAC | Pulumi https://www.pulumi.com/blog/simplify-kubernetes-rbac-in-amazon-eks-with-open-source-pulumi-packages/

我正在尋找如何使用 .NET C# 來實現這一目標? 看起來 eks roleMappings 擴展僅適用於 TypeScript,因此可能需要 C# 使用 Pulumi.Z30136395F018797924198317C11831EA?

https://github.com/pulumi/pulumi-aws/blob/c672e225a765b11b07ea23e7b1b411483d7f38da/sdk/dotnet/Eks/Cluster.cs

https://github.com/pulumi/pulumi-eks

pulumi-eks eks package 目前僅在 TypeScript 可用。 計划在今年晚些時候將其引入所有語言,但目前您基本上有兩種選擇:

  1. 使用 TypeScript。 如果需要,將您的整個部署分解為多個堆棧。 定義 EKS package 的堆棧將在 TypeScript 中,而其他堆棧可以在 C# 中。

  2. 請參閱您在上面鏈接的pulumi-eks實現並將該代碼手動傳輸到 C#。 這是一項不平凡的工作,所以要小心可行性估計。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM