Debug School

Rajesh Kumar
Rajesh Kumar

Posted on

Azure Capstone: Deploy a Production-Style 3-Tier App on AKS with Terraform

The 10 questions. Each has the commands to find the answee....

  1. Container Registry login server and its 3 repositories.
  2. VNet range and the two subnet ranges.
  3. VM size, node count and Kubernetes version of the cluster.
  4. Pod names of the database, backend and frontend, and the node each runs on.
  5. The backend's image, and whether it comes from their own registry.
  6. The database's PVC name, size, storage class and the Azure Disk behind it.
  7. The frontend's private load balancer IP versus the Application Gateway public IP.
  8. Key Vault name, its secrets, the banner value and the Entra ID identity.
  9. DNS name servers and the app A record, and whether public DNS agrees.
  10. End to end: sign the guest book, show the message in the database before and after deleting the database pod, the WAF status code (403), and a screenshot.

Top comments (1)

Collapse
 
khuma_pokhare_d9fdc896ef9 profile image
Khuma Pokhare •

capkhumauhxl.azurecr.io
Repositories: capstone-backend, capstone-frontend, postgres.

vnet 10.1.0.0/16,
subnet 10.1.0.0/24, 10.1.1.0/24.

vm-size: Standard_D2s_v6
node count: 1
Kubernetes version: default

Database: postgres-0
Backend: backend-767875cdd7-8kgk8
Frontend: frontend-76bb5b6646-ht4wx

capkhumauhxl.azurecr.io/capstone-backend:c6ceffddf

PVC data-postgres-0
5 GiB
storage class managed-csi
Azure Disk: pvc-09cebf06-063d-4603-a521-bfdb73641a16,

Frontend private load balancer: 10.1.0.100
public IP: 57.154.17.9

NS zone: khuma.khuma.collabgigs.com
Nameservers: ns1-06.azure-dns.com, ns2-06.azure-dns.net, ns3-06.azure-dns.org, ns4-06.azure-dns.info

Collapse
 
loni_hatimuria_48462a7278 profile image
Loni Hatimuria •
  1. Container Registry login server and its 3 repositories.
    Login server : caplonieyvm.azurecr.io
    Repositories:
    capstone-backend
    capstone-frontend
    postgres

  2. VNet range and the two subnet ranges.
    Vnet : vnet-cap-loni - "10.1.0.0/16
    subnet :
    Subnet Range


    snet-aks 10.1.0.0/24
    snet-appgw 10.1.1.0/24

  3. VM size, node count and Kubernetes version of the cluster.

    VM size: Standard_D2s_v6
    node count: 1
    Kubernetes version: 1.35

  4. Pod names of the database, backend and frontend, and the node each runs on.
    kubectl get pods -n "capstone" -o wide
    NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
    backend-5c647dccc5-qmlp2 1/1 Running 0 24m 192.168.0.101 aks-system-19610538-vmss000000
    frontend-868899d69b-jfg8v 1/1 Running 0 26m 192.168.0.131 aks-system-19610538-vmss000000
    postgres-0 1/1 Running 0 26m 192.168.0.19 aks-system-19610538-vmss000000

  5. The backend's image, and whether it comes from their own registry. ??

kubectl get deployments -n "capstone" \
-o custom-columns='DEPLOYMENT:.metadata.name,IMAGE:.spec.template.spec.containers[*].image'
DEPLOYMENT IMAGE
backend caplonieyvm.azurecr.io/capstone-backend:c6ceffddfb
frontend caplonieyvm.azurecr.io/capstone-frontend:c6ceffddfb

  1. The database's PVC name, size, storage class and the Azure Disk behind it.

PVC name: data-postgres-0
size: 5 GiB
storage class: managed-csi
azure disk: disk.csi.azure.com

  1. The frontend's private load balancer IP versus the Application Gateway public IP.
    frontend - clusterIP: 172.16.72.165
    application gateway: 20.38.12.73
    pip-cap-loni-appgw 20.38.12.73 rg-cap-loni

  2. Key Vault name, its secrets, the banner value and the Entra ID identity.

