Skip to content

aksd: Add support for AKS Hybrid and Edge clusters#782

Open
yolossn wants to merge 1 commit into
mainfrom
baremetal-clusters-v2
Open

aksd: Add support for AKS Hybrid and Edge clusters#782
yolossn wants to merge 1 commit into
mainfrom
baremetal-clusters-v2

Conversation

@yolossn

@yolossn yolossn commented Jul 21, 2026

Copy link
Copy Markdown
Member

Description

This PR adds support for adding AKS Hybrid/Edge cluster via cluster setup and manage the proxies required for accessing them.

image image image image image

Test Cases:

TC-01 — Add an AKS Hybrid/Edge cluster

Goal: Register an Arc-connected cluster and open it successfully.

Steps:

  1. Go to Add Cluster.
  2. Choose the Azure Kubernetes Service provider.
  3. Select the subscription, then select an Arc-connected (AKS Hybrid/Edge) cluster.
  4. Register the cluster.
  5. Return to the Home cluster list and confirm the cluster is listed with the
    distinct AKS Hybrid/Edge badge.
  6. Open the cluster.

Expected:

  • The cluster registers and appears in Home.
  • The cluster should be accessible.

TC-02 — Start / Stop the proxy from the cluster menu

Goal: The cluster action-menu item starts and stops the proxy, and its label
reflects the live connection state.

Preconditions: An Arc cluster is registered (TC-01).

Steps:

  1. In the Home list, open the Arc cluster's action menu.
  2. Observe the proxy menu item's label while it probes reachability.
  3. With the proxy running (cluster reachable), confirm the item shows Stop; click it.
  4. Verify the cluster is no longer reachable (menu item now offers Start; browsing the
    cluster prompts to reconnect). Confirm no connectedk8s proxy process remains (see check above).
  5. Open the menu again and click Start; let the start dialog run
    (Starting → Verifying).

Expected:

  • While probing, the menu item is a disabled placeholder (label doesn't flip).
  • Shows Stop when the proxy is up and Start when it's down.
  • Stop tears the proxy down (process gone; cluster unreachable).
  • Start brings the proxy back up and the cluster becomes reachable again.

TC-03 — Restart the app; pre-open re-establishes the proxy

Goal: After a full restart (proxy is not persisted), simply opening the cluster
re-creates its proxy automatically via the pre-open hook.

Preconditions: An Arc cluster registered and previously opened (TC-01).

Steps:

  1. Fully quit AKS Desktop (not just close the window).
  2. Confirm no connectedk8s proxy / arcproxy process is running (see check above).
  3. Relaunch the app and sign in if prompted.
  4. From Home, open the Arc cluster (do not manually start the proxy).

Expected:

  • On open, the pre-open hook automatically starts the proxy, verifies reachability,
    and the cluster's resources load — with no manual proxy start required.

TC-04 — Proxy is stopped after the app is closed

Goal: Closing the app tears down all proxies (nothing left running in the background).

Preconditions: One or more Arc clusters opened with active proxies (TC-01 / TC-04).

Steps:

  1. Confirm one or more connectedk8s proxy processes are running (see check above).
  2. Fully quit AKS Desktop (quit the app / exit from the tray — not just closing the window).
  3. Re-run the process check.

Expected:

  • After the app fully exits, no connectedk8s proxy and no child arcproxy
    daemon processes remain, and the proxy port(s) are freed.

TC-05 — Multiple Arc clusters accessed at once (combined multi-cluster view)

Goal: Two or more Arc clusters can be selected together and viewed in the
combined multi-cluster view, which requires all their proxies to be up at once.

Preconditions: At least two Arc clusters registered (repeat TC-01).

Steps:

  1. Make sure Arc cluster A and Arc cluster B both have their proxy up and the
    status shows Active (start each from the cluster menu if needed).
  2. Open the cluster chooser and select multiple clusters — tick both Arc
    cluster A and Arc cluster B (multi-select checkboxes), then confirm.
  3. Confirm the app enters the combined view (the URL/route covers both clusters,
    e.g. .../c/A+B/..., and the sidebar reflects multiple selected clusters).
  4. Confirm both proxies are running (see check above — expect two proxy processes).
  5. Open a resource list that aggregates across clusters (e.g. Nodes or Pods).

Expected:

  • Both Arc clusters can be selected simultaneously; opening B's proxy does not drop
    A's (no port conflict — two proxy processes coexist).
  • The combined view lists resources from both clusters together, each row
    attributed to its source cluster; no re-login or manual proxy restart is needed.

Related: #781

Copilot AI review requested due to automatic review settings July 21, 2026 05:11

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 adds first-class support in the AKS Desktop plugin for Arc-connected AKS Hybrid & Edge clusters, including discovery via az connectedk8s list, cluster-type metadata persisted in cluster settings, and UI + pre-open flows to manage and verify the required local proxy.

Changes:

  • Add an aksarc cluster discriminator + Azure metadata to persisted cluster settings, and apply a distinct Home badge appearance for Hybrid/Edge clusters.
  • Discover Arc-connected clusters, surface them alongside managed AKS clusters in the registration flow, and add proxy start/stop controls + a pre-open hook to automatically re-establish connectivity.
  • Add unit tests/a11y tests for Arc discovery and proxy flows, plus i18n updates for new UI strings.

Reviewed changes

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

Show a summary per file
File Description
plugins/aks-desktop/src/utils/shared/clusterSettings.ts Extend persisted cluster settings with cluster type/Azure metadata and add helper to set a distinct badge appearance.
plugins/aks-desktop/src/utils/azure/az-clusters.ts Add getConnectedClusters() to discover Arc-connected clusters via az connectedk8s list.
plugins/aks-desktop/src/utils/azure/az-clusters.test.ts Unit tests for getConnectedClusters() filtering + resilience behavior.
plugins/aks-desktop/src/utils/azure/aksHybridEdgeProxy.test.ts Unit tests for proxy start/stop IPC intents and verification helpers.
plugins/aks-desktop/src/utils/azure/aks.ts Merge managed AKS clusters with Arc-connected clusters and surface clusterType/connectivity metadata.
plugins/aks-desktop/src/utils/azure/aks.test.ts Unit tests covering AKS + Arc merge and resilience to Arc discovery failure.
plugins/aks-desktop/src/index.tsx Register cluster-provider menu item, dialog, and pre-open hook for Hybrid/Edge proxy lifecycle.
plugins/aks-desktop/src/headlamp-plugin.d.ts Local type augmentation for the new registerClusterProviderPreOpen extension point.
plugins/aks-desktop/src/components/CreateAKSProject/hooks/useExtensionCheck.ts Generalize extension-check hook to support checking/installing arbitrary az extensions.
plugins/aks-desktop/src/components/AksHybridEdge/AksHybridEdgeProxyControls.tsx Add cluster menu item + dialog to start/stop and verify the Arc proxy, including portal remediation link.
plugins/aks-desktop/src/components/AksHybridEdge/AksHybridEdgeProxyControls.guidepup.test.tsx Guidepup + axe a11y coverage for menu item/dialog states.
plugins/aks-desktop/src/components/AksHybridEdge/aksHybridEdgePreOpen.ts Pre-open hook to auto-start/verify proxy on cluster open; also guides users for manually-added Arc-proxy contexts.
plugins/aks-desktop/src/components/AksHybridEdge/aksHybridEdgePreOpen.test.ts Unit tests for Arc-proxy detection and pre-open behavior.
plugins/aks-desktop/src/components/AKS/RegisterAKSClusterDialogPure.tsx Registration UI updates: show Hybrid/Edge badges, disable offline Arc clusters, and display selected cluster type.
plugins/aks-desktop/src/components/AKS/RegisterAKSClusterDialog.tsx Hybrid/Edge registration path: extension gate, start proxy, verify reachability, persist metadata + badge.
plugins/aks-desktop/locales/en/translation.json Add/organize new strings for Hybrid/Edge discovery + proxy UI and related messaging.
plugins/aks-desktop/locales/de/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/es/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/fr/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/id/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/it/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/ja/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/ko/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/nl/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/pt-BR/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/pt-PT/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/ru/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/sv/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/tr/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/zh-Hans/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).
plugins/aks-desktop/locales/zh-Hant/translation.json Add new keys for Hybrid/Edge/proxy UI (placeholders for translation where applicable).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/aks-desktop/src/utils/azure/aks.ts
Comment thread plugins/aks-desktop/src/utils/azure/az-clusters.ts Outdated
Copilot AI review requested due to automatic review settings July 21, 2026 05:19
@yolossn
yolossn force-pushed the baremetal-clusters-v2 branch from 0dfcff5 to 00e2718 Compare July 21, 2026 05:19

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

Copilot reviewed 37 out of 38 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

plugins/aks-desktop/src/utils/azure/aks.ts:105

  • isAzureRBACEnabled is derived as cluster.aadProfile !== null, but getClusters() returns simplified cluster objects that do not include aadProfile. That makes undefined !== null evaluate to true, so clusters are incorrectly marked as Azure RBAC enabled (including AKS Hybrid & Edge entries). Use a boolean coercion (or explicit null/undefined check) instead of !== null.

Comment thread plugins/aks-desktop/src/components/AKS/RegisterAKSClusterDialog.tsx
@yolossn
yolossn force-pushed the baremetal-clusters-v2 branch from 00e2718 to 4de7cf3 Compare July 21, 2026 05:30
Copilot AI review requested due to automatic review settings July 21, 2026 07:40
@yolossn
yolossn force-pushed the baremetal-clusters-v2 branch from 4de7cf3 to 5fc799d Compare July 21, 2026 07:40

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

Copilot reviewed 36 out of 37 changed files in this pull request and generated 1 comment.

Comment thread plugins/aks-desktop/src/utils/shared/clusterSettings.ts

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

Copilot reviewed 36 out of 37 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

plugins/aks-desktop/src/utils/shared/clusterSettings.ts:11

  • The clusterType doc comment says 'aks' is persisted for managed clusters, but there’s no code writing clusterType: 'aks' (search in plugins/aks-desktop/src finds no such assignment). In this PR, managed clusters appear to be identified by an unset clusterType, so the comment is misleading and could cause incorrect assumptions when adding future features.

Copilot AI review requested due to automatic review settings July 22, 2026 08:09

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

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

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.

3 participants