K3sClusterResource
Handle
interface K3sClusterResource extends IComputeResource, IExpressionValue, IManifestExpressionProvider, IResource, IResourceWithArgs, IResourceWithConnectionString, IResourceWithEndpoints, IResourceWithEnvironment, IResourceWithProbes, IResourceWithWaitSupport, IValueProvider, IValueWithReferences { readonly apiEndpoint: EndpointReference; readonly connectionStringEnvironmentVariable: string; readonly connectionStringExpression: ReferenceExpression; addHelmRelease( name: string, chart: string, repo?: string, version?: string, namespace?: string): HelmReleaseResource; addK8sManifest( name: string, path: string): K8sManifestResource; addServiceEndpoint( name: string, serviceName: string, servicePort: number, namespace?: string, scheme?: string): K3sServiceEndpointResource; withAgentCount(count: number): K3sClusterResource; withDataVolume(name?: string): K3sClusterResource; withDisabledComponent(component: string): K3sClusterResource; withExtraArg(arg: string): K3sClusterResource; withHelmImage( tag?: string, image?: string, registry?: string): K3sClusterResource; withK3sVersion(tag: string): K3sClusterResource; withKubectlImage( tag?: string, image?: string, registry?: string): K3sClusterResource; withLifetime(lifetime: ContainerLifetime): K3sClusterResource; withPodSubnet(cidr: string): K3sClusterResource; withServiceSubnet(cidr: string): K3sClusterResource;}16 members
Properties
property
apiEndpointEndpointReferencegetGets the endpoint reference for the k3s API server (port 6443).
property
connectionStringEnvironmentVariablestringgetOverrides the default `ConnectionStrings__` prefix so Aspire injects `KUBECONFIG`.
property
connectionStringExpressionReferenceExpressiongetManifest expression for the local kubeconfig path.
Methods
Installs a Helm chart into the k3s cluster.
addHelmRelease( name: string, chart: string, repo?: string, version?: string, namespace?: string): HelmReleaseResourceParameters
namestringchartstringrepostringoptionalversionstringoptionalnamespacestringoptional= defaultReturns
HelmReleaseResourceApplies Kubernetes YAML manifests or a Kustomize overlay to the cluster.
addK8sManifest( name: string, path: string): K8sManifestResourceParameters
namestringpathstringReturns
K8sManifestResourceExposes a Kubernetes Service from the cluster as an Aspire endpoint resource.
addServiceEndpoint( name: string, serviceName: string, servicePort: number, namespace?: string, scheme?: string): K3sServiceEndpointResourceParameters
namestringserviceNamestringservicePortnumbernamespacestringoptional= defaultschemestringoptionalReturns
K3sServiceEndpointResourceSets the number of k3s agent (worker) nodes to add to the cluster.
withAgentCount(count: number): K3sClusterResourceParameters
countnumberReturns
K3sClusterResourceMounts a named Docker volume at the k3s data directory so cluster state persists across AppHost restarts.
withDataVolume(name?: string): K3sClusterResourceParameters
namestringoptionalReturns
K3sClusterResourceDisables a built-in k3s component (`--disable=<component>`).
withDisabledComponent(component: string): K3sClusterResourceParameters
componentstringReturns
K3sClusterResourceAppends a raw argument to the `k3s server` command line.
withExtraArg(arg: string): K3sClusterResourceParameters
argstringReturns
K3sClusterResourceOverrides the container image used to run `helm upgrade --install` for all `HelmReleaseResource` children of this cluster.
withHelmImage( tag?: string, image?: string, registry?: string): K3sClusterResourceParameters
tagstringoptionalimagestringoptionalregistrystringoptionalReturns
K3sClusterResourceSets the k3s image version used by the cluster server and all its agent nodes.
withK3sVersion(tag: string): K3sClusterResourceParameters
tagstringReturns
K3sClusterResourceOverrides the container image used to run `kubectl apply` for all `K8sManifestResource` children of this cluster.
withKubectlImage( tag?: string, image?: string, registry?: string): K3sClusterResourceParameters
tagstringoptionalimagestringoptionalregistrystringoptionalReturns
K3sClusterResourceSets the container lifetime for the k3s cluster and all its agent nodes.
withLifetime(lifetime: ContainerLifetime): K3sClusterResourceParameters
lifetimeContainerLifetimeReturns
K3sClusterResourceSets the CIDR range for pod IP addresses (`--cluster-cidr`).
withPodSubnet(cidr: string): K3sClusterResourceParameters
cidrstringReturns
K3sClusterResourceSets the CIDR range for Service cluster IPs (`--service-cidr`).
withServiceSubnet(cidr: string): K3sClusterResourceParameters
cidrstringReturns
K3sClusterResource