Skip to content

Add cross-platform aks-flex-config binaries - #284

Open
Julien Stroheker (julienstroheker) wants to merge 2 commits into
Azure:mainfrom
julienstroheker:juliens/aks-flex-config-xplat
Open

Add cross-platform aks-flex-config binaries#284
Julien Stroheker (julienstroheker) wants to merge 2 commits into
Azure:mainfrom
julienstroheker:juliens/aks-flex-config-xplat

Conversation

@julienstroheker

@julienstroheker Julien Stroheker (julienstroheker) commented Aug 21, 2026

Copy link
Copy Markdown

This PR adds a native, cross-platform aks-flex-config CLI and documents a Windows/PowerShell onboarding path for AKS Flex Node.

image

The existing Python helper remains available for compatibility with current labs and automation.

Changes

  • Added a native Go implementation of aks-flex-config.
  • Kept the binary entry point small under aks-flex-config.
  • Moved Cobra command construction and implementation into config.
  • Preserved the existing helper interface:
    • setup-node-rbac
    • generate-node-config
    • Bootstrap token, managed identity, service principal, and Arc options
    • Existing configuration fields and defaults
  • Added unit tests covering

Release artifacts

Integrated the config helper into the existing release build matrix and added these raw release assets:

  • aks-flex-config-windows-amd64.exe
  • aks-flex-config-darwin-amd64
  • aks-flex-config-darwin-arm64
    The Linux aks-flex-node agent continues to be released as amd64 and arm64 tarballs. All artifacts are included in release checksums.

Documentation

Updated the quickstart and config-helper guide with collapsible platform-specific instructions:

  • Windows PowerShell variable setup, download, config generation, SCP, SSH, verification, and cleanup
  • Native macOS download instructions for Intel and Apple Silicon
  • Clear separation between the operator workstation and the Linux Flex Node host
  • Windows ACL guidance for generated configuration files

E2E coverage

Added a deterministic parity test that:

  • Builds the native helper on the E2E runner
  • Runs both the Python helper and native binary
  • Supplies identical mocked Azure CLI metadata
  • Compares both outputs with an explicit expected configuration
  • Canonicalizes JSON before comparison

The parity check runs before Azure login and does not mutate cloud or Kubernetes resources.

Copilot AI lite review requested due to automatic review settings August 21, 2026 00:17
@github-actions

Copy link
Copy Markdown

Thanks for the contribution! This pull request comes from a fork, so the Azure E2E workflow is intentionally skipped for security reasons.

Merge will remain blocked until the E2E tests have been run from a branch in the Azure/AKSFlexNode repository by a maintainer/contributor with access to this repo.

Maintainer options:

  1. Review the fork changes.
  2. Push the trusted commit to a branch in Azure/AKSFlexNode.
  3. Run the E2E Tests workflow from that same-repository branch, or open a same-repository PR so the workflow can run automatically.

We do not run Azure E2E directly from fork PR code because it requires Azure OIDC access.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a native Go aks-flex-config CLI to generate AKS Flex Node configuration from workstation-side AKS metadata, adds cross-platform release artifacts (Windows/macOS), and updates documentation + CI to validate parity with the existing Python helper.

Changes:

  • Added a new Go-based aks-flex-config command (Cobra) with RBAC setup and config generation modes, plus unit tests.
  • Expanded build/release automation to produce raw Windows/macOS helper binaries alongside existing Linux agent tarballs.
  • Updated docs/quickstart with Windows PowerShell and macOS native-binary onboarding, and added an E2E parity check script.

Reviewed changes

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

Show a summary per file
File Description
README.md Adds platform-specific workstation instructions (PowerShell/macOS native helper).
pkg/cmd/config/config.go Implements the Go aks-flex-config command logic (RBAC + config generation).
pkg/cmd/config/config_test.go Adds unit tests for command wiring, auth-mode validation, bootstrap-token generation, and file writing.
Makefile Adds build targets for config helper cross-platform binaries and cleans helper artifacts.
hack/e2e/config-helper-parity.sh Adds deterministic parity test comparing Python helper output vs native binary output.
docs/usages/aks-flex-config.md Documents Python + native helper usage and platform-specific prerequisites/steps.
cmd/aks-flex-config/main.go Adds the standalone aks-flex-config binary entry point.
.github/workflows/release.yml Extends release matrix to build/publish helper binaries (raw) plus existing Linux tarballs (packaged).
.github/workflows/e2e-tests.yml Runs the new parity validation before Azure login in E2E workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/cmd/config/config.go
Comment on lines +40 to +51
func (runner execRunner) Run(ctx context.Context, name string, args []string, input string) (string, error) {
cmd := exec.CommandContext(ctx, name, args...) // #nosec G204 -- executable names are fixed to az and kubectl
if input != "" {
cmd.Stdin = strings.NewReader(input)
}
cmd.Stderr = runner.stderr
output, err := cmd.Output()
if err != nil {
return "", err
}
return strings.TrimSpace(string(output)), nil
}
Comment on lines +3 to +15
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"

configcmd "github.com/Azure/AKSFlexNode/pkg/cmd/config"
)

func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
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