-
Notifications
You must be signed in to change notification settings - Fork 110
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
AWS CloudWatch Agent failing on OCP 4.6 cluster #75
Comments
Is this same as #74 ? |
Copied from #74 (comment) The error is because the agent is trying to reach ec2 metadata service to get the cluster name , I am not sure if it is enabled when using OpenShift (I suppose that's the OCP you are referring to). Sometimes the ec2 metadata endpoint is not there when the vm first starts so the agent will restart 1~2 times to be able to reach it. If you have access to the vm directly, you can check the endpoint directly using the following command from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html It's a link local address so it should fine for both the vm and container if the CNI is using AWS VPC. TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/ Another way is set the env Even if ec2 metadata is working, because you are not using cluster created be eks managed node group/eksctl. You need to set the cluster name directly because the cluster name detection is based on ec2 instance tags, which may not be the case for OpenShift. apiVersion: v1
kind: ConfigMap
metadata:
name: cwagentconfig
namespace: amazon-cloudwatch
data:
# Configuration is in Json format. No matter what configure change you make,
# please keep the Json blob valid.
cwagentconfig.json: |
{
"agent": {
"debug": true,
"region": "us-west-1"
},
"logs": {
"metrics_collected": {
"kubernetes": {
"cluster_name": "eks-containerd-bottlerocket",
"metrics_collection_interval": 60
}
},
"force_flush_interval": 5
}
} |
I am trying to set up aws CloudWatch Agent to Collect ocp 4.6 Cluster Metrics using this link https://docs.amazonaws.cn/en_us/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-metrics.html
but the pods are failing with following errors:
The text was updated successfully, but these errors were encountered: