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: learn-pr/azure/aks-optimize-compute-costs/includes/3-exercise-node-pools.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
Azure Kubernetes Service allows you to create different node pools to match specific workloads to the nodes running in each node pool.
2
2
3
-
Recall from the drone-tracking example that your team developed a new predictive-modeling service that processes flight-path information in extreme weather conditions and creates optimal flight routes. This service requires GPU-based virtual-machine (VM) support and runs only on specific days during the week. The team wants to make sure no VMS are used when the service doesn't run.
3
+
Recall from the drone-tracking example that your team developed a new predictivemodeling service that processes flight-path information in extreme weather conditions and creates optimal flight routes. This service requires GPU-based virtual-machine (VM) support and runs only on specific days during the week. The team wants to make sure no VMS are used when the service doesn't run.
4
4
5
-
Here, you'll create an Azure Kubernetes Service (AKS)-managed Kubernetes cluster. Next, you'll configure the cluster to support multiple node pools and allows clusters to scale the nodes in the node pools. Then, you'll add a second node pool to support user workloads with a dynamic node count. Finally, you'll scale the node count to zero to reduce the cost of the nodes used in your AKS cluster.
5
+
Here, you'll create an Azure Kubernetes Service (AKS)-managed Kubernetes cluster. Next, you'll configure the cluster to support multiple node pools and allow clusters to scale the nodes in the node pools. Then, you'll add a second node pool to support user workloads with a dynamic node count. Finally, you'll scale the node count to zero to reduce the cost of the nodes used in your AKS cluster.
6
6
7
7
## Create a new resource group
8
8
@@ -13,6 +13,8 @@ Here, you'll create an Azure Kubernetes Service (AKS)-managed Kubernetes cluster
13
13
14
14
1. You'll reuse the values you create here throughout all the exercises in this module. Save the output for future use.
15
15
16
+
1. At the top of the Cloud Shell window, select **Settings** > **Go to Classic version**.
17
+
16
18
1. Choose a region to host your resource group. Features from later exercises aren't available in all regions. For this reason, we recommend that you use **eastus** as your region. If you choose to use a different value, change the value of `REGION_NAME`.
17
19
18
20
Run the following commands to register your variables:
@@ -50,7 +52,7 @@ With the resource group created, you can create AKS clusters within the group. Y
Copy file name to clipboardExpand all lines: learn-pr/azure/aks-optimize-compute-costs/includes/4-spot-node-pools.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ Azure provides Azure Virtual Machine instances that offer scalability while redu
2
2
3
3
Your company's drone-tracking solution is deployed on Azure Kubernetes Service (AKS) as many containerized applications and services. One of these services is a batch-processing service that schedules drone flight paths. With a sudden growth in your customer base, the batch-processing service gets inundated with requests and builds up a backlog of deliveries. This situation is causing delays and customer frustration.
4
4
5
-
Automatically scaling the number of batch-processing service replicas provides for timely order processing. However, it also requires you to deploy more nodes to keep up with computing resource needs. Analyzing usage trends in Azure Monitor, you notice that these nodes are used only at specific times and not in a cost-effective way. The batch-processing service is stateless and doesn't save any client-session data. You realize that you can save money by:
5
+
Automatically scaling the number of batch-processing service replicas provides for timely order processing. However, it also requires you to deploy more nodes to keep up with computing resource needs. Analyzing usage trends in Azure Monitor, you notice that these nodes are used only at specific times, and not in a cost-effective way. The batch-processing service is stateless and doesn't save any client-session data. You realize that you can save money by:
6
6
7
7
- Using lower-cost node instances.
8
8
- Automatically scaling the node count in the node pool that's configured for batch processing.
@@ -33,7 +33,7 @@ A spot virtual machine scale set is a virtual machine scale set that supports Az
33
33
34
34
-**Deallocate**: The Deallocate policy functions exactly as described earlier.
35
35
36
-
-**Delete**: The Delete policy allows you to avoid the cost of disks and hitting quota limits. With the Delete eviction policy, evicted VMs are deleted together with their underlying disks. The scale set's autoscaling feature can now automatically try to compensate for VM eviction by creating new VMs. Although the creation of VMs isn't guaranteed, the evicted VMs don't count toward your vCPU quota or incur costs for underlying disks.
36
+
-**Delete**: The Delete policy allows you to avoid the cost of disks and hitting quota limits. With the Delete eviction policy, evicted VMs are deleted together with their underlying disks. The scale set's autoscaling feature can now automatically try to compensate for VM eviction by creating new VMs. Although the creation of VMs isn't guaranteed, the evicted VMs don't count toward your vCPU quota or incur costs for underlying disks.
37
37
38
38
A best practice is to use the autoscale feature only when you set the eviction policy to **Delete** on the scale set.
39
39
@@ -60,7 +60,7 @@ As the demand for nodes increases, the cluster autoscaler can scale the number o
60
60
Before you decide to add a spot user node pool to your AKS cluster, consider the following limitations:
61
61
62
62
- The underlying spot scale set is deployed only to a single fault domain and offers no high-availability guarantees.
63
-
- The AKS cluster needs multiplenode-pool support to be enabled.
63
+
- The AKS cluster needs multiple-node-pool support to be enabled.
64
64
- You can use spot node pools only as user node pools.
65
65
- You can't upgrade spot node pools.
66
66
- The creation of spot VMs isn't guaranteed. The creation of spot nodes depends on capacity and quota availability in the cluster's deployed Azure region.
@@ -78,7 +78,7 @@ You set several parameters for a new node pool to configure it as a spot node po
78
78
79
79
### Priority
80
80
81
-
The `--priority` parameter is set to `Regular` by default for a new node pool. Set the value to `Spot` to indicate that the new pool you're creating is a spot node pool. This value can't be changed after creation.
81
+
The `--priority` parameter is set to `Regular` by default for a new node pool. Set the value to `Spot` to indicate that the new pool you're creating is a spot node pool. You can't change this value after creation.
82
82
83
83
### Eviction policy
84
84
@@ -93,7 +93,7 @@ Spot node pools optimize costs by capping the maximum amount that you're willing
93
93
You can set this value to any positive amount up to five decimal places, or set it to `-1`. Setting the `--spot-max-price` value to `-1` affects your node pool in the following ways:
94
94
95
95
- Nodes aren't be evicted based on the node's price.
96
-
- The cost for new nodes is based on the current price for spot nodes, or the price for a standard node, using whichever is lower.
96
+
- The cost for new nodes is based on the current price for spot nodes or the price for a standard node; whichever is lower.
97
97
98
98
For example, if you set the value to 0.98765, the maximum price for a node in USD is 0.98765 per hour. When the node's consumption exceeds this amount, it's evicted.
Copy file name to clipboardExpand all lines: learn-pr/azure/aks-optimize-compute-costs/includes/6-resource-quota-azure-policy.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Azure Policy helps you to enforce standards and assess compliance at scale for your cloud environment. It's good practice for companies to implement business rules to define how employees are allowed to use company software, hardware, and other resources in the organization. Therefore, businesses use policies to enforce, review, and define access. A policy helps an organization meet governance and legal requirements, implement best practices, and establish organizational conventions.
1
+
Azure Policy helps you enforce standards and assess compliance at scale for your cloud environment. It's good practice for companies to implement business rules to define how employees are allowed to use company software, hardware, and other resources in the organization. Therefore, businesses use policies to enforce, review, and define access. A policy helps an organization meet governance and legal requirements, implement best practices, and establish organizational conventions.
2
2
3
3
Azure Kubernetes Service (AKS) allows you to orchestrate your cloud-native applications efficiently with policies. You realize that you need to enforce business rules to manage how the teams use AKS to ensure a cost-effective approach. You decide to use Azure Policy to apply this idea on your Azure-based cloud resources.
4
4
@@ -22,9 +22,9 @@ The *Open Policy Agent (OPA)* is an open-source, general-purpose policy engine t
22
22
23
23
## What is the OPA Gatekeeper?
24
24
25
-
The *OPA Gatekeeper* is an open-source, validating, Kubernetes admission-controller webhook that enforces Custom Resource Definition (CRD)-based policies that follow the OPA syntax.
25
+
The *OPA Gatekeeper* is an open-source, validating, Kubernetes admissioncontroller webhook that enforces Custom Resource Definition (CRD)-based policies that follow the OPA syntax.
26
26
27
-
The goal of the OPA Gatekeeper is to allow you to customize admission policies by using configuration instead of hard-coded policy rules for services. It also gives you a full view of your cluster to identify policy-violating resources.
27
+
The OPA Gatekeeper's goal is to allow you to customize admission policies by using configuration instead of hard-coded policy rules for services. It also gives you a full view of your cluster to identify policy-violating resources.
28
28
29
29
Use the OPA Gatekeeper to define organization-wide policies with rules:
30
30
@@ -80,7 +80,7 @@ There are a few steps to registering the Azure Policy Add-on for AKS feature. We
80
80
--resource-group myResourceGroup
81
81
```
82
82
83
-
Activating the addon schedules workloads in two namespaces on your cluster. The first namespace is **kube-system**, which contains the `azure-policy` and `azure-policy-webhook`. The second namespace is **gatekeeper-system**, which contains the `gatekeeper-controller-manager`. These workloads are responsible for evaluating requests submitted to the AKS control plane. Based on your configured policies, your policy webhook can allow or deny requests.
83
+
Activating the add-on schedules workloads in two namespaces on your cluster. The first namespace is **kube-system**, which contains the `azure-policy` and `azure-policy-webhook`. The second namespace is **gatekeeper-system**, which contains the `gatekeeper-controller-manager`. These workloads are responsible for evaluating requests submitted to the AKS control plane. Based on your configured policies, your policy webhook can allow or deny requests.
84
84
85
85
## Assign a built-in policy definition
86
86
@@ -154,7 +154,7 @@ For example, for the resource-management policy, you can select **audit**, **den
154
154
155
155
This table lists all the effects currently supported in policy definitions:
156
156
157
-
| Effect | Description |
157
+
| Effect | Description ||
158
158
| --- | --- |
159
159
| **Append** | Adds more fields to the requested resource |
160
160
| **Audit** | Creates a warning event in the activity log |
Copy file name to clipboardExpand all lines: learn-pr/azure/aks-optimize-compute-costs/includes/7-exercise-resource-quota-azure-policy.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ In this exercise, you'll enable Azure Policy for AKS on your cluster and add the
37
37
az feature register --namespace Microsoft.ContainerService --name AKS-AzurePolicyAutoApprove
38
38
```
39
39
40
-
1. Check that the registration was successful by querying the feature-list table. Use the `az feature list` command to run the query. The feature's registration can take several minutes to finish, so you have to check the result periodically.
40
+
1. Check that the registration succeeded by querying the feature-list table. Use the `az feature list` command to run the query. The feature's registration can take several minutes to finish, so you have to check the result periodically.
41
41
42
42
```azurecli
43
43
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/AKS-AzurePolicyAutoApprove')]. {Name:name,State:properties.state}"
@@ -143,10 +143,10 @@ To configure the new Azure Policy, use the Policy service in the Azure portal.
143
143
| Exclusions | Leave empty. |
144
144
| **Basics** |
145
145
| Policy definition | Select the ellipsis button. The **Available Definitions** pane appears. In the **Search** box, filter the selection by entering *CPU*. On the **Policy Definitions** tab, select the **Kubernetes cluster containers CPU and memory resource limits should not exceed the specified limits**, then select **Add**. |
146
+
| Version | Accept default. |
146
147
| Assignment name | Accept default. |
147
148
| Description | Leave empty. |
148
149
| Policy enforcement | Make sure this option is set to **Enabled**. |
149
-
| Assigned by | Accept default. |
150
150
151
151
Here's an example of the completed **Basics** tab:
152
152
@@ -161,7 +161,7 @@ To configure the new Azure Policy, use the Policy service in the Azure portal.
161
161
| Max allowed CPU units | Set the value to **200m**. The policy matches this value to both the workload resource-request value and the workload limit value specified in the workload's manifest file. |
162
162
| Max allowed memory bytes | Set the value to **256Mi**. The policy matches this value to both the workload resource-request value and the workload limit value specified in the workload's manifest file. |
163
163
164
-
Here's an example of the completed **Parameters** tab:
164
+
Leave all other values as default. Here's an example of the completed **Parameters** tab:
165
165
166
166
:::image type="content" source="../media/7-complete-parameters-tab.png" alt-text="Screenshot that shows the information captured in the Parameters tab.":::
167
167
@@ -182,6 +182,8 @@ The final step is to test the new policy. Deploy your test workload with resourc
182
182
183
183
1. Open Azure Cloud Shell and be sure to select the Bash version of Cloud Shell.
184
184
185
+
1. At the top of the Cloud Shell window, select **Settings** > **Go to Classic version**.
186
+
185
187
1. Create a manifest file for the Kubernetes deployment by using the integrated editor. Call the file `test-policy.yaml`:
Copy file name to clipboardExpand all lines: learn-pr/azure/aks-optimize-compute-costs/includes/8-summary.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ In this module, you created billed resources on your Azure subscription. The fol
39
39
40
40
## Optional: Clean up services
41
41
42
-
In this module, you also registered service providers within Azure to access their features. There's no extra charge for registering the providers or features. Follow these steps to unregister.
42
+
In this module, you also registered service providers within Azure to access their features. There's no extra charge for registering the providers or features. Follow these steps to unregister the policies and providers.
43
43
44
44
1. Run the following command to unregister the Azure Policy on AKS feature.
45
45
@@ -55,7 +55,7 @@ In this module, you also registered service providers within Azure to access the
55
55
```
56
56
57
57
> [!IMPORTANT]
58
-
> If you choose to unregister, then the optimization features covered in the learning module aren't ableuntil you register.
58
+
> If you choose to unregister, then the optimization features covered in the learning module aren't available againuntil you register.
0 commit comments