amazon-vpc-cni-k8s icon indicating copy to clipboard operation
amazon-vpc-cni-k8s copied to clipboard

improvement: add podmonitor for vpc metric collection

Open aburan28 opened this issue 1 year ago • 0 comments
trafficstars

What type of PR is this?

Which issue does this PR fix?:

There exists no way to collect metrics from the nodeagent at this time as there is no port opened up.

What does this PR do / Why do we need it?: This adds a PodMonitor template in order to faciliatate automated prometheus metrics collection of the VPC CNI and EKS node agent. Additionally this PR adds a port to the eks node agent in order to allow for prometheus metrics to be collected.

Testing done on this change:

Run helm template locally to generate the rendered templates

---
# Source: aws-vpc-cni/templates/podmonitor.yaml
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: aws-node
  namespace: default
  labels:
spec:
  jobLabel: aws-node
  namespaceSelector:
    matchNames:
      - default
  podMetricsEndpoints:
  - interval: 30s
    path: /metrics
    port: metrics
  - interval: 30s
    path: /metrics
    port: agentmetrics
  selector:
    matchLabels:
      k8s-app: aws-node
---
....
       - name: aws-eks-nodeagent
          image: 602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-network-policy-agent:v1.1.2
          imagePullPolicy: Always
          ports:
            - containerPort: 8162
              name: agentmetrics

Will this PR introduce any new dependencies?: no Will this break upgrades or downgrades? Has updating a running cluster been tested?: no

Does this change require updates to the CNI daemonset config files to work?:

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

aburan28 avatar Oct 04 '24 19:10 aburan28