-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
407f795
commit d3b6593
Showing
17 changed files
with
467 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: ama-metrics-settings-configmap | ||
namespace: kube-system | ||
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 | ||
prometheus-collector-settings: |- | ||
cluster_alias = "" | ||
default-scrape-settings-enabled: |- | ||
kubelet = true | ||
coredns = false | ||
cadvisor = true | ||
kubeproxy = false | ||
apiserver = false | ||
kubestate = true | ||
nodeexporter = true | ||
windowsexporter = false | ||
windowskubeproxy = false | ||
kappiebasic = true | ||
prometheuscollectorhealth = false | ||
# Regex for which namespaces to scrape through pod annotation based scraping. | ||
# This is none by default. Use '.*' to scrape all namespaces of annotated pods. | ||
pod-annotation-based-scraping: |- | ||
podannotationnamespaceregex = ".*" | ||
default-targets-metrics-keep-list: |- | ||
kubelet = "" | ||
coredns = "" | ||
cadvisor = "" | ||
kubeproxy = "" | ||
apiserver = "" | ||
kubestate = "" | ||
nodeexporter = "" | ||
windowsexporter = "" | ||
windowskubeproxy = "" | ||
podannotations = "" | ||
kappiebasic = "" | ||
minimalingestionprofile = true | ||
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" | ||
prometheuscollectorhealth = "30s" | ||
podannotations = "30s" | ||
debug-mode: |- | ||
enabled = false |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,18 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: aks-helloworld-internal | ||
namespace: webapp | ||
spec: | ||
ingressClassName: nginx-internal # webapprouting.kubernetes.azure.com | ||
rules: | ||
- host: aks.internal # hello.aks.internal | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: aks-helloworld | ||
port: | ||
number: 80 | ||
path: / | ||
pathType: Prefix |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
resource "azurerm_dashboard_grafana" "grafana" { | ||
name = "azure-grafana-${var.prefix}" | ||
resource_group_name = azurerm_resource_group.rg.name | ||
location = azurerm_resource_group.rg.location | ||
sku = "Standard" | ||
grafana_major_version = "10" | ||
zone_redundancy_enabled = false | ||
api_key_enabled = true | ||
deterministic_outbound_ip_enabled = true | ||
public_network_access_enabled = true | ||
|
||
azure_monitor_workspace_integrations { | ||
resource_id = azurerm_monitor_workspace.prometheus.id | ||
} | ||
|
||
identity { | ||
type = "SystemAssigned" | ||
} | ||
} | ||
|
||
# data "azurerm_client_config" "current" {} | ||
|
||
resource "azurerm_role_assignment" "role_grafana_admin" { | ||
scope = azurerm_dashboard_grafana.grafana.id | ||
role_definition_name = "Grafana Admin" | ||
principal_id = data.azurerm_client_config.current.object_id | ||
} | ||
|
||
resource "azurerm_role_assignment" "role_monitoring_data_reader" { | ||
scope = azurerm_monitor_workspace.prometheus.id | ||
role_definition_name = "Monitoring Data Reader" | ||
principal_id = azurerm_dashboard_grafana.grafana.identity.0.principal_id | ||
} | ||
|
||
data "azurerm_subscription" "current" {} | ||
|
||
resource "azurerm_role_assignment" "role_monitoring_reader" { | ||
scope = data.azurerm_subscription.current.id | ||
role_definition_name = "Monitoring Reader" | ||
principal_id = azurerm_dashboard_grafana.grafana.identity.0.principal_id | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "azurerm_monitor_data_collection_endpoint" "dce-prometheus" { | ||
name = "dce-prometheus" | ||
resource_group_name = azurerm_resource_group.rg.name | ||
location = azurerm_resource_group.rg.location | ||
kind = "Linux" | ||
public_network_access_enabled = true | ||
} | ||
|
||
# not required | ||
resource "azurerm_monitor_data_collection_rule_association" "dcra-dce-prometheus-aks" { | ||
# name = "configurationAccessEndpoint" # "dcra-dce-prometheus-aks" # # name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint | ||
target_resource_id = azurerm_kubernetes_cluster.aks.id | ||
data_collection_endpoint_id = azurerm_monitor_data_collection_endpoint.dce-prometheus.id | ||
} |
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,34 @@ | ||
resource "azurerm_monitor_data_collection_rule" "dcr-prometheus" { | ||
name = "dcr-prometheus" | ||
resource_group_name = azurerm_resource_group.rg.name | ||
location = azurerm_resource_group.rg.location | ||
data_collection_endpoint_id = azurerm_monitor_data_collection_endpoint.dce-prometheus.id | ||
kind = "Linux" | ||
description = "DCR for Azure Monitor Metrics Profile (Managed Prometheus)" | ||
|
||
data_sources { | ||
prometheus_forwarder { | ||
name = "PrometheusDataSource" | ||
streams = ["Microsoft-PrometheusMetrics"] | ||
} | ||
} | ||
|
||
destinations { | ||
monitor_account { | ||
monitor_account_id = azurerm_monitor_workspace.prometheus.id | ||
name = azurerm_monitor_workspace.prometheus.name | ||
} | ||
} | ||
|
||
data_flow { | ||
streams = ["Microsoft-PrometheusMetrics"] | ||
destinations = [azurerm_monitor_workspace.prometheus.name] | ||
} | ||
} | ||
|
||
resource "azurerm_monitor_data_collection_rule_association" "dcra-dcr-prometheus-aks" { | ||
name = "dcra-dcr-prometheus-aks" | ||
target_resource_id = azurerm_kubernetes_cluster.aks.id | ||
data_collection_rule_id = azurerm_monitor_data_collection_rule.dcr-prometheus.id | ||
description = "Association of DCR. Deleting this association will break the data collection for this AKS Cluster." | ||
} |
Oops, something went wrong.