Skip to content

Commit

Permalink
feat: add initial namespaces for argo/fluentbit
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Oct 19, 2023
1 parent 0fe9d91 commit c53b699
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions config/eks/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit c53b699

Please sign in to comment.