Skip to content

Commit ded69af

Browse files
committed
updates july 2025
1 parent 14c6926 commit ded69af

File tree

22 files changed

+335
-59
lines changed

22 files changed

+335
-59
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
- name: Setup Terraform
3636
uses: hashicorp/setup-terraform@v3
3737
with:
38-
terraform_version: 1.11.0
38+
terraform_version: 1.9.8
3939
terraform_wrapper: true
4040

4141
# Add in tutorial 6-Terarform-Docs
4242
# - name: Render terraform docs and push changes back to PR
43-
# uses: terraform-docs/gh-actions@main
43+
# uses: terraform-docs/gh-actions@v1.3.0
4444
# with:
4545
# working-dir: ./2-Terraform-AZURE-Services-Creation/1-acr, ./2-Terraform-AZURE-Services-Creation/2-vnet, ./2-Terraform-AZURE-Services-Creation/3-log-analytics, ./2-Terraform-AZURE-Services-Creation/4-aks
4646
# output-file: README.md
@@ -53,7 +53,7 @@ jobs:
5353

5454
# Add in tutorial 5-Terraform-Static-Code-Analysis
5555
# - name: tfsec
56-
# uses: aquasecurity/tfsec-pr-commenter-action@v1.2.0
56+
# uses: aquasecurity/tfsec-pr-commenter-action@v1.3.0
5757
# with:
5858
# tfsec_args: --soft-fail
5959
# github_token: ${{ github.token }}
@@ -70,6 +70,7 @@ jobs:
7070
commit_message: "Terraform fmt"
7171
file_pattern: "*.tf *.tfvars"
7272
commit_user_name: "github-actions[bot]"
73+
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
7374

7475
- name: Terraform Plan
7576
run: terraform plan -no-color -input=false