keyvault: kv-cap-loni-eyvm kv-cap-loni-eyvm.vault.azure.net/
secrets:
Name Enabled


app-banner True
db-password True

  1. DNS name servers and the app A record, and whether public DNS agrees.
    az network dns zone list -g "rg-cap-loni" -o table
    Location MaxNumberOfRecordSets Name NumberOfRecordSets ResourceGroup ZoneType


    global 10000 loni.loni.collabgigs.com 3 rg-cap-loni Public

  2. End to end: sign the guest book, show the message in the database before and after deleting the database pod, the WAF status code (403), and a screenshot.

capstone=# select * from messages
capstone-# \dt
List of relations
Schema | Name | Type | Owner
--------+----------+-------+----------
public | messages | table | capstone
(1 row)

capstone-# select * from messages
capstone-# select top 1 from messages
capstone-# desc messages
capstone-# SELECT column_name, data_type
capstone-# FROM information_schema.columns
capstone-# WHERE table_name = 'messages'
capstone-# SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'messages'
capstone-#

Collapse
 
anirudha_ingole_9c8e0ffd0 profile image
Anirudha ingole •

a00552947@OVO-BHX1usJtFAX:~/terrafrom-capstone-azure/capstone$ kubectl -n capstone get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
data-postgres-0 Bound pvc-a662a84a-0fd2-43c8-9a1e-e8b287788c4c 5Gi RWO managed-csi <unset> 60m
a00552947@OVO-BHX1usJtFAX:~/terrafrom-capstone-azure/capstone$ kubectl get pods
No resources found in default namespace.
a00552947@OVO-BHX1usJtFAX:~/terrafrom-capstone-azure/capstone$ kubectl get pods -n capstone
NAME READY STATUS RESTARTS AGE
backend-558594b8f7-285qs 1/1 Running 0 59m
frontend-7b6bb8849c-rln8q 1/1 Running 0 60m
postgres-0 1/1 Running 0 60m
a00552947@OVO-BHX1usJtFAX:~/terrafrom-capstone-azure/capstone$

Collapse
 
tariq_alghawanmeh_68388ac profile image
tariq alghawanmeh •

1- captariqbyvs
*backend the app itself / frontend: nginx / postgress: the DB
*
[
"capstone-backend",
"capstone-frontend",
"postgres"
]

2-
*VNET range:
*
[
{
"name": "vnet-cap-tariq",
"range": "10.3.0.0/16"
}
]
*Subnets:
*
{
"name": "snet-aks",
"range": "10.3.0.0/24"
},
{
"name": "snet-appgw",
"range": "10.3.1.0/24"
}

3-
k8sVersion": "1.35"
nodeCount": 1
vmSize": "Standard_D2s_v6"

4-
Database: postgres-0
backend: backend-5d545fb4bb-dg726
frontend: frontend-5cd87694f6-scgbt
They all run on the same node: aks-system-20351786-vmss000000

5-
captariqbyvs.azurecr.io/capstone-backend:c6ceffddfb

6-

kubectl -n capstone get pvc
NAME              STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
data-postgres-0   Bound    pvc-b897db6f-e948-4bf9-900c-c555007177f1   5Gi        RWO            managed-csi    <unset>                 7m37s

Enter fullscreen mode Exit fullscreen mode

name: data-postgres-0
Size: 5Gi
Storage class: managed-csi
azure disk: pvc-b897db6f-e948-4bf9-900c-c555007177f1

7-
Frontend: 10.3.0.100
gateway: 20.163.105.31

8-
Vault name: kv-cap-tariq-byvs
secrets: app-banner, db-password
banner: Hello from tariq - Key Vault says hi
entra ID: id-cap-tariq-backend

9-
ns1-03.azure-dns.com.
ns2-03.azure-dns.net.
ns3-03.azure-dns.org.
ns4-03.azure-dns.info.

