3 instantiations of KubernetesResource
Aspire.Hosting.Kubernetes (1)
KubernetesEnvironmentContext.cs (1)
24
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);
53 references to KubernetesResource
Aspire.Hosting.Azure.Kubernetes (1)
AzureKubernetesEnvironmentResource.AksPipeline.cs (1)
102
kubeResource.Parameters["identityClientId"] = new
KubernetesResource
.HelmValue(
Aspire.Hosting.Kubernetes (48)
Deployment\HelmDeploymentEngine.cs (1)
514
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)
97
internal static ConfigMap? ToConfigMap(this IResource resource,
KubernetesResource
context)
129
internal static Service? ToService(this IResource resource,
KubernetesResource
context)
186
private static PodTemplateSpecV1 ToPodTemplateSpec(this IResource resource,
KubernetesResource
context)
206
private static PodTemplateSpecV1 WithPodSpecVolumes(this PodTemplateSpecV1 podTemplateSpec,
KubernetesResource
context)
295
private static ContainerV1 ToContainerV1(this IResource resource,
KubernetesResource
context)
314
private static ContainerV1 WithContainerVolumes(this ContainerV1 container,
KubernetesResource
context)
338
private static ContainerV1 WithContainerPorts(this ContainerV1 container,
KubernetesResource
context)
368
private static ContainerV1 WithContainerImage(this ContainerV1 container,
KubernetesResource
context)
375
private static ContainerV1 WithContainerEntrypoint(this ContainerV1 container,
KubernetesResource
context)
385
private static ContainerV1 WithContainerArgs(this ContainerV1 container,
KubernetesResource
context)
400
private static ContainerV1 WithContainerEnvironmentalVariables(this ContainerV1 container,
KubernetesResource
context)
417
private static ContainerV1 WithContainerSecrets(this ContainerV1 container,
KubernetesResource
context)
434
private static ContainerV1 WithContainerProbes(this ContainerV1 container,
KubernetesResource
context)
462
private static PersistentVolumeClaim CreatePersistentVolumeClaim(
KubernetesResource
context, VolumeMountV1 volume)
KubernetesEnvironmentContext.cs (4)
11
private readonly Dictionary<IResource,
KubernetesResource
> _kubernetesComponents = new(new ResourceNameComparer());
15
public async Task<
KubernetesResource
> CreateKubernetesResourceAsync(IResource resource, DistributedApplicationExecutionContext executionContext, CancellationToken cancellationToken)
17
if (_kubernetesComponents.TryGetValue(resource, out
var
existingResource))
24
var
serviceResource = new KubernetesResource(resource.Name, resource, environment);
KubernetesEnvironmentResource.cs (12)
448
var
dashboardService = await environmentContext.CreateKubernetesResourceAsync(dashboard, executionContext, cancellationToken).ConfigureAwait(false);
462
var deploymentTargets = new Dictionary<IResource,
KubernetesResource
>(new ResourceNameComparer());
491
if (existingTarget.DeploymentTarget is
KubernetesResource
existingServiceResource)
506
var
serviceResource = await environmentContext.CreateKubernetesResourceAsync(r, executionContext, cancellationToken).ConfigureAwait(false);
723
private async Task ProcessIngressResources(DistributedApplicationModel model, Dictionary<IResource,
KubernetesResource
> deploymentTargets, ILogger logger, CancellationToken cancellationToken)
763
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
928
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
934
if (!deploymentTargets.TryGetValue(targetResource, out
var
k8sResource))
964
private async Task ProcessGatewayResources(DistributedApplicationModel model, Dictionary<IResource,
KubernetesResource
> deploymentTargets, ILogger logger, CancellationToken cancellationToken)
1098
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
1274
Dictionary<IResource,
KubernetesResource
> deploymentTargets,
1280
if (!deploymentTargets.TryGetValue(targetResource, out
var
k8sResource))
KubernetesPersistentVolumeExtensions.cs (2)
329
/// <see cref="KubernetesServiceExtensions.PublishAsKubernetesService{T}(IResourceBuilder{T}, Action{
KubernetesResource
})"/>
393
/// <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,
467
private static void ApplyNodePoolSelector(
KubernetesResource
serviceResource, KubernetesNodePoolResource nodePool)
KubernetesResource.cs (2)
555
var
referencedResource = ep.Resource == this
598
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 (4)
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)
259
var
service = Assert.IsType<
KubernetesResource
>(containerK8sResource.GetDeploymentTargetAnnotation()!.DeploymentTarget);