-
Notifications
You must be signed in to change notification settings - Fork 733
Closed
Description
We want to improve our current model for interacting with compute environments by modeling more compute targets as resources, specifically Docker Compose and Kubernetes targets in the current scenario.
Things we want to consider as part of this:
- Introduce new
ComputeEnvironmentResourcetype. - Kubernetes and Docker Compose publishers in current implementation should be modeled as
ComputeEnvironmentResources. - Existing Kubernetes and Docker Compose publishers should be updated to respect
ComputeEnvironmentResourceimplementations associated with each target and wire upDeploymentTargetAnnotationon each compute resource. - We need to handle multiple compute environments being initialized in the same environment.
var builder = DistributedApplication.CreateBuilder();
var cae = builder.AddAzureContainerAppEnvironment("cae");
var docker = builder.AddDockerComposeEnvironment("docker-compose");
var ks = builder.AddKubernetesComputeEnvironment("kubernetes");
// Require each service to explicitly indicate what environment it belongs
// to if multiple environments are declared
// If only one `ComputeEnvironmentResource` exists then throw
var api1 = builder.AddProject<Projects.Api1>("api1");
var api2 = builder.AddProject<Projects.Api2>("api2");- We need to consider how cross-environment endpoint references will work.
var builder = DistributedApplication.CreateBuilder();
var cae = builder.AddAzureContainerAppEnvironment("cae");
var docker = builder.AddDockerComposeEnvironment("docker-compose");
var ks = builder.AddKubernetesComputeEnvironment("kubernetes");
// Require each service to explicitly indicate what environment it belongs
// to if multiple environments are declared
// If only one `ComputeEnvironmentResource` exists then throw
var api1 = builder.AddProject<Projects.Api1>("api1")
.WithComputeEnvironment(cae);
var api2 = builder.AddProject<Projects.Api2>("api2")
.WithComputeEnvironment(ks)
.WithReference(api1); // How do we handle endpoint references here?