Skip to content

Commit e41428b

Browse files
committed
Fix
1 parent c2c6fe8 commit e41428b

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

scenarios/AksOpenAiTerraform/deploy.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/bin/bash
22

33
cd terraform
4-
SUBSCRIPTION_ID=$(az account show --query id --output tsv)
5-
RESOURCE_GROUP=$(terraform output -raw resource_group_name)
6-
CLUSTER_NAME=$(terraform output -raw cluster_name)
7-
ACR_NAME="$(terraform output -raw acr_name)"
8-
# EMAIL="$(terraform output -raw email)"
9-
EMAIL=ariaamini@microsoft.com
4+
export RESOURCE_GROUP=$(terraform output -raw resource_group_name)
5+
export CLUSTER_NAME=$(terraform output -raw cluster_name)
6+
export WORKLOAD_MANAGED_IDENTITY_CLIENT_ID=$(terraform output -raw workload_managed_identity_client_id)
7+
export ACR_NAME=$(terraform output -raw acr_name)
108
cd ..
9+
export SUBSCRIPTION_ID=$(az account show --query id --output tsv)
10+
export EMAIL="amini5454@gmail.com"
1111

1212
# Build Image
1313
az acr login --name $ACR_NAME
14-
ACR_URL=$(az acr show --name $ACR_NAME --query loginServer --output tsv)
15-
IMAGE=$ACR_URL/magic8ball:v1
14+
export ACR_URL=$(az acr show --name $ACR_NAME --query loginServer --output tsv)
15+
export IMAGE=$ACR_URL/magic8ball:v1
1616
docker build -t $IMAGE ./app --push
1717

1818
# Login
@@ -47,16 +47,13 @@ helm install prometheus prometheus-community/kube-prometheus-stack \
4747
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
4848
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false
4949

50-
export IMAGE
51-
export EMAIL
52-
echo $IMAGE
5350
kubectl create namespace magic8ball
5451
envsubst < quickstart-app.yml | kubectl apply -f -
5552

5653
# Add DNS Record
57-
publicIpAddress=$(kubectl get ingress magic8ball-ingress -n magic8ball -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
54+
PUBLIC_IP=$(kubectl get ingress magic8ball-ingress -n magic8ball -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
5855
az network dns record-set a add-record \
5956
--zone-name "contoso.com" \
6057
--resource-group $RESOURCE_GROUP \
6158
--record-set-name magic8ball \
62-
--ipv4-address $publicIpAddress
59+
--ipv4-address $PUBLIC_IP

scenarios/AksOpenAiTerraform/quickstart-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ apiVersion: networking.k8s.io/v1
6666
kind: Ingress
6767
metadata:
6868
name: magic8ball-ingress
69-
namespace: magic8ball
69+
namespace: ingress-nginx
7070
annotations:
7171
cert-manager.io/cluster-issuer: letsencrypt-dev
7272
spec:

scenarios/AksOpenAiTerraform/terraform/modules/aks/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ resource "azurerm_kubernetes_cluster" "main" {
3030
vnet_subnet_id = var.system_node_pool_subnet_id
3131
pod_subnet_id = var.pod_subnet_id
3232
zones = local.zones
33+
34+
upgrade_settings {
35+
max_surge = "10%"
36+
drain_timeout_in_minutes = 0
37+
node_soak_duration_in_minutes = 0
38+
}
3339
}
3440

3541
identity {

scenarios/AksOpenAiTerraform/terraform/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ output "cluster_name" {
66
value = module.aks.name
77
}
88

9+
output "workload_managed_identity_client_id" {
10+
value = azurerm_user_assigned_identity.aks_workload.client_id
11+
}
12+
913
output "acr_name" {
1014
value = module.container_registry.name
1115
}

scenarios/AksOpenAiTerraform/terraform/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,4 @@ variable "location" {
1111
variable "kubernetes_version" {
1212
type = string
1313
default = "1.30.7"
14-
}
15-
16-
variable "email" {
17-
type = string
18-
default = "ariaamini@microsoft.com"
1914
}

0 commit comments

Comments
 (0)