aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

[aws-eks] Container Insights support for EKS

Open pahud opened this issue 5 years ago • 10 comments

Quick Start Setup for Container Insights on Amazon EKS https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-EKS-quickstart.html

Use Case

To enable the container insights support in AWS CDK for EKS cluster.

Proposed Solution

Similar to Amazon ECS, we can offercontainerInsights property for the Amazon EKS Cluster resource.

https://github.com/aws/aws-cdk/blob/7a10f0f9b9e8e4c9816a4f28335cca77a915b15f/packages/%40aws-cdk/aws-ecs/lib/cluster.ts#L49

Other

  • [x] :wave: I may be able to implement this feature request
  • [ ] :warning: This feature might incur a breaking change

This is a :rocket: Feature Request

pahud avatar Apr 03 '20 12:04 pahud

Nice!

eladb avatar Apr 04 '20 08:04 eladb

We probably need the official Helm Chart support in aws/eks-chart for container insights before we can addChart() to install this in AWS CDK as a cluster plug-in.

https://github.com/aws-samples/amazon-cloudwatch-container-insights/issues/17

pahud avatar Apr 12 '20 14:04 pahud

Please, also take into account an EKS cluster with only Fargate compute. I am saying this, because most of the solution there will only work with Daemon sets which are not supported by Fargate.

eduardomourar avatar Jun 19 '20 19:06 eduardomourar

@eduardomourar It might be possible as container insight has different deployment mode including daemonset, service and sidecar.

https://github.com/aws-samples/amazon-cloudwatch-container-insights/tree/master/k8s-deployment-manifest-templates/deployment-mode

Are you interested to dive in and probably a PR for this? 😃

pahud avatar Jun 20 '20 01:06 pahud

I would gladly dive into this, because this has been a pain point for the organization I work for. Although, I will probably wait until the following is available from the AWS side:

  1. The helm charts for Container Insights (or at least a basic one where we can help improve it)
  2. The prometheus integration has been promoted to production ready state
  3. A nice cluster-level logging solution, by either the CloudWatch agent adding support to IRSA or a way to have a sidecar injector for the Fluent Bit option

eduardomourar avatar Jun 20 '20 19:06 eduardomourar

Please let me know, if you guys have any plans to include this feature in any of the coming releases. Currently we are planning to use prometheus and grafana which is deployed using other open source config management tool. It would be really nice to have container insights constructs which will be much easier to adopt.

rameshmimit avatar Oct 07 '20 14:10 rameshmimit

Hi @rameshmimit - It is currently not planned for any upcoming release. Contributions are more than welcome though :)

iliapolo avatar Oct 08 '20 10:10 iliapolo

Hi, Is there any way to add container insights for Amazon EKS using AWS CDK?

shubhamjainy avatar May 25 '21 12:05 shubhamjainy

@shubhamjainy Yes. Container Insights requires the following components:

  • Namespace
  • Service Account (with Cluster Role and Binding)
  • ConfigMap
  • DaemonSet

You can find the definition of each component here: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-metrics.html

CDK supports creation of these components in EKS via the following methods:

  • https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-eks.Cluster.html#addwbrservicewbraccountid-options
  • https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-eks.Cluster.html#addwbrmanifestid-manifest

With addServiceAccount you can create the Service Account. With addManifest you can create the rest.

There is no Helm Chart for Container Insights as of now otherwise one could just install it using addHelmChart function of CDK.

shubham391 avatar Jun 11 '21 06:06 shubham391

you can find an example here : https://github.com/aws-quickstart/quickstart-ssp-amazon-eks/blob/main/lib/addons/container-insights/index.ts

allamand avatar Aug 06 '21 10:08 allamand