setup()

in lib/teams/team-troi/index.ts [10:29]


    setup(clusterInfo: ClusterInfo) {
        const cluster = clusterInfo.cluster;
        const stack = cluster.stack;
        const namespace = cluster.addManifest(this.name, {
            apiVersion: 'v1',
            kind: 'Namespace',
            metadata: {
                name: this.name,
                annotations: { "argocd.argoproj.io/sync-wave": "-1" }
            }
        });

        this.setupNamespacePolicies(cluster);

        const sa = cluster.addServiceAccount('inf-backend', { name: 'inf-backend', namespace: this.name });
        sa.node.addDependency(namespace);
        const bucket = new s3.Bucket(stack, 'inf-backend-bucket');
        bucket.grantReadWrite(sa);
        new cdk.CfnOutput(stack, this.name + '-sa-iam-role', { value: sa.role.roleArn })
    }