[aws-eks] Container Insights support for EKS
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
Nice!
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
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 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? 😃
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:
- The helm charts for Container Insights (or at least a basic one where we can help improve it)
- The prometheus integration has been promoted to production ready state
- 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
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.
Hi @rameshmimit - It is currently not planned for any upcoming release. Contributions are more than welcome though :)
Hi, Is there any way to add container insights for Amazon EKS using AWS CDK?
@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.
you can find an example here : https://github.com/aws-quickstart/quickstart-ssp-amazon-eks/blob/main/lib/addons/container-insights/index.ts