Skip to content

Commit 10ad608

Browse files
committed
Welcome to Stack Simplify
1 parent 355e6eb commit 10ad608

File tree

1 file changed

+68
-7
lines changed

1 file changed

+68
-7
lines changed

25-Azure-DevOps-Terraform-Azure-AKS/README.md

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,22 +473,83 @@ kubectl get nodes
473473
```
474474

475475
## Step-16: Make Changes to Infrastructure and Push Code
476-
- Add this as node-label and tag to linux101 nodepool
477-
```
478-
# Add this tag and node-label
479-
"ui-apps" = "react-apps"
476+
- Add new nodepool named linux102
477+
- Create file **11-aks-cluster-linux102-user-nodepools.tf**
478+
```yaml
479+
# Create Linux Azure AKS Node Pool
480+
481+
resource "azurerm_kubernetes_cluster_node_pool" "linux101" {
482+
availability_zones = [1, 2, 3]
483+
enable_auto_scaling = true
484+
kubernetes_cluster_id = azurerm_kubernetes_cluster.aks_cluster.id
485+
max_count = 3
486+
min_count = 1
487+
mode = "User"
488+
name = "linux102"
489+
orchestrator_version = data.azurerm_kubernetes_service_versions.current.latest_version
490+
os_disk_size_gb = 30
491+
os_type = "Linux" # Default is Linux, we can change to Windows
492+
vm_size = "Standard_DS2_v2"
493+
priority = "Regular" # Default is Regular, we can change to Spot with additional settings like eviction_policy, spot_max_price, node_labels and node_taints
494+
node_labels = {
495+
"nodepool-type" = "user"
496+
"environment" = var.environment
497+
"nodepoolos" = "linux"
498+
"ui-app" = "reactjs-apps"
499+
}
500+
tags = {
501+
"nodepool-type" = "user"
502+
"environment" = var.environment
503+
"nodepoolos" = "linux"
504+
"ui-app" = "reactjs-apps"
505+
}
506+
}
480507
```
481-
- Execute Git Commands
508+
- Commit Code
482509
```
483510
# First sync Remote repo with local repo
484511
git pull
485512
486513
# Commit
487514
git add .
488-
git commit -am "Added New Node-label to linux101 nodepool"
515+
git commit -am "Added New Node-Pool linux102"
489516
git push
490517
```
491-
- Verify the pipeline
518+
- Verify the pipeline
519+
520+
### Connect to Dev AKS Cluster & verify
521+
```
522+
# Setup kubeconfig
523+
az aks get-credentials --resource-group <Resource-Group-Name> --name <AKS-Cluster-Name>
524+
az aks get-credentials --resource-group terraform-aks-dev --name terraform-aks-dev-cluster --admin
525+
526+
# View Cluster Info
527+
kubectl cluster-info
528+
529+
# List Kubernetes Worker Nodes
530+
kubectl get nodes
531+
```
532+
533+
534+
### Connect to QA AKS Cluster & Verify
535+
```
536+
# Setup kubeconfig
537+
az aks get-credentials --resource-group <Resource-Group-Name> --name <AKS-Cluster-Name>
538+
az aks get-credentials --resource-group terraform-aks-qa --name terraform-aks-qa-cluster --admin
539+
540+
# View Cluster Info
541+
kubectl cluster-info
542+
543+
# List Kubernetes Worker Nodes
544+
kubectl get nodes
545+
```
546+
547+
## Step-17: Clean-Up
548+
- Delete the Resource groups which will delete all resources
549+
- terraform-aks-dev
550+
- terraform-aks-qa
551+
- Delete AD Groups
552+
492553

493554
## References
494555
- [Publish & Download Artifacts in Azure DevOps Pipeline](https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/pipeline-artifacts?view=azure-devops&tabs=yaml)

0 commit comments

Comments
 (0)