2-Terraform-AZURE-Services-Creation/1-acr/providers.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.11"
2+
required_version = ">= 1.9.8"
33
backend "azurerm" {
44
resource_group_name = "devopshardway-rg"
55
storage_account_name = "devopshardwaysa"
@@ -10,7 +10,7 @@ terraform {
1010
required_providers {
1111
azurerm = {
1212
source = "hashicorp/azurerm"
13-
version = ">= 4.27.0"
13+
version = ">= 4.28.0"
1414
}
1515
}
1616
}

2-Terraform-AZURE-Services-Creation/2-vnet/providers.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.11"
2+
required_version = ">= 1.9.8"
33
backend "azurerm" {
44
resource_group_name = "devopshardway-rg"
55
storage_account_name = "devopshardwaysa"
@@ -10,7 +10,7 @@ terraform {
1010
required_providers {
1111
azurerm = {
1212
source = "hashicorp/azurerm"
13-
version = ">= 4.27.0"
13+
version = ">= 4.28.0"
1414
}
1515
}
1616
}

2-Terraform-AZURE-Services-Creation/3-log-analytics/providers.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.11"
2+
required_version = ">= 1.9.8"
33
backend "azurerm" {
44
resource_group_name = "devopshardway-rg"
55
storage_account_name = "devopshardwaysa"
@@ -10,7 +10,7 @@ terraform {
1010
required_providers {
1111
azurerm = {
1212
source = "hashicorp/azurerm"
13-
version = ">= 4.27.0"
13+
version = ">= 4.28.0"
1414
}
1515
}
1616
}

2-Terraform-AZURE-Services-Creation/4-Create-AKS-Cluster-IAM-Roles.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ In this lab, you'll create an Azure Kubernetes Service (AKS) cluster and set up
1919
Review the [AKS Terraform configuration](https://github.com/thomast1906/DevOps-The-Hard-Way-Azure/tree/main/2-Terraform-AZURE-Services-Creation/4-aks). The configuration includes:
2020

2121
**aks.tf:**
22-
- [ ] Creates AKS Cluster using `azurerm_kubernetes_cluster`
23-
- [ ] Sets up role assignments using `azurerm_role_assignment`
22+
- [ ] Creates AKS Cluster using `azurerm_kubernetes_cluster` with Kubernetes 1.33
23+
- [ ] Enables auto-scaling (min: 1, max: 5 nodes) for cost optimization
24+
- [ ] Configures availability zones for high availability
25+
- [ ] Sets up Azure RBAC and managed identity integration
26+
- [ ] Enables automatic patch upgrade channel
27+
- [ ] Configures network policies for enhanced security
2428
- [ ] Uses the `uksouth` region (can change if desired)
2529

2630
**managed_identity.tf:**
@@ -59,9 +63,26 @@ Example screenshot of created resources:
5963

6064
After creating the AKS cluster and IAM roles, consider these questions:
6165
1. Why is it important to use managed identities with AKS?
62-
2. How does RBAC enhance the security of your AKS cluster?
66+
2. How does Azure RBAC enhance the security of your AKS cluster compared to basic RBAC?
6367
3. What are the benefits of using federated identity credentials?
64-
65-
## 💡 Pro Tip
66-
67-
Consider enabling Azure Policy for Kubernetes to enforce organisational standards and assess compliance at scale for your AKS clusters.
68+
4. How does auto-scaling help with cost optimization and performance?
69+
5. Why are availability zones important for production workloads?
70+
6. What security benefits do network policies provide?
71+
72+
## 💡 Pro Tips
73+
74+
1. **Migration from Existing Clusters**: If upgrading from a previous version of this tutorial:
75+
- Kubernetes 1.33 requires a cluster upgrade procedure
76+
- Azure RBAC is now enabled by default for enhanced security
77+
- Auto-scaling may affect your cost structure but improves efficiency
78+
- Network policies may require reviewing existing pod communication patterns
79+
80+
2. **Security Best Practices**:
81+
- Enable Azure Policy for Kubernetes to enforce organisational standards and assess compliance at scale
82+
- Regularly review and audit RBAC permissions
83+
- Monitor cluster logs through the integrated Log Analytics workspace
84+
85+
3. **Cost Optimization**:
86+
- Auto-scaling will automatically adjust node count based on demand
87+
- Use spot instances for non-critical workloads to reduce costs
88+
- Monitor resource usage through Azure Monitor

2-Terraform-AZURE-Services-Creation/4-aks/aks.tf

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ resource "azurerm_kubernetes_cluster" "k8s" {
77
oidc_issuer_enabled = true
88
workload_identity_enabled = true
99
node_resource_group = "${var.name}-node-rg"
10+
automatic_upgrade_channel = "patch"
11+
local_account_disabled = false
1012

1113
linux_profile {
1214
admin_username = "ubuntu"
@@ -17,12 +19,18 @@ resource "azurerm_kubernetes_cluster" "k8s" {
1719
}
1820

1921
default_node_pool {
20-
name = "agentpool"
21-
node_count = var.agent_count
22-
vm_size = var.vm_size
23-
vnet_subnet_id = data.azurerm_subnet.akssubnet.id
24-
type = "VirtualMachineScaleSets"
25-
orchestrator_version = var.kubernetes_version
22+
name = "agentpool"
23+
node_count = var.agent_count
24+
vm_size = var.vm_size
25+
vnet_subnet_id = data.azurerm_subnet.akssubnet.id
26+
type = "VirtualMachineScaleSets"
27+
orchestrator_version = var.kubernetes_version
28+
auto_scaling_enabled = true
29+
min_count = 1
30+
max_count = 5
31+
max_pods = 110
32+
os_disk_size_gb = 30
33+
zones = ["1", "2", "3"]
2634
}
2735

2836
identity {
@@ -36,10 +44,13 @@ resource "azurerm_kubernetes_cluster" "k8s" {
3644
network_profile {
3745
load_balancer_sku = "standard"
3846
network_plugin = "azure"
47+
network_policy = "azure"
48+
dns_service_ip = "10.2.0.10"
49+
service_cidr = "10.2.0.0/24"
3950
}
4051

4152
azure_active_directory_role_based_access_control {
42-
azure_rbac_enabled = false
53+
azure_rbac_enabled = true
4354
admin_group_object_ids = [var.aks_admins_group_object_id]
4455
}
4556

2-Terraform-AZURE-Services-Creation/4-aks/providers.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.11"
2+
required_version = ">= 1.9.8"
33
backend "azurerm" {
44
resource_group_name = "devopshardway-rg"
55
storage_account_name = "devopshardwaysa"
@@ -10,7 +10,7 @@ terraform {
1010
required_providers {
1111
azurerm = {
1212
source = "hashicorp/azurerm"
13-
version = ">= 4.27.0"
13+
version = ">= 4.28.0"
1414
}
1515
}
1616
}

2-Terraform-AZURE-Services-Creation/4-aks/terraform.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "devopsthehardway"
22
location = "uksouth"
33

4-
kubernetes_version = "1.32"
4+
kubernetes_version = "1.33"
55
agent_count = 3
66
vm_size = "Standard_DS2_v2"
77
ssh_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDrt/GYkYpuQYRxM3lgjOr3Wqx8g5nQIbrg6Mr53wZGb35+ft+PibDMqxXZ7xq7fC3YuLnnO022IPgEjkF9fP03ZmfUeLjJJvw8YcutN9DD/2cx93BpKFPNUsqEB+za1iJ16kMsCojy35c1R64O+rw20D6iP96rmDAyIc5FR03y00eyAzQ8vo7/u9+VPwpdGEI7QCokZROcj6iNVz1V/1t6G4AEufPLokdj8J0gla/dN+tvnSLRQVBTDiD4jmVGImpWFqqKaH6R9SSXmRzj0uhvJUmSiZAZCb1caPEYgPEvNITuGQFdykPoY/4Z/3B+x/ipEQbWy8yL7bDFSXZTYhVKlPVyPbUtN5QFt7QtCtg84xDAZ6GA6AnONTtMxX2jvdzB9yh1ZsteNrOZ/Jo3ecuie573syQfG23Tu6qTqak8O7ZTOLY9iPx2ego3KvTWH/Q3lIvjnlpfCQtFtSgkNxjalMBk+NwwEgZHWRREOHwJmQIKVN0gSitN1KXobrqwxNk= tamops@Synth"

2-Terraform-AZURE-Services-Creation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Each component is organised in its own directory with a consistent structure:
3434
Before starting these labs, ensure you have:
3535

3636
1. Completed the steps in the [1-Azure](../1-Azure) section
37-
2. Terraform installed (version 1.9.6 or higher)
37+
2. Terraform installed (version 1.9.8 or higher)
3838
3. Azure CLI installed and configured (`az login` executed)
3939
4. Basic familiarity with Terraform and Azure infrastructure concepts
4040

3-Docker/1-Create-Docker-Image.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ In this lab, you'll create a Docker image to containerise the Thomasthornton.clo
2020
2. **Review the Dockerfile**
2121

2222
Open the Dockerfile and note its key components:
23-
- [ ] Uses the latest Python image as base
24-
- [ ] Creates a `/build` directory for the app
25-
- [ ] Copies the `app` directory and `requirements.txt` into `/build`
23+
- [ ] Uses Python 3.13-slim image as base
24+
- [ ] Creates a `/app` directory for the application
25+
- [ ] Copies the `app` directory and `requirements.txt` into `/app`
2626
- [ ] Configures the container to run the app on startup
2727

2828
3. **Build the Docker Image**

0 commit comments

Comments
 (0)