Repository navigation
Add configurable and basic AKS cluster scripts and seed the blob samples - #46
Merged
Merged
Conversation
01-configurable-cluster.sh asks which optional features to provision, with a default and an environment variable for every question; pressing Enter provisions the same features as the two existing cluster scripts. It supports --dry-run and --yes, creates independent resources in parallel, and stops before creating anything when an existing cluster was built with different answers. 01-basic-cluster.sh creates the smallest cluster that runs every sample's default path, without questions. scripts/README.md documents the scripts and the variables, and the root README lists the new scripts. The existing scripts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
01-basic-cluster.sh now passes --disable-file-driver, --disable-disk-driver and --disable-snapshot-controller to save provisioning time, and enables Microsoft Entra ID authentication with Azure RBAC, with the admin groups taken from AAD_ADMIN_GROUP_OBJECT_IDS. It no longer runs the step that re-enabled the Azure Files driver, and it warns that the Azure Files and in-cluster PostgreSQL samples need the drivers it turns off. 01-configurable-cluster.sh asks whether to enable the Azure Files and the Azure Disk CSI drivers, both defaulting to yes. Both scripts compare the two drivers when they find an existing cluster. The samples' 01-deploy-resources.sh scripts pass --admin-enabled true without quotes, as the cluster scripts do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
01-basic-cluster.sh now creates its node pool with the cluster autoscaler, between 1 and 3 nodes as in the original scripts, so the cluster grows when several samples share it. The summary, the existing-cluster check and both READMEs say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
…lace Both cluster scripts warn when kubelogin is missing (the configurable one only with Entra ID on), because on Azure kubectl signs in to a cluster with Entra ID through it. When the final kubectl call cannot reach the cluster, they now say what is needed: kubelogin and an account in one of the admin groups. Both READMEs say the same. The configurable script's existing-cluster check no longer rejects a cluster whose Azure Files CSI driver is off when the run wants it on: the repair step turns the driver on with az aks update, as the original scripts do. It also adds the Microsoft.Storage service endpoint only with the Azure Files CSI driver, whose NFS volumes are its only user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
Both original cluster scripts enable Entra ID, so on Azure kubectl signs in to the cluster through kubelogin. They now print the same warning as the configurable and basic scripts when it is not installed. It is a warning, not an error: the emulator does not need kubelogin, and the samples workflow runs 01-system-assigned-managed-identity.sh without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
01-deploy-resources.sh, Python and .NET, now uploads three sample activities to the activities container right after creating it, so the app does not start with an empty list. Each one is a blob in the format the app reads and writes, YYYY-MM-DD-HH-MM-SS-activity.txt holding the activity text, with the names and texts the web-app-file-storage sample seeds. The names are fixed, so a re-run uploads only the missing ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
01-deploy-resources.sh, Python and .NET, now uploads the same three sample activities as the managed identity sample right after creating the activities container, one blob each in the format the app reads and writes, so the app does not start with an empty list. A re-run uploads only the missing ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Existing-cluster checks silently accept administrator-group and node-sizing changes without applying them or reporting mismatches.
2 open issues
What changed in this PR
Adds lightweight and configurable AKS provisioning options alongside the existing full-cluster scripts, and seeds the blob-backed samples so they start with example activities.
Changes:
- Adds basic and configurable cluster scripts with dry-run support, existing-cluster checks, and feature documentation.
- Adds missing-kubelogin warnings to the original cluster scripts.
- Seeds three activities in the Python and .NET blob-backed samples and normalizes registry flags without changing their behavior.
| File | Description |
|---|---|
| scripts/README.md | Documents cluster options, variables, and sample requirements. |
| scripts/01-user-assigned-managed-identity.sh | Adds a missing-kubelogin warning. |
| scripts/01-system-assigned-managed-identity.sh | Adds a missing-kubelogin warning. |
| scripts/01-configurable-cluster.sh | Adds configurable provisioning and parallel resource creation. |
| scripts/01-basic-cluster.sh | Adds lightweight demo-cluster provisioning. |
| samples/web-app-sql-database/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-sql-database/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-postgresql-flexible-server/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-postgresql-flexible-server/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-mysql-flexible-server/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-mysql-flexible-server/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-managed-identity/python/scripts/01-deploy-resources.sh | Seeds missing activities and normalizes the registry flag. |
| samples/web-app-managed-identity/python/README.md | Documents activity seeding. |
| samples/web-app-managed-identity/dotnet/scripts/01-deploy-resources.sh | Seeds missing activities and normalizes the registry flag. |
| samples/web-app-managed-identity/dotnet/README.md | Documents activity seeding. |
| samples/web-app-in-cluster-postgresql/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-in-cluster-postgresql/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-file-storage/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-file-storage/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-cosmosdb-nosql-api/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-cosmosdb-nosql-api/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-cosmosdb-mongodb-api/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-cosmosdb-mongodb-api/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-blob-storage/python/scripts/01-deploy-resources.sh | Seeds missing activities and normalizes the registry flag. |
| samples/web-app-blob-storage/python/README.md | Documents activity seeding. |
| samples/web-app-blob-storage/dotnet/scripts/01-deploy-resources.sh | Seeds missing activities and normalizes the registry flag. |
| samples/web-app-blob-storage/dotnet/README.md | Documents activity seeding. |
| samples/web-app-app-configuration/python/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| samples/web-app-app-configuration/dotnet/scripts/01-deploy-resources.sh | Normalizes the registry admin flag. |
| README.md | Introduces all four cluster scripts and authentication requirements. |
Review effort: Balanced
When local-aks-test already exists, 01-basic-cluster.sh and 01-configurable-cluster.sh now compare its Entra ID admin groups with AAD_ADMIN_GROUP_OBJECT_IDS, in any order and letter case, and stop before creating anything when they differ. A re-run with other groups used to report a match and leave the old groups in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
When local-aks-test already exists, 01-configurable-cluster.sh now compares each node pool's size with the answers before creating anything: the autoscaler range when the autoscaler is on, since the autoscaler itself changes the node count, and the node count when it is off. It checks the user pool when the cluster has one and the run wants one. A re-run with another node count used to report a match and change nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
tutorials/terraform/tags-labels-taints pinned azurerm 4.81.0 and azapi 2.10.0. azurerm 5 needs two changes to keep the same cluster: - azurerm_kubernetes_cluster now requires a node_provisioning_profile block. It is set to mode = "Manual", the AKS default, so node auto-provisioning stays off as before. - The provider no longer registers resource providers by default. On Azure the stack sets resource_provider_registrations = "legacy", the 4.x behaviour; the emulator keeps "none". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
web-app-postgresql-flexible-server and web-app-app-configuration now create their flexible server with PG_VERSION 18, generally available on Azure since January 2026 and the engine the emulator runs for every flexible server. web-app-in-cluster-postgresql runs the postgres:18 image: its StatefulSet sets PGDATA explicitly, so the image's new default data directory does not apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes SMF-969
Changes
Two new cluster scripts next to the two production-like ones, a kubelogin check in all four, three sample activities in the two blob samples, PostgreSQL 18 in the three PostgreSQL samples, and the Terraform tutorial on azurerm 5.
scripts/01-configurable-cluster.shasks, or reads from environment variables, which features to provision: identity, network plugin and policy, cluster autoscaler, Workload ID, Key Vault with the CSI secrets provider, Container Insights, custom virtual network and Bastion, user node pool and availability zones, KEDA, Gateway API (optionally with NGINX Gateway Fabric and cert-manager), Entra ID with Azure RBAC, and the Azure Files and Azure Disk CSI drivers.--dry-runprints every command and runs none;--yesruns unattended.local-aks-testalready exists with a different configuration, including other Entra ID admin groups or other node pool sizes (the node count, or the autoscaler range when the autoscaler is on), it stops before creating anything and lists the differences.scripts/01-basic-cluster.shasks nothing: system-assigned identity, Azure CNI Overlay with the Azure network policy, one node with the cluster autoscaler (1 to 3 nodes), Workload ID, Entra ID with Azure RBAC (admin groups fromAAD_ADMIN_GROUP_OBJECT_IDS), ACNS and the attached registry.web-app-file-storageandweb-app-in-cluster-postgresqldo not run on it.local-aks-testalready exists with other settings, including other Entra ID admin groups, it stops before creating anything and lists the differences.kubectlon Azure signs in through kubelogin. All four scripts warn when it is missing; it is only a warning, because the emulator and this CI do not need it. When the finalkubectlcall of a new script fails, the script says what Azure needs: kubelogin and an account in one of the admin groups.activitiescontainer,01-deploy-resources.shuploads three activities, one blob each, with the names and textsweb-app-file-storageseeds, so the app does not start empty. A re-run uploads only the missing ones.web-app-postgresql-flexible-serverandweb-app-app-configurationcreate their flexible server with version 18, generally available on Azure since January 2026 and the engine the emulator runs for every flexible server.web-app-in-cluster-postgresqlruns thepostgres:18image; its StatefulSet setsPGDATAexplicitly, so the image's new default data directory does not apply.tutorials/terraform/tags-labels-taintsmoves from azurerm 4.81.0 and azapi 2.10.0 to azurerm 5.10.0 and azapi 2.13.0. azurerm 5 requires anode_provisioning_profileblock, set tomode = "Manual", the AKS default, so the cluster does not change. It also no longer registers resource providers by default, so on Azure the stack setsresource_provider_registrations = "legacy", the 4.x behaviour.Evidence
On the LocalStack for Azure emulator:
printf '1\n\n\n' | ./01-system-assigned-managed-identity.sh, took 456 s.After:
./01-basic-cluster.sh --yestook 155 to 180 s, over 9 runs.tests/test-vacation-planner.shon its own new basic cluster: app-configuration, blob-storage, cosmosdb-mongodb-api, cosmosdb-nosql-api, managed-identity, mysql-flexible-server, postgresql-flexible-server, sql-database../01-configurable-cluster.sh --yes </dev/nullprovisioned the original scripts' features. Run against a basic cluster with the Azure Files driver wanted, it turned the driver on in place.PATH, the CI's cluster command printed the warning first and still finished with exit 0.AAD_ADMIN_GROUP_OBJECT_IDSstop the run withEntra ID admin groups: cluster has [...], this run wants [...].01-configurable-cluster.shwithSYSTEM_NODE_COUNT=5stops withSystem pool autoscaler range: cluster has [1-3], this run wants [1-5].deploy.shpassed 25 of its 26 checks. The failing one, a no-op plan right after apply, is documented indeploy.shas failing on the emulator.web-app-managed-identitypassedtests/test-vacation-planner.shon that cluster, andterraform destroyremoved all 16 resources.Nothing was run on Azure.
Merge Danger
Door: two-way
The new scripts are opt-in, and the other changes add to existing scripts.
Blast Radius: small
scripts/01-system-assigned-managed-identity.sh, so CI runs all 20 sample jobs.01-deploy-resources.shnow stop with exit 1 when a sample upload fails.terraform initafter this change needs-upgrade(itsdeploy.shalready passes it).🤖 Generated with Claude Code
https://claude.ai/code/session_015kq47SouBiqFa1ffW7jEDQ