-
Notifications
You must be signed in to change notification settings - Fork 866
Add Azure Kubernetes Service (AKS) hosting support #16088
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
Changes from all commits
d9e2d7f
61992fb
c5fac1e
6e06f0e
2160d3d
6f4c075
a4860c4
1937568
d4e2787
c0b9cac
26a6312
15a0dd2
4b2ad7d
1f05add
76bd9a7
c5dd451
7d5ca59
eb78fd1
b93c041
d5ae3fa
ad679fa
0580583
7e21efb
f06572d
4f139f8
edf1979
24e7f0d
5d02506
4c8cdf5
7cae999
50ba100
3e15ec5
5a873e0
a137935
88d44c2
352e369
60dcd9e
72f58b7
e5ff9f1
4510585
3002346
bdacd7a
5021b94
9bc386c
0b11dcf
e7d7da5
42f669d
333f62d
91b81f1
e6674d5
5d2fb36
59d290b
bb3566a
d59a000
02c22dd
6ac7c33
7788491
20ad6d6
312b317
3257052
2af9872
26ab947
2a474d6
96b05b0
11c7080
fc22bec
8612d95
6fd1c19
a96bb94
5c1ba69
21c2b1d
b42c60d
f1de02d
6eb4306
fb883c0
0d5ac11
0defaaa
95e3164
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Update Azure VM Sizes | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 6 1 * *' # Monthly on the 1st at 06:00 UTC | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| generate-and-pr: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.repository_owner == 'microsoft' }} | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Azure Login | ||
| uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0 | ||
| with: | ||
| creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
|
||
| - name: Generate updated Azure VM size descriptors | ||
| working-directory: src/Aspire.Hosting.Azure.Kubernetes/tools | ||
| run: | | ||
| set -e | ||
| "$GITHUB_WORKSPACE/dotnet.sh" run GenVmSizes.cs | ||
|
|
||
| - name: Generate GitHub App Token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6 | ||
| with: | ||
| app-id: ${{ secrets.ASPIRE_BOT_APP_ID }} | ||
| private-key: ${{ secrets.ASPIRE_BOT_PRIVATE_KEY }} | ||
|
|
||
| - name: Create or update pull request | ||
| uses: ./.github/actions/create-pull-request | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| branch: update-azure-vm-sizes | ||
| base: main | ||
| commit-message: "[Automated] Update Azure VM Sizes" | ||
| labels: | | ||
| area-integrations | ||
| area-engineering-systems | ||
| title: "[Automated] Update Azure VM Sizes" | ||
| body: "Auto-generated update of Azure VM size descriptors (AksNodeVmSizes.Generated.cs)." |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Aspire.Hosting.Azure.Kubernetes; | ||
|
|
||
| /// <summary> | ||
| /// Network profile configuration for an AKS cluster. | ||
| /// </summary> | ||
| internal sealed class AksNetworkProfile | ||
| { | ||
| /// <summary> | ||
| /// Gets or sets the network plugin. Defaults to "azure" for Azure CNI. | ||
| /// </summary> | ||
| public string NetworkPlugin { get; set; } = "azure"; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the network policy. Defaults to "calico". | ||
| /// </summary> | ||
| public string? NetworkPolicy { get; set; } = "calico"; | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the service CIDR. | ||
| /// </summary> | ||
| public string ServiceCidr { get; set; } = "10.0.4.0/22"; | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded This CIDR overlaps with the spec's example GPU subnet (
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| /// <summary> | ||
| /// Gets or sets the DNS service IP address. | ||
| /// </summary> | ||
| public string DnsServiceIP { get; set; } = "10.0.4.10"; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace Aspire.Hosting.Azure.Kubernetes; | ||
|
|
||
| /// <summary> | ||
| /// Configuration for an AKS node pool. | ||
| /// </summary> | ||
| /// <param name="Name">The name of the node pool.</param> | ||
| /// <param name="VmSize">The VM size for nodes in the pool.</param> | ||
| /// <param name="MinCount">The minimum number of nodes.</param> | ||
| /// <param name="MaxCount">The maximum number of nodes.</param> | ||
| /// <param name="Mode">The mode of the node pool.</param> | ||
| public sealed record AksNodePoolConfig( | ||
| string Name, | ||
| string VmSize, | ||
| int MinCount, | ||
| int MaxCount, | ||
| AksNodePoolMode Mode); | ||
|
|
||
| /// <summary> | ||
| /// Specifies the mode of an AKS node pool. | ||
| /// </summary> | ||
| public enum AksNodePoolMode | ||
| { | ||
| /// <summary> | ||
| /// System node pool for hosting system pods. | ||
| /// </summary> | ||
| System, | ||
|
|
||
| /// <summary> | ||
| /// User node pool for hosting application workloads. | ||
| /// </summary> | ||
| User | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Aspire.Hosting.Kubernetes; | ||
|
|
||
| namespace Aspire.Hosting.Azure.Kubernetes; | ||
|
|
||
| /// <summary> | ||
| /// Represents an AKS node pool with Azure-specific configuration such as VM size and autoscaling. | ||
| /// Extends the base <see cref="KubernetesNodePoolResource"/> with provisioning configuration | ||
| /// that is used to generate Azure Bicep for the AKS agent pool profile. | ||
| /// </summary> | ||
| /// <param name="name">The name of the node pool resource.</param> | ||
| /// <param name="config">The Azure-specific node pool configuration.</param> | ||
| /// <param name="parent">The parent AKS environment resource.</param> | ||
| public class AksNodePoolResource( | ||
| string name, | ||
| AksNodePoolConfig config, | ||
| AzureKubernetesEnvironmentResource parent) : KubernetesNodePoolResource(name, parent.KubernetesEnvironment) | ||
| { | ||
| /// <summary> | ||
| /// Gets the parent AKS environment resource. | ||
| /// </summary> | ||
| public AzureKubernetesEnvironmentResource AksParent { get; } = parent ?? throw new ArgumentNullException(nameof(parent)); | ||
|
|
||
| /// <summary> | ||
| /// Gets the Azure-specific node pool configuration. | ||
| /// </summary> | ||
| public AksNodePoolConfig Config { get; } = config ?? throw new ArgumentNullException(nameof(config)); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.