|
1 | 1 | --- |
2 | | -title: Troubleshooting Guide:Deployment Safeguards in Azure Kubernetes (AKS) |
| 2 | +title: Troubleshooting Guide: Deployment Safeguards in Azure Kubernetes (AKS) |
3 | 3 | description: Provides a solution to issues related to deployment safeguards in Azure Kubernetes Service (AKS). |
4 | 4 | ms.date: 07/15/2025 |
5 | 5 | ms.reviewer: v-liuamson |
6 | 6 | ms.service: azure-kubernetes-service |
7 | 7 | ms.custom: sap:Extensions, Policies and Add-Ons |
8 | 8 | --- |
9 | 9 |
|
10 | | -# Troubleshooting Guide: Deployment Safeguards in Azure Kubernetes Service (AKS) |
| 10 | +# Troubleshooting guide: Deployment Safeguards in Azure Kubernetes Service (AKS) |
11 | 11 |
|
12 | | -## Overview |
| 12 | +Deployment Safeguards in Azure Kubernetes Service (AKS) help enforce Kubernetes best practices by using Azure Policy and Gatekeeper. While they offer valuable protection, a misconfiguration or misunderstanding of their behavior can cause blocked or mutated workloads. This guide helps you troubleshoot common issues when you use Deployment Safeguards in **Warn** or **Enforce** mode. |
13 | 13 |
|
14 | | -Deployment Safeguards in Azure Kubernetes Service (AKS) help enforce Kubernetes best practices using Azure Policy and Gatekeeper. While they offer valuable protection, |
15 | | -misconfiguration or misunderstanding of their behavior can lead to |
16 | | -blocked or mutated workloads. This guide helps troubleshoot common |
17 | | -issues when using Deployment Safeguards in **Warn** or **Enforce** mode. |
| 14 | +## Frequently asked questions |
18 | 15 |
|
19 | | -### 1. Safeguards Not Taking Effect |
| 16 | +### Why aren't Deployment Safeguards taking effect? |
20 | 17 |
|
21 | 18 | **Symptoms:** |
22 | 19 |
|
23 | | -- You deployed noncompliant resources but saw no warnings or |
24 | | - enforcement. |
| 20 | +- You deploy noncompliant resources, but you see no warnings or signs of enforcement. |
25 | 21 |
|
26 | | -- The Azure Policy dashboard shows **Not started** or empty compliance |
27 | | - status. |
| 22 | +- The Azure Policy dashboard shows a **Not started** value or an empty compliance status. |
28 | 23 |
|
29 | | -**Recommended Actions:** |
| 24 | +**Recommended actions:** |
30 | 25 |
|
31 | | -- Verify Azure Policy add-on is enabled on the cluster: |
| 26 | +- Verify that the Azure Policy add-on is enabled on the cluster: |
32 | 27 |
|
33 | 28 | ``` bash |
34 | 29 | az aks show \--resource-group \<rg-name\> \--name \<cluster-name\> |
35 | 30 | \--query addonProfiles.azurepolicy |
36 | 31 | ``` |
37 | 32 |
|
38 | | -- Check if the namespace is excluded: |
| 33 | +- Check whether the namespace is excluded: |
39 | 34 |
|
40 | 35 | ``` bash |
41 | 36 | az aks safeguards show \--resource-group \<rg-name\> \--name |
42 | 37 | \<cluster-name\> |
43 | 38 | ``` |
44 | 39 |
|
45 | | -### 2. Disable Deployment Safeguards |
| 40 | +### How can I disable Deployment Safeguards? |
46 | 41 |
|
47 | | -To disable deployment safeguards entirely, you may use the following command: |
| 42 | +To disable deployment safeguards entirely, run the following command: |
48 | 43 |
|
49 | 44 | ```bash |
50 | 45 | az aks safeguards delete \--resource-group \<rg-name\> \--name |
51 | 46 | \<cluster-name\> |
52 | 47 | ``` |
53 | 48 |
|
54 | | -### 3. Why was I able to turn on Deployment Safeguards without Azure Policy permissions? |
| 49 | +### Why can I turn on Deployment Safeguards without Azure Policy permissions? |
55 | 50 |
|
56 | | -Deployment Safeguards uses Azure Policy as an implementation detail. To |
57 | | -turn on Deployment Safeguards on an AKS cluster, you do not need the |
| 51 | +Deployment Safeguards uses Azure Policy as an implementation detail. To turn on Deployment Safeguards on an AKS cluster, you do not have to have the |
58 | 52 | correct permissions to assign or delete Azure Policies. |
59 | 53 |
|
60 | | -### 4. Why did my deployment resource get admitted even though it wasn\'t following best practices? |
| 54 | +## 4. Why does my deployment resource get admitted even though it doesn\'t follow best practices? |
61 | 55 |
|
62 | | -Deployment safeguards enforce best practice standards through Azure |
63 | | -Policy controls and has policies that validate against Kubernetes |
64 | | -resources. To evaluate and enforce cluster components, Azure Policy |
65 | | -extends [Gatekeeper](https://open-policy-agent.github.io/gatekeeper/website/). |
66 | | -Gatekeeper enforcement also currently operates in |
67 | | -a [fail-open model](https://open-policy-agent.github.io/gatekeeper/website/docs/failing-closed/#considerations). |
68 | | -As there\'s no guarantee that Gatekeeper will respond to our networking |
69 | | -call, we make sure that in that case, the validation is skipped so that |
70 | | -the deny doesn\'t block your deployments. |
| 56 | +Deployment safeguards enforce best practice standards through Azure Policy controls. It has policies that validate against Kubernetes resources. To evaluate and enforce cluster components, Azure Policy extends [Gatekeeper](https://open-policy-agent.github.io/gatekeeper/website/). Gatekeeper enforcement also currently operates in a [fail-open model](https://open-policy-agent.github.io/gatekeeper/website/docs/failing-closed/#considerations). Because there are no guarantee that Gatekeeper will respond to our networking call, we make sure that, in this case, the validation is skipped so that the denial doesn't block your deployments. |
71 | 57 |
|
72 | | -## Additional Tips |
| 58 | +## Additional tips |
73 | 59 |
|
74 | | -- All safeguard policies are bundled - they cannot be individually |
75 | | - toggled. |
| 60 | +- All safeguard policies are bundled. They cannot be individually toggled. |
76 | 61 |
|
77 | 62 | - Use the [AKS GitHub repo](https://github.com/Azure/AKS/issues) to request new safeguard features. |
78 | 63 |
|
79 | 64 | ## Contact us for help |
80 | 65 |
|
81 | | -If you have questions or need help, [create a support request](https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview?DMC=troubleshoot), |
82 | | -or ask [Azure community support](https://learn.microsoft.com/answers/products/azure?product=all). You can also submit product feedback to [Azure feedback community](https://feedback.azure.com/d365community). |
| 66 | +If you have questions or need help, [create a support request](https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview?DMC=troubleshoot), or ask [Azure community support](https://learn.microsoft.com/answers/products/azure?product=all). You can also submit product feedback to [Azure feedback community](https://feedback.azure.com/d365community). |
0 commit comments