Skip to content

Commit 7b693a1

Browse files
committed
Working AKS with EasyAuth, changed Ingress classes to webapprouting
1 parent 7ccaa68 commit 7b693a1

File tree

7 files changed

+19
-52
lines changed

7 files changed

+19
-52
lines changed

app/backend/manifests/ingress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Ingress
33
metadata:
44
name: ingress-api
55
namespace: azure-open-ai
6-
# annotations:
6+
# annotations:
77
# nginx.ingress.kubernetes.io/use-regex: "true"
88
# nginx.ingress.kubernetes.io/rewrite-target: /$2
99
spec:

app/frontend/Dockerfile-aks

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ FROM nginx:alpine
1414

1515
WORKDIR /usr/share/nginx/html
1616
COPY --from=build /app/build .
17-
COPY --from=build /app/nginx/default.conf /etc/nginx/conf.d
1817

1918
EXPOSE 80
2019

app/frontend/nginx/default.conf

Lines changed: 0 additions & 11 deletions
This file was deleted.

deploy/aks/azure.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,4 @@ hooks:
5858
shell: pwsh
5959
run: ./scripts/easyauth.ps1
6060
interactive: true
61-
continueOnError: false
62-
postdown:
63-
windows:
64-
shell: pwsh
65-
run: ./scripts/easyauth-down.ps1
66-
interactive: true
67-
continueOnError: false
61+
continueOnError: false

deploy/aks/easyauth/easyauth-ingress.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ metadata:
88
nginx.ingress.kubernetes.io/auth-response-headers: "x-injected-userinfo,x-injected-name,x-injected-oid,x-injected-preferred-username,x-injected-sub,x-injected-tid,x-injected-email,x-injected-groups,x-injected-scp,x-injected-roles,x-injected-graph"
99
cert-manager.io/cluster-issuer: letsencrypt
1010
#nginx.ingress.kubernetes.io/rewrite-target: "/$1"
11-
kubernetes.io/ingress.class: "nginx"
1211
spec:
13-
ingressClassName: nginx
12+
ingressClassName: webapprouting.kubernetes.azure.com
1413
tls:
1514
- hosts:
16-
- aks-openai-easy-auth-proxy.westeurope.cloudapp.azure.com
17-
secretName: aks-openai-easy-auth-proxy.westeurope.cloudapp.azure.com-tls
15+
- aks-openai-demo-easy-auth-proxy.westeurope.cloudapp.azure.com
16+
secretName: aks-openai-demo-easy-auth-proxy.westeurope.cloudapp.azure.com-tls
1817
rules:
19-
- host: aks-openai-easy-auth-proxy.westeurope.cloudapp.azure.com
18+
- host: aks-openai-demo-easy-auth-proxy.westeurope.cloudapp.azure.com
2019
http:
2120
paths:
2221
- path: /api

deploy/aks/scripts/easyauth-down.ps1

Lines changed: 0 additions & 24 deletions
This file was deleted.

deploy/aks/scripts/easyauth.ps1

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ kubectl get pods -n cert-manager
123123
# Deploy the issuer config to the cluster
124124
kubectl apply -f ./easyauth/cluster-issuer.yaml
125125

126+
$clientId = $appId
127+
126128
# ---------------------
127129
# Deploy Easy Auth Proxy
128130
helm install --set azureAd.tenantId=$azureTenantId --set azureAd.clientId=$clientId --set secret.name=easyauth-proxy-$adAppName-secret --set secret.azureclientsecret=$clientSecret --set appHostName=$appHostName --set tlsSecretName=$tlsSecretName easyauth-proxy-$adAppName ./easyauth/easyauth-proxy
@@ -142,7 +144,7 @@ metadata:
142144
cert-manager.io/cluster-issuer: letsencrypt
143145
#nginx.ingress.kubernetes.io/rewrite-target: "/`$1"
144146
spec:
145-
ingressClassName: nginx
147+
ingressClassName: webapprouting.kubernetes.azure.com
146148
tls:
147149
- hosts:
148150
- ${appHostName}
@@ -174,7 +176,7 @@ $easyauthIngressYaml | Out-File -FilePath ./easyauth/easyauth-ingress.yaml
174176
kubectl apply -f ./easyauth/easyauth-ingress.yaml
175177

176178
# Remove old ingress without auth
177-
#kubectl delete ingress ingress-api -n 'azure-open-ai'
179+
kubectl delete ingress ingress-api -n 'azure-open-ai'
178180

179181
azd env set "AZURE_AD_APP_NAME" $adAppName
180182
azd env set "AZURE_AD_APP_ID" $appId
@@ -202,4 +204,12 @@ Configuration AKS details:
202204
- TLS Secret Name: $tlsSecretName
203205
"@
204206

205-
$easyAuthConfig | Out-File -FilePath ./easyauth/config-output.md
207+
Write-Host $easyAuthConfig
208+
209+
# Add annotation to ALL ingress
210+
# kubectl annotate ingress azure-open-ai/cm-acme-http-solver-s9fkg
211+
# with class webapprouting.kubernetes.azure.com
212+
# spec-->ingressClassName: webapprouting.kubernetes.azure.com
213+
# --> investigate http applicaton routing
214+
# --> ingresses do not map to the host (are not exposed)
215+

0 commit comments

Comments
 (0)