Skip to content

Commit

Permalink
Added new scraping jobs for KSH and KCM metrics (#1103)
Browse files Browse the repository at this point in the history
* Added new scraping jobs for KSH and KCM metrics

* Fixing the test errors
  • Loading branch information
ashoksrirama authored Nov 15, 2024
1 parent 1692a0f commit fe93c35
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 5 deletions.
41 changes: 41 additions & 0 deletions lib/addons/amp/collector-config-amp-daemonset.ytpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,40 @@ spec:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true

- job_name: ksh-metrics
scheme: https
metrics_path: /apis/metrics.eks.amazonaws.com/v1/ksh/container/metrics
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
action: keep
regex: default;kubernetes;https

- job_name: kcm-metrics
scheme: https
metrics_path: /apis/metrics.eks.amazonaws.com/v1/kcm/container/metrics
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
action: keep
regex: default;kubernetes;https

- job_name: kubernetes-nodes
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
Expand Down Expand Up @@ -348,6 +382,13 @@ rules:
- get
- list
- watch
- apiGroups:
- metrics.eks.amazonaws.com
resources:
- kcm/metrics
- ksh/metrics
verbs:
- get
- nonResourceURLs:
- /metrics
verbs:
Expand Down
39 changes: 39 additions & 0 deletions lib/addons/amp/collector-config-amp.ytpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,38 @@ spec:
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
- job_name: ksh-metrics
scheme: https
metrics_path: /apis/metrics.eks.amazonaws.com/v1/ksh/container/metrics
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
action: keep
regex: default;kubernetes;https
- job_name: kcm-metrics
scheme: https
metrics_path: /apis/metrics.eks.amazonaws.com/v1/kcm/container/metrics
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
action: keep
regex: default;kubernetes;https
- job_name: kubernetes-nodes
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
Expand Down Expand Up @@ -1934,6 +1966,13 @@ rules:
- get
- list
- watch
- apiGroups:
- metrics.eks.amazonaws.com
resources:
- kcm/metrics
- ksh/metrics
verbs:
- get
- nonResourceURLs:
- /metrics
verbs:
Expand Down
10 changes: 5 additions & 5 deletions lib/addons/cloud-watch-insights/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import {KubernetesVersion} from "aws-cdk-lib/aws-eks";
// aws eks describe-addon-versions --kubernetes-version <kubernetes-version> --addon-name amazon-cloudwatch-observability \
// --query 'addons[].addonVersions[].{Version: addonVersion, Defaultversion: compatibilities[0].defaultVersion}' --output table
const versionMap: Map<KubernetesVersion, string> = new Map([
[KubernetesVersion.V1_31, "v2.1.3-eksbuild.1"],
[KubernetesVersion.V1_30, "v2.1.3-eksbuild.1"],
[KubernetesVersion.V1_29, "v2.1.3-eksbuild.1"],
[KubernetesVersion.V1_28, "v2.1.3-eksbuild.1"],
[KubernetesVersion.V1_27, "v2.1.3-eksbuild.1"]
[KubernetesVersion.V1_31, "v2.3.0-eksbuild.1"],
[KubernetesVersion.V1_30, "v2.3.0-eksbuild.1"],
[KubernetesVersion.V1_29, "v2.3.0-eksbuild.1"],
[KubernetesVersion.V1_28, "v2.3.0-eksbuild.1"],
[KubernetesVersion.V1_27, "v2.3.0-eksbuild.1"]
]);


Expand Down
41 changes: 41 additions & 0 deletions lib/addons/cloudwatch-adot-addon/collector-config-cloudwatch.ytpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,40 @@ spec:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true

- job_name: ksh-metrics
scheme: https
metrics_path: /apis/metrics.eks.amazonaws.com/v1/ksh/container/metrics
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
action: keep
regex: default;kubernetes;https

- job_name: kcm-metrics
scheme: https
metrics_path: /apis/metrics.eks.amazonaws.com/v1/kcm/container/metrics
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_service_name
- __meta_kubernetes_endpoint_port_name
action: keep
regex: default;kubernetes;https

- job_name: kubernetes-nodes
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
Expand Down Expand Up @@ -409,6 +443,13 @@ rules:
- get
- list
- watch
- apiGroups:
- metrics.eks.amazonaws.com
resources:
- kcm/metrics
- ksh/metrics
verbs:
- get
- nonResourceURLs:
- /metrics
verbs:
Expand Down

0 comments on commit fe93c35

Please sign in to comment.