-
Notifications
You must be signed in to change notification settings - Fork 119
[DO NOT MERGE] PoC: feat: AKS machine API integration #1102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
552f798
xpmt: AKS machine API integration
comtalyst 384fcbc
leftover merge conflict
comtalyst 9c863b9
remove AKS machines pool management
comtalyst eadbfbe
correct image id header
comtalyst 1abf4ba
fix: vm name format
comtalyst 9e3939f
fix: drop assumption on using vm name for GET AKS machine
comtalyst 92676e7
test: fix one small unit test setup
comtalyst 32bc93a
chore: resolve more merge conflicts
comtalyst a213bcf
feat: (from rebase) support FIPs + generic Ubuntu image family
comtalyst e125779
chore: fix json casing
comtalyst 22a84da
feat: ETag support on AKS machine + in-place update
comtalyst 706d0e9
chore: improve a comment
comtalyst 1e888b6
refactor: share code of setAdditionalAnnotationsForNewNodeClaim acros…
comtalyst 939f48b
chore: split InstancePromise definition to a separate file
comtalyst f2c8b87
refactor: common basic validation for retrieved AKS machine
comtalyst d0bddc3
chore: naming improvements
comtalyst e20d790
feat: handle cases where zone is not specified
comtalyst 433b5d2
refactor: some naming standardization
comtalyst bfa171c
chore: add a note on GET after initial PUT
comtalyst 2bf1283
chore: standardized AKS machine instance provider name
comtalyst f2ff173
refactor: rework artifact streaming enablement determination logic(?)
comtalyst 18ae208
test: fix custom VNet test per new VNet validation
comtalyst a0a16f8
test: fix managed tags to the correct karpenter.azure.com_cluster
comtalyst da64b28
test: add more unit tests for NIC garbage collection
comtalyst 8140155
chore: minor unit tests reorganization
comtalyst 5fa7468
test: fix small unit test
comtalyst aa18897
refactor: split test into multiple files
comtalyst 74f416e
refactor: categorize older tests
comtalyst 7dd7d09
chore: some linter fixes
comtalyst 3bec1d1
chore: more linter fixes
comtalyst e6afdb0
refactor: creation timestamp, SIG option validation, labels/naming TO…
comtalyst 041d304
test: update unit tests
comtalyst 56a2971
fix: formalize agentpool not found logic on list
comtalyst 6d09d14
fix: rework tags for creationtimestamp/name
comtalyst e88e1aa
test: fix one forgotten unit test break
comtalyst 08a5a97
feat: finalize NotFound API behaviors
comtalyst 2a29a76
fix: timestamp formats + misc + unit tests
comtalyst c21cd5b
chore: fix linters + some unit tests
comtalyst bb6d5aa
chore: update dev tools to support aksmachineapi
comtalyst 9cfc49c
fix: small fix for dev tools
comtalyst 5cc840c
temp: configure E2E actions for aks machine api
comtalyst 9c74045
chore: resolved a finished TODO
comtalyst 433e0ea
temp: use default VNET subnet ID
comtalyst 6b80b4b
fix: do not use auxiliary token client on ProvisionModeAKSMachineAPI
comtalyst bac0c11
chore: fix role assignment for aksmachine
comtalyst 95b320a
fix: also rehydrate machines in list
comtalyst 91cf3fc
fix: give default control of VnetSubnetID to server-side
comtalyst fe18503
refactor: rework method layering + error messages
comtalyst 1dc3191
refactor: misc
comtalyst 624f86d
feat: reachability toggle with no-client
comtalyst 0545a79
refactor: small linter change
comtalyst e32b069
refactor: rename AKS_MACHINES_REACHABLE to MANAGE_EXISTING_AKS_MACHINES
comtalyst 2172594
refactor: use custom azure-sdk-for-go-extensions
comtalyst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "go.testTimeout": "120s", | ||
| "go.testTimeout": "240s", | ||
| "gopls": { | ||
| "build.directoryFilters": [ | ||
| "-hack" | ||
|
|
||
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| if [ "$#" -ne 4 ]; then | ||
| echo "Usage: $0 <subscription-id> <resource-group> <cluster-name> <nodepool-name>" | ||
| echo "This script adds a nodepool with 'machines' mode to an existing AKS cluster using Azure REST API." | ||
| echo "Example:" | ||
| echo " $0 00000000-0000-0000-0000-000000000000 robin-aks-xpmt karpenter-sh-08302025 testmpool" | ||
| exit 1 | ||
| fi | ||
|
|
||
| AZURE_SUBSCRIPTION_ID=$1 | ||
| RESOURCE_GROUP=$2 | ||
| CLUSTER_NAME=$3 | ||
| NODEPOOL_NAME=$4 | ||
|
|
||
| echo "Adding nodepool '$NODEPOOL_NAME' with machines mode to cluster '$CLUSTER_NAME' in resource group '$RESOURCE_GROUP'..." | ||
|
|
||
| # Get access token | ||
| echo "Getting access token..." | ||
| ACCESS_TOKEN=$(az account get-access-token --query accessToken --output tsv) | ||
|
|
||
| # REST API endpoint | ||
| API_VERSION="2025-07-01" | ||
| URL="https://management.azure.com/subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${RESOURCE_GROUP}/providers/Microsoft.ContainerService/managedClusters/${CLUSTER_NAME}/agentPools/${NODEPOOL_NAME}?api-version=${API_VERSION}" | ||
|
|
||
| # Request body with machines mode | ||
| REQUEST_BODY=$(cat <<EOF | ||
| { | ||
| "properties": { | ||
| "mode": "Machines", | ||
| } | ||
| } | ||
| EOF | ||
| ) | ||
|
|
||
| echo "Making REST API call..." | ||
| echo "URL: $URL" | ||
| echo "Request Body:" | ||
| echo "$REQUEST_BODY" | ||
|
|
||
| # Make the REST API call | ||
| RESPONSE=$(curl -X PUT \ | ||
| -H "Authorization: Bearer $ACCESS_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "$REQUEST_BODY" \ | ||
| "$URL" \ | ||
| -w "\n%{http_code}" \ | ||
| -s) | ||
|
|
||
| # Extract HTTP status code from response | ||
| HTTP_CODE=$(echo "$RESPONSE" | tail -n1) | ||
| RESPONSE_BODY=$(echo "$RESPONSE" | head -n -1) | ||
|
|
||
| echo "HTTP Status Code: $HTTP_CODE" | ||
| echo "Response:" | ||
| echo "$RESPONSE_BODY" | jq '.' 2>/dev/null || echo "$RESPONSE_BODY" | ||
|
|
||
| if [[ "$HTTP_CODE" == "200" ]] || [[ "$HTTP_CODE" == "201" ]]; then | ||
| echo "✅ Successfully added nodepool '$NODEPOOL_NAME' with machines mode" | ||
| else | ||
| echo "❌ Failed to add nodepool. HTTP Status: $HTTP_CODE" | ||
| exit 1 | ||
| fi |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be split out into a separate PR probably that just does this?