Skip to content

Setup DocumentDB with AKS Edge + Azure Arc#281

Open
hossain-rayhan wants to merge 1 commit intodocumentdb:mainfrom
hossain-rayhan:rayhan/aks-edge-setup
Open

Setup DocumentDB with AKS Edge + Azure Arc#281
hossain-rayhan wants to merge 1 commit intodocumentdb:mainfrom
hossain-rayhan:rayhan/aks-edge-setup

Conversation

@hossain-rayhan
Copy link
Collaborator

Summary

Adds documentation for deploying DocumentDB on AKS Edge Essentials - a lightweight K3s-based Kubernetes distribution for Windows machines with Azure Arc integration for portal visibility.

What's Included

README.md: Step-by-step guide covering:

  • AKS Edge installation on Windows 10/11 Pro
  • K3s cluster creation via Hyper-V
  • cert-manager, DocumentDB operator, and instance deployment
  • Azure Arc connection for Azure Portal visibility
  • Verification and cleanup instructions
  • AGENT-INSTRUCTIONS.md: Copilot agent guide for assisted setup

Key Features

Run DocumentDB on any Windows workstation (no cloud costs)
View on-prem cluster + workloads in Azure Portal via Arc
Ideal for dev/test and hybrid scenarios

Signed-off-by: Rayhan Hossain <rhossain@microsoft.com>
Copilot AI review requested due to automatic review settings March 4, 2026 21:16
Copy link
Contributor

Copilot AI left a comment

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 documentation for deploying DocumentDB on AKS Edge Essentials (K3s on Windows) with Azure Arc integration, enabling Azure Portal visibility for on-premises clusters.

Changes:

  • Adds a comprehensive step-by-step README for end users covering installation, configuration, and troubleshooting
  • Adds an AGENT-INSTRUCTIONS.md guide for AI-assisted setup workflows

Reviewed changes

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

File Description
documentdb-playground/aks-edge-setup/README.md Full user-facing guide covering all phases from AKS Edge installation to Azure Arc connection and cleanup
documentdb-playground/aks-edge-setup/AGENT-INSTRUCTIONS.md Copilot agent guide mirroring the README phases with agent-specific behavior instructions

# Expected: demo-documentdb-1 2/2 Running 0 3m
```

### Phase 7: Connect to Azure Arc
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two sections labeled 'Phase 7' — the first at line 389 ('Deploy DocumentDB Instance') and the second at line 442 ('Connect to Azure Arc'). The Azure Arc phase should be renumbered to 'Phase 8', and all subsequent phases (Verification, etc.) should be renumbered accordingly to maintain a consistent, sequential numbering scheme.

Suggested change
### Phase 7: Connect to Azure Arc
### Phase 8: Connect to Azure Arc

Copilot uses AI. Check for mistakes.
```powershell
# Variables
$RESOURCE_GROUP = "aks-edge-rg"
$LOCATION = "eastus"
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Phase 2.5, the $LOCATION variable is set to \"westus2\", but in the 'Connect Cluster to Azure Arc' section (Phase 7), it is hardcoded as \"eastus\". If a user follows both sections, the resource group and Arc cluster could be created in different locations, leading to confusion. This value should reference the same $LOCATION variable defined in Phase 2.5, or at minimum include a note to keep it consistent.

Suggested change
$LOCATION = "eastus"

Copilot uses AI. Check for mistakes.
kubectl create secret generic documentdb-credentials `
--namespace app-namespace `
--from-literal=username=docdbuser `
--from-literal=password=YourSecurePassword123!
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example password YourSecurePassword123! is used both when creating the secret and later in the mongosh connection string (line 534). Embedding a plaintext example password in a connection string that users may copy and run is a security anti-pattern. Consider replacing the connection string's password field with a placeholder like <your-password> to discourage copying credentials verbatim.

Suggested change
--from-literal=password=YourSecurePassword123!
--from-literal=password=<your-password>

Copilot uses AI. Check for mistakes.
Comment on lines +487 to +489
kubectl create clusterrolebinding arc-portal-viewer-binding `
--clusterrole=cluster-admin `
--serviceaccount=default:arc-portal-viewer
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The portal viewer service account is bound to cluster-admin, which grants full cluster access. For read-only portal visibility, a least-privilege role (e.g., view or a custom read-only ClusterRole) should be used instead. If cluster-admin is intentional for demonstration purposes, a clear warning about the security implications should be added.

Copilot uses AI. Check for mistakes.
Comment on lines +399 to +400
# Verify connection
### Phase 8: Create Portal Access Token
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 399–400 contain a duplicate heading and a stray comment. The comment # Verify connection on line 399 appears to be an editing artifact, and ### Phase 8: Create Portal Access Token is repeated on both line 399 (as a fragment) and line 400 (as the actual heading). The stray line 399 should be removed.

Copilot uses AI. Check for mistakes.
Comment on lines +407 to +409
kubectl create clusterrolebinding arc-portal-viewer-binding `
--clusterrole=cluster-admin `
--serviceaccount=default:arc-portal-viewer
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in README.md: the portal viewer service account is granted cluster-admin. This is overly permissive for a read-only portal access token. A least-privilege role should be used, or a clear security warning should be added noting the risks of this binding.

Copilot uses AI. Check for mistakes.

### Why This Setup?

- **On-prem Kubernetes**: Run K8s on your Windows workstation without cloud costs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a little misleading, since it does cost money to run this

# Control Panel → Programs → Uninstall AKS Edge Essentials
```

## Success Criteria
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section seems more agent-oriented, can we move it to the other file?

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