You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-network/kubernetes-network-policies.md
+27-26Lines changed: 27 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ Azure Network Policy Management implementation works with the Azure CNI that pro
21
21
When implementing security for your cluster, use network security groups (NSGs) to filter traffic entering and leaving your cluster subnet (North-South traffic). Use Azure Network Policy Manager for traffic between pods in your cluster (East-West traffic).
22
22
23
23
## Using Azure Network Policy Manager
24
+
24
25
Azure Network Policy Manager can be used in the following ways to provide micro-segmentation for pods.
25
26
26
27
### Azure Kubernetes Service (AKS)
@@ -49,7 +50,7 @@ For Windows:
49
50
50
51
The solution is also open source and the code is available on the [Azure Container Networking repository](https://github.com/Azure/azure-container-networking/tree/master/Network Policy Manager).
51
52
52
-
## Monitor and visualize network configurations with Azure Network Policy Manager
53
+
## Monitor and visualize network configurations with Azure NPM
53
54
54
55
Azure Network Policy Manager includes informative Prometheus metrics that allow you to monitor and better understand your configurations. It provides built-in visualizations in either the Azure portal or Grafana Labs. You can start collecting these metrics using either Azure Monitor or a Prometheus server.
55
56
@@ -81,25 +82,25 @@ See a [configuration for these alerts](#set-up-alerts-for-alertmanager) as follo
81
82
82
83
2. Correlate cluster counts (for example, ACLs) to execution times.
83
84
84
-
3. Get the human-friendly name of an ipset in a given IPTables rule (for example, `azure-Network Policy Manager-487392` represents `podlabel-role:database`).
85
+
3. Get the human-friendly name of an ipset in a given IPTables rule (for example, `azure-npm-487392` represents `podlabel-role:database`).
85
86
86
87
### All supported metrics
87
88
88
89
The following list is of supported metrics. Any `quantile` label has possible values `0.5`, `0.9`, and `0.99`. Any `had_error` label has possible values `false` and `true`, representing whether the operation succeeded or failed.
89
90
90
91
| Metric Name | Description | Prometheus Metric Type | Labels |
91
92
| ----- | ----- | ----- | ----- |
92
-
|`Network Policy Manager_num_policies`| number of network policies | Gauge | - |
93
-
|`Network Policy Manager_num_iptables_rules`| number of IPTables rules | Gauge | - |
94
-
|`Network Policy Manager_num_ipsets`| number of IPSets | Gauge | - |
95
-
|`Network Policy Manager_num_ipset_entries`| number of IP address entries in all IPSets | Gauge | - |
96
-
|`Network Policy Manager_add_iptables_rule_exec_time`| runtime for adding an IPTables rule | Summary |`quantile`|
97
-
|`Network Policy Manager_add_ipset_exec_time`| runtime for adding an IPSet | Summary |`quantile`|
98
-
|`Network Policy Manager_ipset_counts` (advanced) | number of entries within each individual IPSet | GaugeVec |`set_name` & `set_hash`|
99
-
|`Network Policy Manager_add_policy_exec_time`| runtime for adding a network policy | Summary |`quantile` & `had_error`|
100
-
|`Network Policy Manager_controller_policy_exec_time`| runtime for updating/deleting a network policy | Summary |`quantile` & `had_error` & `operation` (with values `update` or `delete`) |
101
-
|`Network Policy Manager_controller_namespace_exec_time`| runtime for creating/updating/deleting a namespace | Summary |`quantile` & `had_error` & `operation` (with values `create`, `update`, or `delete`) |
102
-
|`Network Policy Manager_controller_pod_exec_time`| runtime for creating/updating/deleting a pod | Summary |`quantile` & `had_error` & `operation` (with values `create`, `update`, or `delete`) |
93
+
|`npm_num_policies`| number of network policies | Gauge | - |
94
+
|`npm_num_iptables_rules`| number of IPTables rules | Gauge | - |
95
+
|`npm_num_ipsets`| number of IPSets | Gauge | - |
96
+
|`npm_num_ipset_entries`| number of IP address entries in all IPSets | Gauge | - |
97
+
|`npm_add_iptables_rule_exec_time`| runtime for adding an IPTables rule | Summary |`quantile`|
98
+
|`npm_add_ipset_exec_time`| runtime for adding an IPSet | Summary |`quantile`|
99
+
|`npm_ipset_counts` (advanced) | number of entries within each individual IPSet | GaugeVec |`set_name` & `set_hash`|
100
+
|`npm_add_policy_exec_time`| runtime for adding a network policy | Summary |`quantile` & `had_error`|
101
+
|`npm_controller_policy_exec_time`| runtime for updating/deleting a network policy | Summary |`quantile` & `had_error` & `operation` (with values `update` or `delete`) |
102
+
|`npm_controller_namespace_exec_time`| runtime for creating/updating/deleting a namespace | Summary |`quantile` & `had_error` & `operation` (with values `create`, `update`, or `delete`) |
103
+
|`npm_controller_pod_exec_time`| runtime for creating/updating/deleting a pod | Summary |`quantile` & `had_error` & `operation` (with values `create`, `update`, or `delete`) |
103
104
104
105
There are also "exec_time_count" and "exec_time_sum" metrics for each "exec_time" Summary metric.
105
106
@@ -142,7 +143,7 @@ Besides viewing the workbook, you can also directly query the Prometheus metrics
142
143
143
144
```query
144
145
| where TimeGenerated > ago(5h)
145
-
| where Name contains "Network Policy Manager_"
146
+
| where Name contains "npm_"
146
147
```
147
148
148
149
You can also query log analytics directly for the metrics. Learn more about it with [Getting Started with Log Analytics Queries](../azure-monitor/containers/container-insights-log-query.md)
# Comment from here to the end to collect advanced metrics: number of entries for each IPSet
200
201
metric_relabel_configs:
201
202
- source_labels: [__name__]
202
-
regex: Network Policy Manager_ipset_counts
203
+
regex: npm_ipset_counts
203
204
action: drop
204
205
```
205
206
206
-
You can also replace the `azure-Network Policy Manager-node-metrics` job with the following content or incorporate it into a pre-existing job for Kubernetes pods:
207
+
You can also replace the `azure-npm-node-metrics` job with the following content or incorporate it into a pre-existing job for Kubernetes pods:
0 commit comments