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",
},
],
});
AWS EKS 中的 Kubernetes RBAC 与开源 Pulumi 包 | Pulumi https://www.pulumi.com/blog/simplify-kubernetes-rbac-in-amazon-eks-with-open-source-pulumi-packages/
我正在寻找如何使用 .NET C# 来实现这一点?看起来 eks roleMappings 扩展仅适用于 TypeScript,因此可能需要 C# 使用 Pulumi.Kubernetes 构建 configmap manifest?