Skip to content

Conversation

@mestredelpino
Copy link

@mestredelpino mestredelpino commented Sep 9, 2025

Purpose

Adding a new lab - Application Gateway for Containers

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[X] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone https://github.com/mestredelpino/aks-labs
cd aks-labs
git checkout new-lab/application-gateway-for-containers
npm install
  • Test the code
npm start

What to Check

Verify that the following are valid:

View lab under Networking > Application Gateway for Containers
Run through lab

Other Information

Copilot AI review requested due to automatic review settings September 9, 2025 22:46
@mestredelpino mestredelpino marked this pull request as draft September 9, 2025 22:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new comprehensive lab documentation for Application Gateway for Containers (AGC) with Azure Kubernetes Service (AKS). The lab guides users through deploying and configuring AGC to expose applications over HTTP/HTTPS with advanced features like Web Application Firewall policies and traffic splitting for canary deployments.

  • Complete step-by-step guide for setting up Application Gateway for Containers with AKS
  • Integration with cert-manager for HTTPS certificate management using Let's Encrypt
  • Advanced features including WAF policy application and canary deployment implementation

@mestredelpino mestredelpino marked this pull request as ready for review September 10, 2025 20:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 4 changed files in this pull request and generated 9 comments.

kind: Gateway
metadata:
name: gateway-01
namespace: test-infra
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace 'test-infra' is used here, but the ApplicationLoadBalancer was created in namespace 'alb-test-infra' (line 204). This inconsistency will cause the Gateway to fail to find the referenced ALB resource.

Suggested change
namespace: test-infra
namespace: alb-test-infra

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no namespace called "test-infra" should this be alb-test-infra instead?

spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory # production endpoint
email: your-email@example.com
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The email address should be updated to use a placeholder format that clearly indicates users need to replace it with their actual email, such as 'your-email@example.com' or 'user@domain.com'.

Suggested change
email: your-email@example.com
email: <your-email@example.com>

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should note that the user should replace you-email@example.com placeholder with a real email address otherwise this ClusterIssuer will not work

While the current permissions are sufficient for creating the WAF Policy, the ALB controller is unable to join the policy to the HTTP route. Add a Network Contributor role with a scope matching the WAF Policy you just created:

```bash
az role assignment create --assignee-object-id $PRINCIPAL_ID --assignee-principal-type ServicePrincipal --scope $WAF_POLICY_ID --role "4d97b98b-1d4f-4787-a291-c67834d212e7" # Network Contributor
Copy link

Copilot AI Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WAF_POLICY_ID variable will contain quotes from the previous command (line 598), which will cause this role assignment to fail. This is another consequence of the missing '-o tsv' parameter in the previous command.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

mestredelpino and others added 6 commits September 11, 2025 17:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@pauldotyu pauldotyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not had a chance to complete this end-to-end yet but can you review my suggestions for setup as well as some of the Copilot suggestions?

CONTROLLER_NAMESPACE='azure-alb-system'
az aks get-credentials --resource-group $RG_NAME --name $AKS_NAME
CLIENT_ID=$(az identity show -g $RG_NAME -n $IDENTITY_RESOURCE_NAME --query clientId -o tsv)
helm install alb-controller oci://mcr.microsoft.com/application-lb/charts/alb-controller --namespace $HELM_NAMESPACE --version 1.7.9 --set albController.namespace=$CONTROLLER_NAMESPACE --set albController.podIdentity.clientID=$CLIENT_ID --create-namespace
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an issue with installing this version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced for latest version in the docs (1.8.12). Link to docs: https://learn.microsoft.com/en-us/azure/application-gateway/for-containers/quickstart-deploy-application-gateway-for-containers-alb-controller?tabs=install-helm-windows

Can you please check again with the new version?

Copy link
Collaborator

@pauldotyu pauldotyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mestredelpino I tried to go e2e with your lab instructions but was unable to get the cert-manager to work. Can you take a look at the comments here and resolve and let me know if you are able to run through the lab e2e?

# Install Azure CLI extensions.
az extension add --name alb
```

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding shared markdown to create resource group and AKS cluster.

Suggested change
<ProvisionResourceGroup />
<ProvisionAKSCluster />

Run the following command to create a new subnet containing at least 250 available IP addresses and enable subnet delegation for the Application Gateway for Containers association resource:

```bash
SUBNET_ADDRESS_PREFIX='10.239.1.0/24'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This subnet address prefix might not always work. The 10.239.1.0/24 network range overlaps with the aks-virtualkubelet subnet. So you might want to use 10.238.1.0/24 or revise how the user deploys AGC. IMO, I think the user should be deploying AKS into their own virtual network and subnet to avoid modifying anything in the managed resource group.



```bash
kubectl get applicationloadbalancer alb-test -n alb-test-infra -o yaml -w
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should put a note after this to let folks know how long it can take to update.

kind: Gateway
metadata:
name: gateway-01
namespace: test-infra
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no namespace called "test-infra" should this be alb-test-infra instead?

kind: Deployment
metadata:
name: ngcolor-blue
namespace: test-infra
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no namespace called "test-infra" at this point. Should it be "alb-test-infra" instead?

kind: HTTPRoute
metadata:
name: ngcolor-app
namespace: test-infra
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no namespace called "test-infra" at this point. Should it be "alb-test-infra" instead?

spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory # production endpoint
email: your-email@example.com
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should note that the user should replace you-email@example.com placeholder with a real email address otherwise this ClusterIssuer will not work

protocol: HTTPS
tls:
certificateRefs:
- name: letsencrypt-secret
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you follow the instructions up until this point, the secret is never deployed

az network application-gateway waf-policy create \
--name $WAF_POLICY_NAME \
--resource-group $MC_RG_NAME \
--location $LOCATION \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$LOCATION is not set nor is needed.

Suggested change
--location $LOCATION \

```

---

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add a summary here to recap the lab and include resources to learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants