Skip to content

Add AKS (Azure Kubernetes Service) support#1027

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/add-aks-support
Draft

Add AKS (Azure Kubernetes Service) support#1027
Copilot wants to merge 4 commits intomasterfrom
copilot/add-aks-support

Conversation

Copy link

Copilot AI commented Oct 14, 2025

This PR adds comprehensive support for Azure AKS clusters to kdiscover, addressing issue #XX.

What's Added

New Commands

  • kubectl discover aks list --azure-subscriptions <subscription-id> - List AKS clusters across Azure subscriptions
  • kubectl discover aks update --azure-subscriptions <subscription-id> - Update kubeconfig with AKS cluster credentials

Key Features

  • Multi-subscription support: Discover clusters across multiple Azure subscriptions using comma-separated subscription IDs
  • Azure authentication: Uses Azure's default credential chain (Azure CLI, managed identity, environment variables, etc.)
  • Consistent UX: Same command patterns, table output format, and error handling as existing AWS EKS support
  • Robust error handling: Clear error messages for missing subscriptions, authentication failures, and other common issues

Implementation Details

The implementation follows the same architectural patterns as the existing AWS support:

  • Azure SDK integration: Uses official Azure SDK for Go to discover and manage AKS clusters
  • Authentication: Leverages kubelogin for AKS cluster authentication in generated kubeconfig
  • Concurrent discovery: Parallel cluster discovery across multiple subscriptions for performance
  • Backup functionality: Automatically backs up existing kubeconfig before updates

Examples

List AKS clusters

kubectl discover aks list --azure-subscriptions subscription-id-123
┌────────────────────────────────────────────────────────────────────────────────┐
│     cluster name                  region              status  exported locally │
├────────────────────────────────────────────────────────────────────────────────┤
│  1  production-aks                eastus              Succeeded       No       │
│  2  staging-aks                   westus2             Succeeded       No       │
│  3  dev-aks                       centralus           Succeeded       No       │
├────────────────────────────────────────────────────────────────────────────────┤
│                                   number of clusters  3                        │
└────────────────────────────────────────────────────────────────────────────────┘

Update kubeconfig with AKS clusters

kubectl discover aks update --azure-subscriptions subscription-id-123
Update all AKS Clusters
Found 3 clusters remote
Backup kubeconfig to /Users/user/.kube/config.bak
Updated kubeconfig at /Users/user/.kube/config

Testing

  • Comprehensive unit tests for Azure package functionality
  • Integration tests for cluster discovery and kubeconfig management
  • Manual testing with dummy subscriptions validates error handling
  • All existing tests continue to pass

Breaking Changes

None. This is a purely additive change that doesn't affect existing AWS functionality.

Documentation

  • Updated README.md with AKS examples and feature description
  • Updated help text to reflect multi-cloud support
  • Added inline documentation for all new functions
Original prompt

This section details on the original issue you should resolve

<issue_title>add AKS support </issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
AKS has a good share of cloud usage.

Describe the solution you'd like
kubectl discover aks ...

</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #42


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@lintrule-review
Copy link

You're out of free credits.

You can fix that by putting in a card here.

Copilot AI and others added 3 commits October 14, 2025 11:52
Co-authored-by: mateimicu <4560298+mateimicu@users.noreply.github.com>
Co-authored-by: mateimicu <4560298+mateimicu@users.noreply.github.com>
Co-authored-by: mateimicu <4560298+mateimicu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AKS support for kubectl Add AKS (Azure Kubernetes Service) support Oct 14, 2025
Copilot AI requested a review from mateimicu October 14, 2025 12:04
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.

add AKS support

2 participants