Reduce the amount of boilerplate required to do an end-to-end app deployment via AddAzureKubernetes that exposes an endpoint with TLS.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
This is the current minimum:
```csharp
var builder = DistributedApplication.CreateBuilder(args);
// Parameters for deployment configuration
var acmeEmail = builder.AddParameter("acmeEmail");
// Networking: VNet with subnets for AKS nodes and AGC load balancer
var vnet = builder.AddAzureVirtualNetwork("vnet", "10.1.0.0/16");
var aksSubnet = vnet.AddSubnet("akssubnet", "10.1.0.0/22");
var albSubnet = vnet.AddSubnet("albsubnet", "10.1.4.0/24");
// Azure Kubernetes environment (auto-provisions AKS + ACR + managed identity)
var aks = builder.AddAzureKubernetesEnvironment("aks")
.WithSubnet(aksSubnet)
.WithSystemNodePool("Standard_D4as_v5", minCount: 1, maxCount: 5);
var userPool = aks.AddNodePool("userpool", "Standard_D4as_v5", minCount: 1, maxCount: 5);
// Application Gateway for Containers load balancer
var lb = aks.AddLoadBalancer("lb", albSubnet);
// cert-manager with Let's Encrypt HTTP-01
var certManager = aks.AddCertManager("cert-manager");
var issuer = certManager.AddIssuer("letsencrypt")
.WithLetsEncryptProduction(acmeEmail)
.WithHttp01Solver();
// Application resources
var cache = builder.AddRedis("cache");
var apiService = builder.AddProject("apiservice")
.WithHttpHealthCheck("/health");
var frontend = builder.AddProject("webfrontend")
.WithExternalHttpEndpoints()
.WithHttpHealthCheck("/health")
.WithReference(cache)
.WaitFor(cache)
.WithReference(apiService)
.WaitFor(apiService);
// Gateway with TLS via AGC load balancer (uses auto-assigned FQDN)
aks.AddGateway("ingress")
.WithLoadBalancer(lb)
.WithRoute("/", frontend.GetEndpoint("http"))
.WithTls(issuer);
builder.Build().Run();
```
Compare this with ACA and it is very verbose. Part of that is due to K8S being ultimately flexible and being able to make less assumptions - but is there a way that we can improve this.
Contributor guide
Research direction
Start by comparing the shown AddAzureKubernetes deployment flow with the less verbose ACA experience. Review the builder calls for the virtual network, AKS environment, load balancer, cert-manager issuer, gateway, and TLS route. Done means identifying and implementing a way to reduce the required boilerplate while still exposing an endpoint with TLS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, kubernetes
- Domain
- cloud, devops, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100