Amazon-vpc-cni-k8s: cni-metrics-helper CLUSTER_ID

Created on 5 Feb 2019  路  3Comments  路  Source: aws/amazon-vpc-cni-k8s

How do modify the cni-metrics-helper CLUSTER_ID? Right now, it seems to be fixed at eks-cluster. This is also the only id mentioned in the cni-metrics-helper blog post.

This isn't very useful if I have multiple EKS clusters and wish to monitor different clusters for available ENI and IP address capacity.

All 3 comments

cni-metrics-helper-xxxx's logs output Failed to obtain cluster-id and default to eks-cluster?

e.g:

$ kubectl -n kube-system logs cni-metrics-helper-xxxx
...
           publisher.go:76] Failed to obtain cluster-id and default to eks-cluster

If yes, cni-metrics-helper is using same code with https://github.com/aws/amazon-vpc-cni-k8s/pull/88/files

You can configure CLUSTER_ID by following steps:

1. Add policy to __worker__ Node's policy like:

        {
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeTags"
            ],
            "Resource": [
                "*"
            ]
        }

2. you can modify the value of CLUSTER_ID for EC2 instance by the creating tag:

  • KEY: CLUSTER_ID
  • VALUE: (YOU CAN SET YOUR VALUE)

3. Restart cni-metrics-helper-xxxx pod:

  • Please also confirm that Failed to obtain cluster-id and default to eks-cluster error was stopped.
  $ kubectl -n kube-system delete cni-metrics-helper-xxxx
  $ kubectl -n kube-system logs cni-metrics-helper-xxxx  

Now, you should be able to see the metrics dimension which is configured by CLUSTER_ID's value instead of eks-cluster.

@nak3 Looks like you are right. I see this in the logs:
E0207 12:22:48.352171 7 publisher.go:76] Failed to obtain cluster-id and default to eks-cluster

I'll try the tags as you suggest and report back.

That worked like a charm. Thanks @nak3

I'll close this issue.

Was this page helpful?
0 / 5 - 0 ratings