diff --git a/config/eks/cluster.ts b/config/eks/cluster.ts index 8c9c0251d..b5294b39f 100644 --- a/config/eks/cluster.ts +++ b/config/eks/cluster.ts @@ -68,5 +68,34 @@ export class LinzEksCluster extends Stack { // Grant the AWS Admin user ability to view the cluster const accountAdminRole = Role.fromRoleName(this, 'AccountAdminRole', 'AccountAdminRole'); this.cluster.awsAuth.addMastersRole(accountAdminRole); + + this.configureEks(); + } + + /** + * Setup the basic interactions between EKS and some of its components + * + * This should generally be limited to things that require direct interaction with AWS eg service accounts + * or name space creation + */ + configureEks(): void { + // Use fluent bit to ship logs from eks into aws + const fluentBitNs = this.cluster.addManifest('FluentBitNamespace', { + kind: 'Namespace', + metadata: { name: 'fluent-bit' }, + }); + const fluentBitSa = this.cluster.addServiceAccount('FluentBitServiceAccount', { + name: 'fluent-bit-sa', + namespace: 'fluent-bit', + }); + fluentBitSa.node.addDependency(fluentBitNs); // Ensure the namespace created first + + // basic constructs for + const argoNs = this.cluster.addManifest('ArgoNameSpace', { kind: 'Namespace', metadata: { name: 'argo' } }); + const argoRunnerSa = this.cluster.addServiceAccount('ArgoRunnerServiceAccount', { + name: 'argo-runner-sa', + namespace: 'argo', + }); + argoNs.node.addDependency(argoRunnerSa); } }