Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fargate New cluster #93

Merged
merged 35 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
171444a
Adding fargate compatibility and new patterns
Howlla Aug 15, 2023
c45b41a
create new type to limit parameter into builder
Howlla Aug 15, 2023
309475d
Merge branch 'aws-observability:main' into main
Howlla Aug 15, 2023
da3e785
Prepare for pr
Howlla Aug 22, 2023
ecbae71
remove parameter computeType for existing clusters
Howlla Aug 22, 2023
076b498
lint fix
Howlla Aug 22, 2023
cdce95a
remove existing aws fargate code
Howlla Aug 22, 2023
a96a1aa
lint fix
Howlla Aug 22, 2023
b4ab8dd
Merge branch 'aws-observability:main' into main
Howlla Aug 24, 2023
244b64d
Added documentation and reset observability builder code
Howlla Aug 25, 2023
65a89e4
Correct addons for fargate and add namespace for opentelemetry
Howlla Aug 28, 2023
aa6f252
Merge branch 'aws-observability:main' into main
Howlla Aug 28, 2023
e86be21
Merge remote-tracking branch 'upstream/main'
Howlla Aug 29, 2023
e11a7e9
Merge branch 'aws-observability:main' into main
Howlla Sep 11, 2023
37f068d
Explicitly define addons for fargate pattern
Howlla Sep 11, 2023
ba4451c
pass coredns props
Howlla Sep 11, 2023
f7d30fc
Tested with updated observability builder props PR
Howlla Sep 15, 2023
5258401
Tested with updated observability builder props PR
Howlla Sep 15, 2023
dfff787
Merge branch 'aws-observability:main' into main
Howlla Sep 22, 2023
2fcb561
Merge branch 'aws-observability:main' into main
Howlla Sep 29, 2023
144186e
Merge branch 'aws-observability:main' into main
Howlla Oct 7, 2023
c368a73
update version and minor props fix for addons
Howlla Oct 7, 2023
1fd56ca
kubeproxy auto instead of explicit
Howlla Oct 7, 2023
633850b
Merge branch 'main' into main
Howlla Oct 8, 2023
8290fc2
updated docs
Howlla Oct 8, 2023
edc2f92
Merge branch 'main' of https://github.com/Howlla/cdk-aws-observabilit…
Howlla Oct 8, 2023
545fa3b
Merge branch 'aws-observability:main' into main
Howlla Oct 9, 2023
dcbddd7
update image location
Howlla Oct 9, 2023
701ca57
auto coredns version
Howlla Oct 9, 2023
cad2ca6
Merge branch 'aws-observability:main' into main
Howlla Oct 12, 2023
460b6f7
fargate holly monitoring
Howlla Oct 16, 2023
502acce
updated docs
Howlla Oct 16, 2023
9af21ca
added deployment steps in docs
Howlla Oct 16, 2023
b778c8c
clean delete except coredns
Howlla Oct 17, 2023
46b3cd0
Cat command for manifest
Howlla Oct 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/single-new-eks-awsnative-fargate-observability.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import SingleNewEksAWSNativeFargateobservabilityConstruct from '../lib/single-new-eks-awsnative-fargate-observability-construct';
import { configureApp } from '../lib/common/construct-utils';

const app = configureApp();

new SingleNewEksAWSNativeFargateobservabilityConstruct(app, 'single-new-eks-awsnative-fargate');
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Single New EKS Fargate Cluster AWS Native Observability Accelerator
Howlla marked this conversation as resolved.
Show resolved Hide resolved

## Architecture
Howlla marked this conversation as resolved.
Show resolved Hide resolved

The following figure illustrates the architecture of the pattern we will be deploying for Single EKS Fargate Cluster Native Observability pattern using AWS native tools such as CloudWatch Logs and Container Insights.

![Architecture](../images/cloud-native-arch.png)
9 changes: 7 additions & 2 deletions lib/common/observability-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ import * as utils from '@aws-quickstart/eks-blueprints/dist/utils';
import { NestedStack, NestedStackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';

type ComputeType = "ec2" | "fargate";
Howlla marked this conversation as resolved.
Show resolved Hide resolved

export class ObservabilityBuilder extends blueprints.BlueprintBuilder {

public addNewClusterObservabilityBuilderAddOns(): ObservabilityBuilder {
public addNewClusterObservabilityBuilderAddOns(computeType: ComputeType = "ec2"): ObservabilityBuilder {
return this.addOns(
new blueprints.addons.VpcCniAddOn(),
new blueprints.addons.CoreDnsAddOn(),
new blueprints.addons.CoreDnsAddOn({
version:"v1.9.3-eksbuild.5",
configurationValues:{ computeType: computeType }
}),
new blueprints.addons.MetricsServerAddOn(),
new blueprints.addons.PrometheusNodeExporterAddOn(),
new blueprints.addons.KubeStateMetricsAddOn());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { Construct } from 'constructs';
Howlla marked this conversation as resolved.
Show resolved Hide resolved
import * as blueprints from '@aws-quickstart/eks-blueprints';
import { ObservabilityBuilder } from '../common/observability-builder';
import * as eks from 'aws-cdk-lib/aws-eks';


export default class SingleNewEksClusterAWSNativeobservabilityConstruct {
constructor(scope: Construct, id: string) {
// AddOns for the cluster
const stackId = `${id}-observability-accelerator`;

const account = process.env.COA_ACCOUNT_ID! || process.env.CDK_DEFAULT_ACCOUNT!;
const region = process.env.COA_AWS_REGION! || process.env.CDK_DEFAULT_REGION!;

const addOns: Array<blueprints.ClusterAddOn> = [
new blueprints.addons.KubeProxyAddOn(),
new blueprints.addons.AwsLoadBalancerControllerAddOn(),
new blueprints.addons.CertManagerAddOn({
installCRDs:true,
createNamespace:true,
Howlla marked this conversation as resolved.
Show resolved Hide resolved
values:{webhook: {securePort: 10260}}
}),
new blueprints.addons.CloudWatchLogsAddon({
logGroupPrefix: `/aws/eks/${stackId}`,
logRetentionDays: 30
}),
new blueprints.addons.ContainerInsightsAddOn(),

];

// Create Fargate profile, you can add selectors to match which pods to schedule on fargate, we will use 'default' i.e., all pods
Howlla marked this conversation as resolved.
Show resolved Hide resolved
const fargateProfiles: Map<string, eks.FargateProfileOptions> = new Map([
["MyProfile", { selectors: [{ namespace: "myNamespace" }] }]
]);

// Define fargate cluster provider and pass the profile options
const fargateClusterProvider : blueprints.FargateClusterProvider = new blueprints.FargateClusterProvider({
fargateProfiles,
version: eks.KubernetesVersion.of("1.27")
});


ObservabilityBuilder.builder()
.account(account)
.region(region)
.addNewClusterObservabilityBuilderAddOns("fargate")
.clusterProvider(fargateClusterProvider)
.addOns(...addOns)
.build(scope, stackId);
}
}