generated from mspnp/aks-baseline
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (deploy): [cluster] enable networking observability (basic) (#101)
* allow fw for ama-metrics to connnect to azure monitor * add managed prometheus * enable azure monitor agent metrics * add prometheus custom config for networking * allow resource types for networking observabilty
- Loading branch information
1 parent
6599b9e
commit ab4912c
Showing
7 changed files
with
276 additions
and
2 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
cluster-manifests/kube-system/ama-metrics-prometheus-config-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# https://raw.githubusercontent.com/Azure/prometheus-collector/refs/heads/main/otelcollector/configmaps/ama-metrics-prometheus-config-configmap.yaml | ||
# This config map can be used to provide Prometheus scrape config for addon replica. Addon runs a singleton replica, and any cluster level services can be discovered and scraped by providing scrape jobs in this configmap. | ||
# https://learn.microsoft.com/azure/virtual-network/kubernetes-network-policies#set-up-for-prometheus-server | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
data: | ||
prometheus-config: |- | ||
global: | ||
scrape_interval: 30s | ||
scrape_configs: | ||
- job_name: "azure-npm-node-metrics" | ||
metrics_path: /node-metrics | ||
kubernetes_sd_configs: | ||
- role: node | ||
relabel_configs: | ||
- source_labels: [__address__] | ||
action: replace | ||
regex: ([^:]+)(?::\d+)? | ||
replacement: "$1:10091" | ||
target_label: __address__ | ||
- job_name: "azure-npm-cluster-metrics" | ||
metrics_path: /cluster-metrics | ||
kubernetes_sd_configs: | ||
- role: service | ||
relabel_configs: | ||
- source_labels: [__meta_kubernetes_namespace] | ||
regex: kube-system | ||
action: keep | ||
- source_labels: [__meta_kubernetes_service_name] | ||
regex: npm-metrics-cluster-service | ||
action: keep | ||
# Comment from here to the end to collect advanced metrics: number of entries for each IPSet | ||
metric_relabel_configs: | ||
- source_labels: [__name__] | ||
regex: npm_ipset_counts | ||
action: drop | ||
metadata: | ||
# ama-metrics-prometheus-config (Recommended) - When a configmap with this name is created, scrape jobs defined in it are run from the Azure monitor metrics replica pod running in the cluster. | ||
name: ama-metrics-prometheus-config | ||
namespace: kube-system |
30 changes: 30 additions & 0 deletions
30
cluster-manifests/kube-system/ama-metrics-prometheus-config-node-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# https://raw.githubusercontent.com/Azure/prometheus-collector/refs/heads/main/otelcollector/configmaps/ama-metrics-prometheus-config-node-configmap.yaml | ||
# This config map can be used to provide Prometheus scrape config for addon DaemonSet that runs on every Linux node in the cluster, and any node level targets on each node can be scraped by providing scrape jobs in this configmap. | ||
# https://learn.microsoft.com/azure/virtual-network/kubernetes-network-policies#set-up-for-prometheus-server | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
data: | ||
prometheus-config: |- | ||
global: | ||
scrape_interval: 30s | ||
scrape_configs: | ||
- job_name: "azure-npm-node-metrics-from-pod-config" | ||
metrics_path: /node-metrics | ||
kubernetes_sd_configs: | ||
- role: pod | ||
relabel_configs: | ||
- source_labels: [__meta_kubernetes_namespace] | ||
regex: kube-system | ||
action: keep | ||
- source_labels: [__name__] | ||
action: keep | ||
regex: '(__meta_kubernetes_pod_annotationpresent_azure.*)' | ||
- source_labels: [__address__] | ||
action: replace | ||
regex: ([^:]+)(?::\d+)? | ||
replacement: "$1:10091" | ||
target_label: __address__ | ||
metadata: | ||
# ama-metrics-prometheus-config-node - When a configmap with this name is created, scrape jobs defined in it are run from each Linux DaemonSet pod running in the cluster. | ||
name: ama-metrics-prometheus-config-node | ||
namespace: kube-system |
89 changes: 89 additions & 0 deletions
89
cluster-manifests/kube-system/ama-metrics-settings-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# https://raw.githubusercontent.com/Azure/prometheus-collector/refs/heads/main/otelcollector/configmaps/ama-metrics-settings-configmap.yaml | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
data: | ||
schema-version: | ||
#string.used by agent to parse config. supported versions are {v1}. Configs with other schema versions will be rejected by the agent. | ||
v1 | ||
config-version: | ||
#string.used by customer to keep track of this config file's version in their source control/repository (max allowed 10 chars, other chars will be truncated) | ||
ver1 | ||
# Cluster alias (to change the value of cluster label in every time-series/metric that's ingested from a cluster) | ||
# https://learn.microsoft.com/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig%2CConfigFileScrapeConfigBasicAuth%2CConfigFileScrapeConfigTLSAuth#cluster-alias | ||
prometheus-collector-settings: |- | ||
cluster_alias = "" | ||
# Enable/disable default scrape targets - Turn ON/OFF default scraping based on targets. Scrape configuration for these default targets are already pre-defined/built-in | ||
# https://learn.microsoft.com/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig%2CConfigFileScrapeConfigBasicAuth%2CConfigFileScrapeConfigTLSAuth#metrics-add-on-settings-configmap | ||
default-scrape-settings-enabled: |- | ||
kubelet = true | ||
coredns = false | ||
cadvisor = true | ||
kubeproxy = false | ||
apiserver = false | ||
kubestate = true | ||
nodeexporter = true | ||
windowsexporter = false | ||
windowskubeproxy = false | ||
kappiebasic = true | ||
networkobservabilityRetina = true | ||
networkobservabilityHubble = false | ||
networkobservabilityCilium = false | ||
prometheuscollectorhealth = false | ||
controlplane-apiserver = true | ||
controlplane-cluster-autoscaler = false | ||
controlplane-kube-scheduler = false | ||
controlplane-kube-controller-manager = false | ||
controlplane-etcd = true | ||
# Regex for which namespaces to scrape through pod annotation based scraping. | ||
# This is none by default. Use '.*' to scrape all namespaces of annotated pods. | ||
# https://learn.microsoft.com/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig%2CConfigFileScrapeConfigBasicAuth%2CConfigFileScrapeConfigTLSAuth#enable-pod-annotation-based-scraping | ||
pod-annotation-based-scraping: |- | ||
podannotationnamespaceregex = "kube-system|a0008" | ||
# Metric keep-lists - this setting is used to control which metrics are listed to be allowed from each default target and to change the default behavior | ||
# https://learn.microsoft.com/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig%2CConfigFileScrapeConfigBasicAuth%2CConfigFileScrapeConfigTLSAuth#customize-metrics-collected-by-default-targets | ||
default-targets-metrics-keep-list: |- | ||
kubelet = "" | ||
coredns = "" | ||
cadvisor = "" | ||
kubeproxy = "" | ||
apiserver = "" | ||
kubestate = "" | ||
nodeexporter = "" | ||
windowsexporter = "" | ||
windowskubeproxy = "" | ||
podannotations = "" | ||
kappiebasic = "" | ||
networkobservabilityRetina = "" # networkobservability_forward_count|networkobservability_forward_bytes|networkobservability_drop_count|networkobservability_drop_bytes|networkobservability_tcp_state|networkobservability_tcp_connection_remote|networkobservability_tcp_connection_stats|networkobservability_ip_connection_stats|networkobservability_udp_connection_stats|networkobservability_udp_active_sockets|networkobservability_interface_stats | ||
networkobservabilityHubble = "" | ||
networkobservabilityCilium = "" | ||
controlplane-apiserver = "" | ||
controlplane-cluster-autoscaler = "" | ||
controlplane-kube-scheduler = "" | ||
controlplane-kube-controller-manager = "" | ||
controlplane-etcd = "" | ||
minimalingestionprofile = true | ||
# The scrape intervals for default/pre-definetargets. 30 secs is the default scrape frequency and it can be changed per default target using this configmap | ||
# https://learn.microsoft.com/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig%2CConfigFileScrapeConfigBasicAuth%2CConfigFileScrapeConfigTLSAuth#scrape-interval-settings | ||
default-targets-scrape-interval-settings: |- | ||
kubelet = "30s" | ||
coredns = "30s" | ||
cadvisor = "30s" | ||
kubeproxy = "30s" | ||
apiserver = "30s" | ||
kubestate = "30s" | ||
nodeexporter = "30s" | ||
windowsexporter = "30s" | ||
windowskubeproxy = "30s" | ||
kappiebasic = "30s" | ||
networkobservabilityRetina = "30s" | ||
networkobservabilityHubble = "30s" | ||
networkobservabilityCilium = "30s" | ||
prometheuscollectorhealth = "30s" | ||
podannotations = "30s" | ||
# debug-mode - turning this ON helps to debug missing metric/ingestion issues | ||
# https://learn.microsoft.com/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig%2CConfigFileScrapeConfigBasicAuth%2CConfigFileScrapeConfigTLSAuth#debug-mode | ||
debug-mode: |- | ||
enabled = false | ||
metadata: | ||
name: ama-metrics-settings-configmap | ||
namespace: kube-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters