5 instantiations of KubernetesResource
Aspire.Hosting.Kubernetes (1)
KubernetesEnvironmentContext.cs (1)
133
var serviceResource = new
KubernetesResource
(resource.Name, resource, environment);
Aspire.Hosting.Kubernetes.Tests (2)
KubernetesDeployTests.cs (2)
1199
var k8sResource = new
KubernetesResource
("api-k8s", project.Resource, envResource);
1222
var k8sResource = new
KubernetesResource
("cache-k8s", container.Resource, envResource);
Aspire.Hosting.RemoteHost.Tests (2)
KubernetesManifestTests.cs (2)
97
var service = new
KubernetesResource
("api", new ContainerResource("api"), new KubernetesEnvironmentResource("env"));
150
var service = new
KubernetesResource
("api", new ContainerResource("api"), new KubernetesEnvironmentResource("env"));
68 references to KubernetesResource
Aspire.Hosting.Azure.Kubernetes (1)
AzureKubernetesEnvironmentResource.AksPipeline.cs (1)
101
kubeResource.Parameters["identityClientId"] = new
KubernetesResource
.HelmValue(
Aspire.Hosting.Kubernetes (48)
Deployment\HelmDeploymentEngine.cs (1)
513
KubernetesResource
k8sResource)
Extensions\ResourceExtensions.cs (17)
14
internal static Deployment ToDeployment(this IResource resource,
KubernetesResource
context)
43
internal static StatefulSet ToStatefulSet(this IResource resource,
KubernetesResource
context)
63
internal static Secret? ToSecret(this IResource resource,
KubernetesResource
context)
101
internal static ConfigMap? ToConfigMap(this IResource resource,
KubernetesResource
context)
138
internal static Service? ToService(this IResource resource,
KubernetesResource
context)
195
private static PodTemplateSpecV1 ToPodTemplateSpec(this IResource resource,
KubernetesResource
context)
215
private static PodTemplateSpecV1 WithPodSpecVolumes(this PodTemplateSpecV1 podTemplateSpec,
KubernetesResource
context)
304
private static ContainerV1 ToContainerV1(this IResource resource,
KubernetesResource
context)
323
private static ContainerV1 WithContainerVolumes(this ContainerV1 container,
KubernetesResource
context)
347
private static ContainerV1 WithContainerPorts(this ContainerV1 container,
KubernetesResource
context)
377
private static ContainerV1 WithContainerImage(this ContainerV1 container,
KubernetesResource
context)
384
private static ContainerV1 WithContainerEntrypoint(this ContainerV1 container,
KubernetesResource
context)
394
private static ContainerV1 WithContainerArgs(this ContainerV1 container,
KubernetesResource
context)
409
private static ContainerV1 WithContainerEnvironmentalVariables(this ContainerV1 container,
KubernetesResource
context)
426
private static ContainerV1 WithContainerSecrets(this ContainerV1 container,
KubernetesResource
context)
443
private static ContainerV1 WithContainerProbes(this ContainerV1 container,
KubernetesResource
context)
471
private static PersistentVolumeClaim CreatePersistentVolumeClaim(
KubernetesResource
context, VolumeMountV1 volume)
KubernetesEnvironmentContext.cs (4)
15
private readonly Dictionary<IResource,
KubernetesResource
> _kubernetesComponents = new(new ResourceNameComparer());
124
public async Task<
KubernetesResource
> CreateKubernetesResourceAsync(IResource resource, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
126
if (_kubernetesComponents.TryGetValue(resource, out
var
existingResource))
133
var
serviceResource = new KubernetesResource(resource.Name, resource, environment);
KubernetesEnvironmentResource.cs (12)
449
var
dashboardService = await environmentContext.CreateKubernetesResourceAsync(dashboard, executionContext, cancellationToken).ConfigureAwait(false);
463
var deploymentTargets = new Dictionary<IResource,
KubernetesResource
>(new ResourceNameComparer());
493
if (existingTarget.DeploymentTarget is
KubernetesResource
existingServiceResource)
516
var
serviceResource = await environmentContext.CreateKubernetesResourceAsync(r, executionContext, cancellationToken).ConfigureAwait(false);
733
private async Task ProcessIngressResources(DistributedApplicationModel model, Dictionary<IResource,
KubernetesResource
> deploymentTargets, ILogger logger, CancellationToken cancellationToken)
773
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
938
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
944
if (!deploymentTargets.TryGetValue(targetResource, out
var
k8sResource))
974
private async Task ProcessGatewayResources(DistributedApplicationModel model, Dictionary<IResource,
KubernetesResource
> deploymentTargets, ILogger logger, CancellationToken cancellationToken)
1108
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
1284
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
1290
if (!deploymentTargets.TryGetValue(targetResource, out
var
k8sResource))
KubernetesPersistentVolumeExtensions.cs (2)
334
/// <see cref="KubernetesServiceExtensions.PublishAsKubernetesService{T}(IResourceBuilder{T}, Action{
KubernetesResource
})"/>
398
/// <see cref="KubernetesServiceExtensions.PublishAsKubernetesService{T}(IResourceBuilder{T}, Action{
KubernetesResource
})"/>
KubernetesPublishingContext.cs (7)
81
if (resource.GetDeploymentTargetAnnotation(targetEnv)?.DeploymentTarget is
KubernetesResource
serviceResource)
185
private async Task AppendResourceContextToHelmValuesAsync(IResource resource,
KubernetesResource
resourceContext)
210
private static Dictionary<string,
KubernetesResource
.HelmValue> MergeHelmValueMappings(
213
params (IReadOnlyDictionary<string,
KubernetesResource
.HelmValue> Values, string OriginKind)[] mappingGroups)
216
var result = new Dictionary<string,
KubernetesResource
.HelmValue>(StringComparer.Ordinal);
256
Dictionary<string,
KubernetesResource
.HelmValue> contextItems,
514
private static void ApplyNodePoolSelector(
KubernetesResource
serviceResource, KubernetesNodePoolResource nodePool)
KubernetesResource.cs (2)
565
var
referencedResource = ep.Resource == this
614
var
referencedResource = epExpr.Endpoint.Resource == this
KubernetesServiceCustomizationAnnotation.cs (2)
15
public sealed class KubernetesServiceCustomizationAnnotation(Action<
KubernetesResource
> configure) : IResourceAnnotation
20
public Action<
KubernetesResource
> Configure { get; } = configure ?? throw new ArgumentNullException(nameof(configure));
KubernetesServiceExtensions.cs (1)
34
public static IResourceBuilder<T> PublishAsKubernetesService<T>(this IResourceBuilder<T> builder, Action<
KubernetesResource
> configure)
Aspire.Hosting.Kubernetes.Tests (14)
KubernetesDeployTests.cs (2)
1199
var
k8sResource = new KubernetesResource("api-k8s", project.Resource, envResource);
1222
var
k8sResource = new KubernetesResource("cache-k8s", container.Resource, envResource);
KubernetesEnvironmentResourceTests.cs (2)
260
var
service = Assert.IsType<
KubernetesResource
>(containerK8sResource.GetDeploymentTargetAnnotation()!.DeploymentTarget);
KubernetesPublisherTests.cs (10)
138
var
target = Assert.IsType<
KubernetesResource
>(consumer.Resource.GetDeploymentTargetAnnotation()!.DeploymentTarget);
173
var
target = Assert.IsType<
KubernetesResource
>(consumer.Resource.GetDeploymentTargetAnnotation()!.DeploymentTarget);
207
var
target = Assert.IsType<
KubernetesResource
>(consumer.Resource.GetDeploymentTargetAnnotation()!.DeploymentTarget);
256
var
consumer = Assert.IsType<
KubernetesResource
>(builder.Resources.Single(resource => resource.Name == "consumer").GetDeploymentTargetAnnotation()!.DeploymentTarget);
301
var
target = Assert.IsType<
KubernetesResource
>(consumer.Resource.GetDeploymentTargetAnnotation()!.DeploymentTarget);
Aspire.Hosting.RemoteHost.Tests (5)
KubernetesManifestTests.cs (5)
97
var
service = new KubernetesResource("api", new ContainerResource("api"), new KubernetesEnvironmentResource("env"));
150
var
service = new KubernetesResource("api", new ContainerResource("api"), new KubernetesEnvironmentResource("env"));
180
var scannedContext = AtsCapabilityScanner.ScanAssemblies([typeof(
KubernetesResource
).Assembly]).ToAtsContext();
214
var context = AtsCapabilityScanner.ScanAssemblies([typeof(
KubernetesResource
).Assembly]).ToAtsContext();
218
return new CapabilityDispatcher(handles, marshaller, [typeof(
KubernetesResource
).Assembly]);