yes public DNS agrees:

tariq@tariq:~/terraform-training/aks/terrafrom-capstone-azure/capstone/scripts$ dig +short NS tariq.lab.collabgigs.com @1.1.1.1
ns1-03.azure-dns.com.
ns2-03.azure-dns.net.
ns3-03.azure-dns.org.
ns4-03.azure-dns.info.
tariq@tariq:~/terraform-training/aks/terrafrom-capstone-azure/capstone/scripts$ dig +short NS tariq.lab.collabgigs.com @8.8.8.8
ns3-03.azure-dns.org.
ns2-03.azure-dns.net.
ns4-03.azure-dns.info.
ns1-03.azure-dns.com.

Enter fullscreen mode Exit fullscreen mode

10-

Collapse
 
yash_sarnobat_31 profile image
Yash Sarnobat •
  1. Login server: capyashkguu.azurecr.io
    Repos: capstone-backend, capstone-frontend and postgres.

  2. vnet-cap-yash: 10.1.0.0/16
    snet-aks: 10.1.0.0/24
    snet-appgw: 10.1.1.0/24

  3. Size: Standard_D2s_v6
    Count: 1
    K8s v1.35

  4. backend-877899fb4-92ssh
    frontend-6758c46494-rzm2v
    postgres-0
    node: aks-system-30640146-vmss000000

  5. backend: capyashkguu.azurecr.io/capstone-backend:c6ceffddfb

  6. PVC: data-postgres-0
    Size: 5GB
    Class: managed-csi
    AzDisk: pvc-d4f7e8b5-9cf2-4126-a8c3-b5635e813bbf

  7. frontend: 10.1.0.100
    app-gw: 20.106.88.162

  8. KV: kv-cap-yash-kguu
    Secrets: app-banner and db-password
    Banner value: Hello from yash - Key Vault says hi
    Entra IDs: id-cap-yash-aks and id-cap-yash-backend

  9. NameServers:

  10. ns1-03.azure-dns.com.

  11. ns2-03.azure-dns.net.

  12. ns3-03.azure-dns.org.

  13. ns4-03.azure-dns.info.
    Zone: yash.yash.collabgigs.com
    A Record: app
    pip-cap-yash-appgw and dig A "app.yash.yash.collabgigs.com" +short --> 20.106.88.162

Collapse
 
sakshi_gadekar profile image
Sakshi Gadekar •
  1. a)Container registry:capsakshimrc4
    b) repos: capstone-backend, capstone-frontend, and postgres.

  2. VNet: 10.1.0.0/16
    AKS subnet (snet-aks): 10.1.0.0/24
    Application Gateway subnet (snet-appgw): 10.1.1.0/24

  3. kubernetesVersion: '1.35'
    nodeCount: 1
    vmSize: Standard_D2s_v6

4.
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
backend-fc6464964-bvl26 1/1 Running 0 69m 192.168.0.131 aks-system-15401439-vmss000000
frontend-5f855cd7f4-46c2c 1/1 Running 0 70m 192.168.0.196 aks-system-15401439-vmss000000
postgres-0 1/1 Running 0 70m 192.168.0.233 aks-system-15401439-vmss000000

5.apsakshimrc4.azurecr.io/capstone-backend:c6ceffddfb. Yes it comes from own registry

  1. PVC: data-postgres-0 Size: 5Gi Storage class: managed-csi Azure Disk: pvc-ca397418-5eaf-4464-8834-45d353cec418 Resource group: MC_rg-cap-sakshi_aks-cap-sakshi_westus3

7.Frontend private load balancer IP: 10.1.0.100
Application Gateway public IP: 20.171.75.10

8.Key Vault: kv-cap-sakshi-mrc4
Secrets: app-banner and db-password
Banner value: Hello from sakshi - Key Vault says hi
Backend Entra ID identity: id-cap-sakshi-backend

9.Application Gateway IP is 20.171.75.10

Some comments may only be visible to logged-in visitors. Sign in to view all comments.