@highstate/k8s 0.9.37 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XU6ZPTWO.js → chunk-23KLAP3X.js} +4 -4
- package/dist/{chunk-XU6ZPTWO.js.map → chunk-23KLAP3X.js.map} +1 -1
- package/dist/{chunk-IDKGFFZ7.js → chunk-4NWENXPT.js} +9 -9
- package/dist/{chunk-IDKGFFZ7.js.map → chunk-4NWENXPT.js.map} +1 -1
- package/dist/{chunk-O3ZNJMTN.js → chunk-5CMNORLF.js} +3 -3
- package/dist/{chunk-O3ZNJMTN.js.map → chunk-5CMNORLF.js.map} +1 -1
- package/dist/{chunk-2F2IID7N.js → chunk-77AY36LR.js} +4 -4
- package/dist/{chunk-2F2IID7N.js.map → chunk-77AY36LR.js.map} +1 -1
- package/dist/{chunk-SI7X6N46.js → chunk-DJE2YX64.js} +3 -3
- package/dist/{chunk-SI7X6N46.js.map → chunk-DJE2YX64.js.map} +1 -1
- package/dist/{chunk-2ZAEILVT.js → chunk-KCPQLLNX.js} +7 -7
- package/dist/{chunk-2ZAEILVT.js.map → chunk-KCPQLLNX.js.map} +1 -1
- package/dist/{chunk-VMEJWYK2.js → chunk-LR6OTL6T.js} +3 -3
- package/dist/{chunk-VMEJWYK2.js.map → chunk-LR6OTL6T.js.map} +1 -1
- package/dist/{chunk-OEOMZP2C.js → chunk-Q35R54GK.js} +4 -4
- package/dist/{chunk-OEOMZP2C.js.map → chunk-Q35R54GK.js.map} +1 -1
- package/dist/{chunk-FKJLPM3M.js → chunk-SY7FPT77.js} +4 -4
- package/dist/{chunk-FKJLPM3M.js.map → chunk-SY7FPT77.js.map} +1 -1
- package/dist/{chunk-WGMJCZSK.js → chunk-UHWJ2GDK.js} +8 -8
- package/dist/chunk-UHWJ2GDK.js.map +1 -0
- package/dist/{chunk-3DFFUGSJ.js → chunk-UXEHNDI7.js} +4 -4
- package/dist/{chunk-3DFFUGSJ.js.map → chunk-UXEHNDI7.js.map} +1 -1
- package/dist/deployment-LVMOBFVO.js +8 -0
- package/dist/{deployment-D3ZXIZRN.js.map → deployment-LVMOBFVO.js.map} +1 -1
- package/dist/highstate.manifest.json +2 -2
- package/dist/impl/gateway-route.js +5 -5
- package/dist/impl/tls-certificate.js +3 -3
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/stateful-set-KKQDQMES.js +8 -0
- package/dist/{stateful-set-AXF4QRFI.js.map → stateful-set-KKQDQMES.js.map} +1 -1
- package/dist/units/cert-manager/index.js +7 -7
- package/dist/units/dns01-issuer/index.js +1 -1
- package/dist/units/existing-cluster/index.js +2 -2
- package/dist/units/gateway-api/index.js +1 -1
- package/dist/units/reduced-access-cluster/index.js +8 -8
- package/package.json +21 -19
- package/src/container.ts +1 -1
- package/src/worker.ts +1 -1
- package/dist/chunk-WGMJCZSK.js.map +0 -1
- package/dist/deployment-D3ZXIZRN.js +0 -8
- package/dist/stateful-set-AXF4QRFI.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/gateway/backend.ts","../src/gateway/gateway.ts","../src/gateway/http-route.ts","../src/gateway/tcp-route.ts","../src/gateway/udp-route.ts"],"names":["output","ComponentResource","gateway","normalizeInputsAndMap"],"mappings":";;;;;;;;AAoCO,SAAS,kBAAkB,GAAA,EAAiD;AACjF,EAAA,IAAI,OAAA,CAAQ,UAAA,CAAW,GAAG,CAAA,EAAG;AAC3B,IAAA,OAAO,MAAA,CAAO;AAAA,MACZ,IAAA,EAAM,IAAI,QAAA,CAAS,IAAA;AAAA,MACnB,SAAA,EAAW,IAAI,QAAA,CAAS,SAAA;AAAA,MACxB,IAAA,EAAM,GAAA,CAAI,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA,CAAE;AAAA,KACzB,CAAA;AAAA,EACH;AAEA,EAAA,IAAI,aAAa,GAAA,EAAK;AACpB,IAAA,MAAM,OAAA,GAAU,MAAA,CAAO,GAAA,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AAA,OAAA,KAAW;AAClD,MAAA,OAAO,IAAID,QAAQ,QAAA,CAAS,QAAA;AAAA,QAC1B,IAAA;AAAA,QACA;AAAA,UACE,UAAU,WAAA,CAAY,IAAA,EAAM,IAAI,CAAA,CAAE,MAAM,CAAA,QAAA,MAAa;AAAA,YACnD,GAAG,QAAA;AAAA,YACH,SAAA,EAAW,aAAA,CAAc,SAAA,CAAU,QAAA,CAAS;AAAA,WAC9C,CAAE,CAAA;AAAA,UACF,IAAA,EAAM;AAAA,YACJ,UAAA;AAAA,YACA,KAAA,EAAO;AAAA,cACL;AAAA,gBACE;AAAA;AACF;AACF;AACF,SACF;AAAA,QACA,EAAE,GAAG,IAAA,EAAM,MAAA,EAAQ,MAAM,QAAA,EAAU,WAAA,CAAY,OAAO,CAAA;AAAE,OAC1D;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF","file":"chunk-OEOMZP2C.js","sourcesContent":["import type { core } from \"@pulumi/kubernetes\"\nimport { type Input, type Output, output, type Unwrap } from \"@highstate/pulumi\"\nimport { Service } from \"../service\"\n\nexport interface FullBackendRef {\n /**\n * The name of the resource being referenced.\n */\n name: Input<string>\n\n /**\n * The namespace of the resource being referenced.\n * May be undefined if the resource is not in a namespace.\n */\n namespace?: Input<string | undefined>\n\n /**\n * The port of the resource being referenced.\n */\n port: Input<number>\n}\n\nexport interface ServiceBackendRef {\n /**\n * The name of the service being referenced.\n */\n service: Input<core.v1.Service>\n\n /**\n * The port of the service being referenced.\n */\n port: Input<number>\n}\n\nexport type BackendRef = FullBackendRef | ServiceBackendRef | Service\n\nexport function resolveBackendRef(ref: BackendRef): Output<Unwrap<FullBackendRef>> {\n if (Service.isInstance(ref)) {\n return output({\n name: ref.metadata.name,\n namespace: ref.metadata.namespace,\n port: ref.spec.ports[0].port,\n })\n }\n\n if (\"service\" in ref) {\n const service = output(ref.service)\n\n return output({\n name: service.metadata.name,\n namespace: service.metadata.namespace,\n port: ref.port,\n })\n }\n\n return output({\n name: ref.name,\n namespace: ref.namespace,\n port: ref.port,\n })\n}\n","import type { k8s, network } from \"@highstate/library\"\nimport type { types } from \"@pulumi/kubernetes\"\nimport type { SetRequired } from \"type-fest\"\nimport { parseL3Endpoint } from \"@highstate/common\"\nimport { getOrCreate } from \"@highstate/contract\"\nimport { gateway, type types as gwTypes } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n type Inputs,\n interpolate,\n type Output,\n output,\n toPromise,\n} from \"@highstate/pulumi\"\nimport { omit } from \"remeda\"\nimport { Namespace } from \"../namespace\"\nimport { commonExtraArgs, getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\n\nexport type GatewayArgs = ScopedResourceArgs & {\n /**\n * The FQDN to configure the listeners for.\n */\n fqdn?: Input<string>\n\n /**\n * The FQDNs to configure the listeners for.\n */\n fqdns?: InputArray<string>\n} & gwTypes.input.gateway.v1.GatewaySpec\n\nexport type CreateOrGetGatewayArgs = GatewayArgs & {\n /**\n * The gateway entity to patch/retrieve.\n */\n existing: Input<k8s.Gateway> | undefined\n}\n\nconst gatewayExtraArgs = [...commonExtraArgs, \"fqdn\", \"fqdns\"] as const\n\n/**\n * Represents a Kubernetes Gateway resource.\n */\nexport abstract class Gateway extends ComponentResource {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n /**\n * The namespace where the gateway is located.\n */\n readonly namespace: Output<Namespace>,\n\n /**\n * The metadata of the underlying Kubernetes gateway.\n */\n readonly metadata: Output<types.output.meta.v1.ObjectMeta>,\n\n /**\n * The spec of the underlying Gateway resource.\n */\n readonly spec: Output<gwTypes.output.gateway.v1.GatewaySpec>,\n\n /**\n * The status of the underlying Gateway resource.\n */\n readonly status: Output<gwTypes.output.gateway.v1.GatewayStatus>,\n ) {\n super(type, name, args, opts)\n }\n\n /**\n * The cluster where the gateway is located.\n */\n get cluster(): Output<k8s.Cluster> {\n return this.namespace.cluster\n }\n\n /**\n * The Highstate gateway entity.\n */\n get entity(): Output<k8s.Gateway> {\n return output({\n type: \"gateway\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n })\n }\n\n /**\n * Returns the endpoints L3 endpoints on which the gateway is exposed.\n */\n get endpoints(): Output<network.L3Endpoint[]> {\n return this.status.addresses.apply(addresses => {\n if (!addresses) {\n return []\n }\n\n return addresses.map(address => parseL3Endpoint(address.value))\n })\n }\n\n /**\n * Creates a new gateway.\n */\n static create(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to create or patch the gateway with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Gateway {\n if (args.existing) {\n return new GatewayPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n namespace: Namespace.forResourceAsync(args.existing, output(args.namespace).cluster),\n })\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name. Will not be used when existing gateway is retrieved.\n * @param args The arguments to create or get the gateway with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n if (args.existing) {\n return await Gateway.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Patches an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to patch the gateway with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new GatewayPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes gateway.\n */\n static wrap(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new WrappedGateway(name, args, opts)\n }\n\n /**\n * Gets an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n */\n static get(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new ExternalGateway(name, args, opts)\n }\n\n private static readonly gatewayCache = new Map<string, Gateway>()\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static for(entity: k8s.Gateway, cluster: Input<k8s.Cluster>): Gateway {\n return getOrCreate(\n Gateway.gatewayCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Gateway.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResourceAsync(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static async forAsync(entity: Input<k8s.Gateway>, cluster: Input<k8s.Cluster>): Promise<Gateway> {\n const resolvedEntity = await toPromise(entity)\n\n return Gateway.for(resolvedEntity, output(cluster))\n }\n\n /**\n * Creates a gateway with the provided name/namespace/cluster only once.\n *\n * It automatically names the resource with the following format: `{name}.{namespace}.{clusterName}.{clusterId}`.\n *\n * On subsequent calls the gateway is patched with the union of existing and requested listeners.\n * Only the listeners field is modified to avoid altering other spec fields.\n *\n * @param name The name of the gateway to create.\n * @param args The arguments to create the gateway with.\n * @param opts Optional resource options.\n */\n static async createOnce(\n args: SetRequired<GatewayArgs, \"name\">,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n const { name, namespace, cluster } = await toPromise({\n name: args.name,\n namespace: output(args.namespace).metadata.name,\n cluster: output(args.namespace).cluster,\n })\n\n const fullName = `${name}.${namespace}.${cluster.name}.${cluster.id}`\n\n const existing = Gateway.gatewayCache.get(fullName)\n if (existing) {\n Gateway.patch(\n fullName,\n {\n name,\n namespace: args.namespace,\n listeners: args.listeners,\n },\n opts,\n )\n\n return existing\n }\n\n const created = Gateway.create(\n fullName,\n {\n ...args,\n name,\n namespace: args.namespace,\n },\n opts,\n )\n\n Gateway.gatewayCache.set(fullName, created)\n return created\n }\n}\n\nclass CreatedGateway extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.Gateway(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:Gateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nclass GatewayPatch extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.GatewayPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:GatewayPatch\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nexport type WrappedGatewayArgs = {\n /**\n * The underlying Kubernetes gateway to wrap.\n */\n gateway: Input<gateway.v1.Gateway>\n\n /**\n * The namespace where the gateway is located.\n */\n namespace: Input<Namespace>\n}\n\nclass WrappedGateway extends Gateway {\n constructor(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n output(args.gateway).metadata as Output<types.output.meta.v1.ObjectMeta>,\n output(args.gateway).spec,\n output(args.gateway).status,\n )\n }\n}\n\nexport type ExternalGatewayArgs = {\n /**\n * The name of the gateway to get.\n */\n name: Input<string>\n\n /**\n * The namespace of the gateway to get.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalGateway extends Gateway {\n constructor(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return gateway.v1.Gateway.get(\n name,\n interpolate`${output(args.namespace).metadata.name}/${args.name}`,\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:ExternalGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalize,\n normalizeInputs,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { map, pipe } from \"remeda\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type HttpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The alias for `hostnames: [hostname]`.\n */\n hostname?: Input<string>\n\n /**\n * The rule of the route.\n */\n rule?: Input<HttpRouteRuleArgs>\n\n /**\n * The rules of the route.\n */\n rules?: InputArray<HttpRouteRuleArgs>\n} & Omit<Partial<types.input.gateway.v1.HTTPRouteSpec>, \"rules\">\n\nexport type HttpRouteRuleArgs = Omit<\n types.input.gateway.v1.HTTPRouteSpecRules,\n \"matches\" | \"filters\" | \"backendRefs\"\n> & {\n /**\n * The conditions of the rule.\n * Can be specified as string to match on the path.\n */\n matches?: InputArray<HttpRouteRuleMatchOptions>\n\n /**\n * The condition of the rule.\n * Can be specified as string to match on the path.\n */\n match?: Input<HttpRouteRuleMatchOptions>\n\n /**\n * The filters of the rule.\n */\n filters?: InputArray<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The filter of the rule.\n */\n filter?: Input<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The service to route to.\n */\n backend?: Input<BackendRef>\n\n /**\n * The services to route to.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport type HttpRouteRuleMatchOptions = types.input.gateway.v1.HTTPRouteSpecRulesMatches | string\n\nexport class HttpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1.HTTPRoute>\n\n constructor(name: string, args: HttpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:HttpRoute\", name, args, opts)\n\n this.route = output(args.gateway).cluster.apply(cluster => {\n return new gateway.v1.HTTPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: output(args.gateway).namespace.metadata.name,\n })),\n spec: {\n hostnames: normalizeInputs(args.hostname, args.hostnames),\n\n parentRefs: [\n {\n name: output(args.gateway).metadata.name,\n },\n ],\n\n rules: normalizeInputsAndMap(args.rule, args.rules, rule => ({\n timeouts: rule.timeouts,\n\n matches: pipe(\n normalize(rule.match, rule.matches),\n map(mapHttpRouteRuleMatch),\n addDefaultPathMatch,\n ),\n\n filters: normalize(rule.filter, rule.filters),\n backendRefs: normalizeInputsAndMap(rule.backend, rule.backends, resolveBackendRef),\n })),\n } satisfies types.input.gateway.v1.HTTPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n\nfunction addDefaultPathMatch(\n matches: types.input.gateway.v1.HTTPRouteSpecRulesMatches[],\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches[] {\n return matches.length ? matches : [{ path: { type: \"PathPrefix\", value: \"/\" } }]\n}\n\nexport function mapHttpRouteRuleMatch(\n match: HttpRouteRuleMatchOptions,\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches {\n if (typeof match === \"string\") {\n return { path: { type: \"PathPrefix\", value: match } }\n }\n\n return match\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type TcpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class TcpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.TCPRoute>\n\n constructor(name: string, args: TcpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:TcpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.TCPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.TCPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.TCPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type UdpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class UdpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.UDPRoute>\n\n constructor(name: string, args: UdpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:UdpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.UDPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.UDPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.UDPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/gateway/backend.ts","../src/gateway/gateway.ts","../src/gateway/http-route.ts","../src/gateway/tcp-route.ts","../src/gateway/udp-route.ts"],"names":["output","ComponentResource","gateway","normalizeInputsAndMap"],"mappings":";;;;;;;;AAoCO,SAAS,kBAAkB,GAAA,EAAiD;AACjF,EAAA,IAAI,OAAA,CAAQ,UAAA,CAAW,GAAG,CAAA,EAAG;AAC3B,IAAA,OAAO,MAAA,CAAO;AAAA,MACZ,IAAA,EAAM,IAAI,QAAA,CAAS,IAAA;AAAA,MACnB,SAAA,EAAW,IAAI,QAAA,CAAS,SAAA;AAAA,MACxB,IAAA,EAAM,GAAA,CAAI,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA,CAAE;AAAA,KACzB,CAAA;AAAA,EACH;AAEA,EAAA,IAAI,aAAa,GAAA,EAAK;AACpB,IAAA,MAAM,OAAA,GAAU,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA;AAElC,IAAA,OAAO,MAAA,CAAO;AAAA,MACZ,IAAA,EAAM,QAAQ,QAAA,CAAS,IAAA;AAAA,MACvB,SAAA,EAAW,QAAQ,QAAA,CAAS,SAAA;AAAA,MAC5B,MAAM,GAAA,CAAI;AAAA,KACX,CAAA;AAAA,EACH;AAEA,EAAA,OAAO,MAAA,CAAO;AAAA,IACZ,MAAM,GAAA,CAAI,IAAA;AAAA,IACV,WAAW,GAAA,CAAI,SAAA;AAAA,IACf,MAAM,G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AA;AAAA,YACA,KAAA,EAAO;AAAA,cACL;AAAA,gBACE;AAAA;AACF;AACF;AACF,SACF;AAAA,QACA,EAAE,GAAG,IAAA,EAAM,MAAA,EAAQ,MAAM,QAAA,EAAU,WAAA,CAAY,OAAO,CAAA;AAAE,OAC1D;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF","file":"chunk-Q35R54GK.js","sourcesContent":["import type { core } from \"@pulumi/kubernetes\"\nimport { type Input, type Output, output, type Unwrap } from \"@highstate/pulumi\"\nimport { Service } from \"../service\"\n\nexport interface FullBackendRef {\n /**\n * The name of the resource being referenced.\n */\n name: Input<string>\n\n /**\n * The namespace of the resource being referenced.\n * May be undefined if the resource is not in a namespace.\n */\n namespace?: Input<string | undefined>\n\n /**\n * The port of the resource being referenced.\n */\n port: Input<number>\n}\n\nexport interface ServiceBackendRef {\n /**\n * The name of the service being referenced.\n */\n service: Input<core.v1.Service>\n\n /**\n * The port of the service being referenced.\n */\n port: Input<number>\n}\n\nexport type BackendRef = FullBackendRef | ServiceBackendRef | Service\n\nexport function resolveBackendRef(ref: BackendRef): Output<Unwrap<FullBackendRef>> {\n if (Service.isInstance(ref)) {\n return output({\n name: ref.metadata.name,\n namespace: ref.metadata.namespace,\n port: ref.spec.ports[0].port,\n })\n }\n\n if (\"service\" in ref) {\n const service = output(ref.service)\n\n return output({\n name: service.metadata.name,\n namespace: service.metadata.namespace,\n port: ref.port,\n })\n }\n\n return output({\n name: ref.name,\n namespace: ref.namespace,\n port: ref.port,\n })\n}\n","import type { k8s, network } from \"@highstate/library\"\nimport type { types } from \"@pulumi/kubernetes\"\nimport type { SetRequired } from \"type-fest\"\nimport { parseL3Endpoint } from \"@highstate/common\"\nimport { getOrCreate } from \"@highstate/contract\"\nimport { gateway, type types as gwTypes } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n type Inputs,\n interpolate,\n type Output,\n output,\n toPromise,\n} from \"@highstate/pulumi\"\nimport { omit } from \"remeda\"\nimport { Namespace } from \"../namespace\"\nimport { commonExtraArgs, getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\n\nexport type GatewayArgs = ScopedResourceArgs & {\n /**\n * The FQDN to configure the listeners for.\n */\n fqdn?: Input<string>\n\n /**\n * The FQDNs to configure the listeners for.\n */\n fqdns?: InputArray<string>\n} & gwTypes.input.gateway.v1.GatewaySpec\n\nexport type CreateOrGetGatewayArgs = GatewayArgs & {\n /**\n * The gateway entity to patch/retrieve.\n */\n existing: Input<k8s.Gateway> | undefined\n}\n\nconst gatewayExtraArgs = [...commonExtraArgs, \"fqdn\", \"fqdns\"] as const\n\n/**\n * Represents a Kubernetes Gateway resource.\n */\nexport abstract class Gateway extends ComponentResource {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n /**\n * The namespace where the gateway is located.\n */\n readonly namespace: Output<Namespace>,\n\n /**\n * The metadata of the underlying Kubernetes gateway.\n */\n readonly metadata: Output<types.output.meta.v1.ObjectMeta>,\n\n /**\n * The spec of the underlying Gateway resource.\n */\n readonly spec: Output<gwTypes.output.gateway.v1.GatewaySpec>,\n\n /**\n * The status of the underlying Gateway resource.\n */\n readonly status: Output<gwTypes.output.gateway.v1.GatewayStatus>,\n ) {\n super(type, name, args, opts)\n }\n\n /**\n * The cluster where the gateway is located.\n */\n get cluster(): Output<k8s.Cluster> {\n return this.namespace.cluster\n }\n\n /**\n * The Highstate gateway entity.\n */\n get entity(): Output<k8s.Gateway> {\n return output({\n type: \"gateway\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n })\n }\n\n /**\n * Returns the endpoints L3 endpoints on which the gateway is exposed.\n */\n get endpoints(): Output<network.L3Endpoint[]> {\n return this.status.addresses.apply(addresses => {\n if (!addresses) {\n return []\n }\n\n return addresses.map(address => parseL3Endpoint(address.value))\n })\n }\n\n /**\n * Creates a new gateway.\n */\n static create(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to create or patch the gateway with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Gateway {\n if (args.existing) {\n return new GatewayPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n namespace: Namespace.forResourceAsync(args.existing, output(args.namespace).cluster),\n })\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Creates a new gateway or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the gateway name. Will not be used when existing gateway is retrieved.\n * @param args The arguments to create or get the gateway with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetGatewayArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n if (args.existing) {\n return await Gateway.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedGateway(name, args, opts)\n }\n\n /**\n * Patches an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n *\n * @param name The name of the resource. May not be the same as the gateway name.\n * @param args The arguments to patch the gateway with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: GatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new GatewayPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes gateway.\n */\n static wrap(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new WrappedGateway(name, args, opts)\n }\n\n /**\n * Gets an existing gateway.\n *\n * Will throw an error if the gateway does not exist.\n */\n static get(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions): Gateway {\n return new ExternalGateway(name, args, opts)\n }\n\n private static readonly gatewayCache = new Map<string, Gateway>()\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static for(entity: k8s.Gateway, cluster: Input<k8s.Cluster>): Gateway {\n return getOrCreate(\n Gateway.gatewayCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Gateway.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResourceAsync(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing gateway for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{gatewayName}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the gateway for.\n * @param cluster The cluster where the gateway is located.\n */\n static async forAsync(entity: Input<k8s.Gateway>, cluster: Input<k8s.Cluster>): Promise<Gateway> {\n const resolvedEntity = await toPromise(entity)\n\n return Gateway.for(resolvedEntity, output(cluster))\n }\n\n /**\n * Creates a gateway with the provided name/namespace/cluster only once.\n *\n * It automatically names the resource with the following format: `{name}.{namespace}.{clusterName}.{clusterId}`.\n *\n * On subsequent calls the gateway is patched with the union of existing and requested listeners.\n * Only the listeners field is modified to avoid altering other spec fields.\n *\n * @param name The name of the gateway to create.\n * @param args The arguments to create the gateway with.\n * @param opts Optional resource options.\n */\n static async createOnce(\n args: SetRequired<GatewayArgs, \"name\">,\n opts?: ComponentResourceOptions,\n ): Promise<Gateway> {\n const { name, namespace, cluster } = await toPromise({\n name: args.name,\n namespace: output(args.namespace).metadata.name,\n cluster: output(args.namespace).cluster,\n })\n\n const fullName = `${name}.${namespace}.${cluster.name}.${cluster.id}`\n\n const existing = Gateway.gatewayCache.get(fullName)\n if (existing) {\n Gateway.patch(\n fullName,\n {\n name,\n namespace: args.namespace,\n listeners: args.listeners,\n },\n opts,\n )\n\n return existing\n }\n\n const created = Gateway.create(\n fullName,\n {\n ...args,\n name,\n namespace: args.namespace,\n },\n opts,\n )\n\n Gateway.gatewayCache.set(fullName, created)\n return created\n }\n}\n\nclass CreatedGateway extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.Gateway(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:Gateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nclass GatewayPatch extends Gateway {\n constructor(name: string, args: GatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return new gateway.v1.GatewayPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: omit(args, gatewayExtraArgs),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:GatewayPatch\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n\nexport type WrappedGatewayArgs = {\n /**\n * The underlying Kubernetes gateway to wrap.\n */\n gateway: Input<gateway.v1.Gateway>\n\n /**\n * The namespace where the gateway is located.\n */\n namespace: Input<Namespace>\n}\n\nclass WrappedGateway extends Gateway {\n constructor(name: string, args: WrappedGatewayArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n output(args.gateway).metadata as Output<types.output.meta.v1.ObjectMeta>,\n output(args.gateway).spec,\n output(args.gateway).status,\n )\n }\n}\n\nexport type ExternalGatewayArgs = {\n /**\n * The name of the gateway to get.\n */\n name: Input<string>\n\n /**\n * The namespace of the gateway to get.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalGateway extends Gateway {\n constructor(name: string, args: ExternalGatewayArgs, opts?: ComponentResourceOptions) {\n const gatewayResource = output(args.namespace).cluster.apply(cluster => {\n return gateway.v1.Gateway.get(\n name,\n interpolate`${output(args.namespace).metadata.name}/${args.name}`,\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:ExternalGateway\",\n name,\n args,\n opts,\n\n output(args.namespace),\n gatewayResource.metadata as Output<types.output.meta.v1.ObjectMeta>,\n gatewayResource.spec,\n gatewayResource.status,\n )\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalize,\n normalizeInputs,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { map, pipe } from \"remeda\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type HttpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The alias for `hostnames: [hostname]`.\n */\n hostname?: Input<string>\n\n /**\n * The rule of the route.\n */\n rule?: Input<HttpRouteRuleArgs>\n\n /**\n * The rules of the route.\n */\n rules?: InputArray<HttpRouteRuleArgs>\n} & Omit<Partial<types.input.gateway.v1.HTTPRouteSpec>, \"rules\">\n\nexport type HttpRouteRuleArgs = Omit<\n types.input.gateway.v1.HTTPRouteSpecRules,\n \"matches\" | \"filters\" | \"backendRefs\"\n> & {\n /**\n * The conditions of the rule.\n * Can be specified as string to match on the path.\n */\n matches?: InputArray<HttpRouteRuleMatchOptions>\n\n /**\n * The condition of the rule.\n * Can be specified as string to match on the path.\n */\n match?: Input<HttpRouteRuleMatchOptions>\n\n /**\n * The filters of the rule.\n */\n filters?: InputArray<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The filter of the rule.\n */\n filter?: Input<types.input.gateway.v1.HTTPRouteSpecRulesFilters>\n\n /**\n * The service to route to.\n */\n backend?: Input<BackendRef>\n\n /**\n * The services to route to.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport type HttpRouteRuleMatchOptions = types.input.gateway.v1.HTTPRouteSpecRulesMatches | string\n\nexport class HttpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1.HTTPRoute>\n\n constructor(name: string, args: HttpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:HttpRoute\", name, args, opts)\n\n this.route = output(args.gateway).cluster.apply(cluster => {\n return new gateway.v1.HTTPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: output(args.gateway).namespace.metadata.name,\n })),\n spec: {\n hostnames: normalizeInputs(args.hostname, args.hostnames),\n\n parentRefs: [\n {\n name: output(args.gateway).metadata.name,\n },\n ],\n\n rules: normalizeInputsAndMap(args.rule, args.rules, rule => ({\n timeouts: rule.timeouts,\n\n matches: pipe(\n normalize(rule.match, rule.matches),\n map(mapHttpRouteRuleMatch),\n addDefaultPathMatch,\n ),\n\n filters: normalize(rule.filter, rule.filters),\n backendRefs: normalizeInputsAndMap(rule.backend, rule.backends, resolveBackendRef),\n })),\n } satisfies types.input.gateway.v1.HTTPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n\nfunction addDefaultPathMatch(\n matches: types.input.gateway.v1.HTTPRouteSpecRulesMatches[],\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches[] {\n return matches.length ? matches : [{ path: { type: \"PathPrefix\", value: \"/\" } }]\n}\n\nexport function mapHttpRouteRuleMatch(\n match: HttpRouteRuleMatchOptions,\n): types.input.gateway.v1.HTTPRouteSpecRulesMatches {\n if (typeof match === \"string\") {\n return { path: { type: \"PathPrefix\", value: match } }\n }\n\n return match\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type TcpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class TcpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.TCPRoute>\n\n constructor(name: string, args: TcpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:TcpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.TCPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.TCPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.TCPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n","import type { Gateway } from \"./gateway\"\nimport { gateway, type types } from \"@highstate/gateway-api\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n normalizeInputsAndMap,\n type Output,\n output,\n} from \"@highstate/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs } from \"../shared\"\nimport { type BackendRef, resolveBackendRef } from \"./backend\"\n\nexport type UdpRouteArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The gateway to associate with the route.\n */\n gateway: Input<Gateway>\n\n /**\n * The name of the listener to attach the route to.\n */\n listenerName: Input<string>\n\n /**\n * The backend reference handled by the route.\n */\n backend?: Input<BackendRef>\n\n /**\n * The backend references handled by the route.\n */\n backends?: InputArray<BackendRef>\n}\n\nexport class UdpRoute extends ComponentResource {\n /**\n * The underlying Kubernetes resource.\n */\n public readonly route: Output<gateway.v1alpha2.UDPRoute>\n\n constructor(name: string, args: UdpRouteArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:UdpRoute\", name, args, opts)\n\n const gatewayOutput = output(args.gateway)\n\n const parentRefs = output({\n gateway: gatewayOutput,\n listenerName: args.listenerName,\n }).apply(\n ({ gateway, listenerName }) =>\n [\n {\n group: \"gateway.networking.k8s.io\",\n kind: \"Gateway\",\n name: gateway.metadata.name,\n namespace: gateway.namespace.metadata.name,\n sectionName: listenerName,\n },\n ] satisfies types.input.gateway.v1alpha2.UDPRouteSpecParentRefs[],\n )\n\n const backendRefs = normalizeInputsAndMap(args.backend, args.backends, resolveBackendRef)\n\n this.route = gatewayOutput.cluster.apply(cluster => {\n return new gateway.v1alpha2.UDPRoute(\n name,\n {\n metadata: mapMetadata(args, name).apply(metadata => ({\n ...metadata,\n namespace: gatewayOutput.namespace.metadata.name,\n })),\n spec: {\n parentRefs,\n rules: [\n {\n backendRefs,\n },\n ],\n } satisfies types.input.gateway.v1alpha2.UDPRouteSpec,\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Secret } from './chunk-
|
|
2
|
-
import { getProvider, getNamespaceName } from './chunk-
|
|
1
|
+
import { Secret } from './chunk-LR6OTL6T.js';
|
|
2
|
+
import { getProvider, getNamespaceName } from './chunk-UHWJ2GDK.js';
|
|
3
3
|
import { ComponentResource, output, normalizeInputs, interpolate, toPromise } from '@highstate/pulumi';
|
|
4
4
|
import { KubeConfig } from '@kubernetes/client-node';
|
|
5
5
|
import { core, rbac } from '@pulumi/kubernetes';
|
|
@@ -164,5 +164,5 @@ var ClusterAccessScope = class _ClusterAccessScope extends ComponentResource {
|
|
|
164
164
|
};
|
|
165
165
|
|
|
166
166
|
export { ClusterAccessScope };
|
|
167
|
-
//# sourceMappingURL=chunk-
|
|
168
|
-
//# sourceMappingURL=chunk-
|
|
167
|
+
//# sourceMappingURL=chunk-SY7FPT77.js.map
|
|
168
|
+
//# sourceMappingURL=chunk-SY7FPT77.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rbac.ts"],"names":["serviceAccount","kubeconfig"],"mappings":";;;;;;;;AAqFO,IAAM,kBAAA,GAAN,MAAM,mBAAA,SAA2B,iBAAA,CAAkB;AAAA;AAAA;AAAA;AAAA,EAI/C,OAAA;AAAA,EAET,WAAA,CAAY,IAAA,EAAc,IAAA,EAA8B,IAAA,EAAiC;AACvF,IAAA,KAAA,CAAM,kCAAA,EAAoC,IAAA,EAAM,IAAA,EAAM,IAAI,CAAA;AAE1D,IAAA,MAAM,EAAE,cAAA,EAAgB,UAAA,EAAW,GAAI,MAAA,CAAO,KAAK,SAAS,CAAA,CAAE,OAAA,CAAQ,KAAA,CAAM,CAAA,OAAA,KAAW;AACrF,MAAA,MAAM,QAAA,GAAW,YAAY,OAAO,CAAA;AACpC,MAAA,MAAM,aAAA,GAAgB,MAAA,CAAO,IAAA,CAAK,SAAS,EAAE,QAAA,CAAS,IAAA;AAEtD,MAAA,MAAMA,eAAAA,G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CAAA,CAAA,MAAM;AAAA,UACxB,SAAA,EAAW,CAAA,CAAE,UAAA,KAAe,IAAA,GAAO,CAAC,EAAE,CAAA,GAAI,CAAC,CAAA,CAAE,UAAA,CAAW,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAC,CAAA;AAAA,UACrE,SAAA,EAAW,CAAC,CAAA,CAAE,IAAA,CAAK,WAAA,MAAiB,CAAA,CAAE,QAAA,EAAU,IAAA,GAAO,GAAA,GAAM,EAAA,CAAG,CAAA;AAAA,UAChE,aAAA,EAAe,EAAE,QAAA,EAAU,IAAA,GAAO,CAAC,CAAA,CAAE,QAAA,CAAS,IAAI,CAAA,GAAI,MAAA;AAAA,UACtD,OAAO,IAAA,CAAK;AAAA,SACd,CAAE;AAAA,OACJ;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACF","file":"chunk-FKJLPM3M.js","sourcesContent":["import type { k8s } from \"@highstate/library\"\nimport type { Namespace } from \"./namespace\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n interpolate,\n normalizeInputs,\n type Output,\n output,\n toPromise,\n} from \"@highstate/pulumi\"\nimport { KubeConfig } from \"@kubernetes/client-node\"\nimport { core, rbac, type types } from \"@pulumi/kubernetes\"\nimport { map, unique } from \"remeda\"\nimport { stringify } from \"yaml\"\nimport { Secret } from \"./secret\"\nimport { getNamespaceName, getProvider, type NamespaceLike, type ScopedResource } from \"./shared\"\n\nexport type ClusterAccessScopeArgs = {\n /**\n * The namespace to locate the ServiceAccount in.\n */\n namespace: Input<Namespace>\n\n /**\n * The RBAC rule to apply to the `ServiceAccount`.\n *\n * It will be used to create ClusterRole.\n */\n rule?: Input<types.input.rbac.v1.PolicyRule>\n\n /**\n * The RBAC rules to apply to the `ServiceAccount`.\n *\n * It will be used to create `ClusterRole`.\n */\n rules?: InputArray<types.input.rbac.v1.PolicyRule>\n\n /**\n * Whether to allow the `ServiceAccount` to access resources in the namespace where it is created.\n *\n * By default, it is set to `true`.\n */\n allowOriginNamespace?: boolean\n\n /**\n * The extra namespaces to bind to the `ClusterRole` and allow `ServiceAccount` to access them\n * with specified `rules`.\n */\n extraNamespaces?: InputArray<NamespaceLike>\n\n /**\n * Whether to create `ClusterRoleBinding` to bind the `ServiceAccount` to the `ClusterRole`.\n *\n * This will allow the `ServiceAccount` to access all namespaces and cluster resources.\n */\n clusterWide?: boolean\n}\n\nexport type ClusterAccessScopeForResourcesArgs = {\n /**\n * The namespace to locate the `ServiceAccount` in.\n */\n namespace: Input<Namespace>\n\n /**\n * The verbs to allow on the resources.\n */\n verbs: string[]\n\n /**\n * The resources to allow verbs on.\n */\n resources: InputArray<ScopedResource>\n\n /**\n * Whether to allow access on the whole collection rather than specific resources.\n *\n * The provided resources in this case will be used to determine the types and api groups only.\n */\n collectionAccess?: boolean\n}\n\nexport class ClusterAccessScope extends ComponentResource {\n /**\n * The cluster entity with the reduced access.\n */\n readonly cluster: Output<k8s.Cluster>\n\n constructor(name: string, args: ClusterAccessScopeArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:ClusterAccessScope\", name, args, opts)\n\n const { serviceAccount, kubeconfig } = output(args.namespace).cluster.apply(cluster => {\n const provider = getProvider(cluster)\n const namespaceName = output(args.namespace).metadata.name\n\n const serviceAccount = new core.v1.ServiceAccount(\n name,\n {\n metadata: {\n name,\n namespace: namespaceName,\n },\n },\n { provider },\n )\n\n const clusterRole = new rbac.v1.ClusterRole(\n name,\n {\n metadata: {\n name: interpolate`highstate.${namespaceName}.${name}`,\n annotations: {\n \"kubernetes.io/description\": interpolate`Created by Highstate for the ServiceAccount \"${name}\" in the namespace \"${namespaceName}\".`,\n },\n },\n rules: normalizeInputs(args.rule, args.rules),\n },\n { provider },\n )\n\n const createRoleBinding = (namespace: Input<string>) => {\n return new rbac.v1.RoleBinding(\n name,\n {\n metadata: { name, namespace },\n roleRef: {\n kind: \"ClusterRole\",\n name: clusterRole.metadata.name,\n apiGroup: \"rbac.authorization.k8s.io\",\n },\n subjects: [\n {\n kind: \"ServiceAccount\",\n name: serviceAccount.metadata.name,\n namespace: namespaceName,\n },\n ],\n },\n { provider },\n )\n }\n\n if (args.allowOriginNamespace ?? true) {\n createRoleBinding(namespaceName)\n }\n\n output(args.extraNamespaces ?? [])\n .apply(map(getNamespaceName))\n .apply(map(createRoleBinding))\n\n return { serviceAccount, kubeconfig: cluster.kubeconfig }\n })\n\n const accessTokenSecret = Secret.create(`${name}-token`, {\n namespace: args.namespace,\n type: \"kubernetes.io/service-account-token\",\n metadata: {\n annotations: {\n \"kubernetes.io/service-account.name\": serviceAccount.metadata.name,\n },\n },\n })\n\n this.cluster = output({\n cluster: output(args.namespace).cluster,\n kubeconfig,\n newToken: accessTokenSecret.getValue(\"token\"),\n serviceAccount: serviceAccount.metadata.name,\n }).apply(({ cluster, kubeconfig, newToken, serviceAccount }) => {\n const config = new KubeConfig()\n config.loadFromString(kubeconfig)\n\n // clear all existing contexts and users\n config.users = []\n config.contexts = []\n\n config.addUser({ name: serviceAccount, token: newToken })\n\n config.addContext({\n name: config.clusters[0].name,\n cluster: config.clusters[0].name,\n user: serviceAccount,\n })\n\n config.setCurrentContext(config.clusters[0].name)\n\n return {\n ...cluster,\n kubeconfig: stringify(JSON.parse(config.exportConfig())),\n }\n })\n }\n\n /**\n * Creates `ClusterAccessScope` for the given resources with the specified verbs.\n *\n * All resources must belong to the same namespace in the same cluster.\n *\n * @param name The name of the resource and the ServiceAccount.\n * @param resources The resources to create access scope for.\n * @param verbs The verbs to allow on the resources.\n */\n static async forResources(\n name: string,\n args: ClusterAccessScopeForResourcesArgs,\n opts?: ComponentResourceOptions,\n ): Promise<ClusterAccessScope> {\n const resolved = await toPromise(\n output(args.resources).apply(resources =>\n resources.map(r => ({\n namespaceId: r.namespace.metadata.uid,\n namespace: r.namespace,\n metadata: r.metadata,\n apiVersion: r.apiVersion,\n kind: r.kind,\n })),\n ),\n )\n\n if (resolved.length === 0) {\n throw new Error(\"No resources provided to forResources.\")\n }\n\n if (unique(resolved.map(r => r.namespaceId)).length > 1) {\n throw new Error(\"All resources must belong to the same namespace.\")\n }\n\n const saNamespaceId = await toPromise(output(args.namespace).metadata.uid)\n\n if (resolved[0].namespaceId !== saNamespaceId) {\n throw new Error(\"The resources must belong to the same namespace as the ServiceAccount.\")\n }\n\n if (args.collectionAccess) {\n // when collection access is requested, we only need to know the types and api groups\n const uniqueTypes = unique(resolved.map(r => `${r.apiVersion}::${r.kind}`))\n\n return new ClusterAccessScope(\n name,\n {\n namespace: args.namespace,\n rules: uniqueTypes.map(t => {\n const [apiVersion, kind] = t.split(\"::\")\n\n return {\n apiGroups: apiVersion === \"v1\" ? [\"\"] : [apiVersion.split(\"/\")[0]],\n resources: [`${kind.toLowerCase()}s`],\n verbs: args.verbs,\n }\n }),\n },\n opts,\n )\n }\n\n return new ClusterAccessScope(\n name,\n {\n namespace: args.namespace,\n rules: resolved.map(r => ({\n apiGroups: r.apiVersion === \"v1\" ? [\"\"] : [r.apiVersion.split(\"/\")[0]],\n resources: [r.kind.toLowerCase() + (r.metadata?.name ? \"s\" : \"\")],\n resourceNames: r.metadata?.name ? [r.metadata.name] : undefined,\n verbs: args.verbs,\n })),\n },\n opts,\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/rbac.ts"],"names":["serviceAccount","kubeconfig"],"mappings":";;;;;;;;AAqFO,IAAM,kBAAA,GAAN,MAAM,mBAAA,SAA2B,iBAAA,CAAkB;AAAA;AAAA;AAAA;AAAA,EAI/C,OAAA;AAAA,EAET,WAAA,CAAY,IAAA,EAAc,IAAA,EAA8B,IAAA,EAAiC;AACvF,IAAA,KAAA,CAAM,kCAAA,EAAoC,IAAA,EAAM,IAAA,EAAM,IAAI,CAAA;AAE1D,IAAA,MAAM,EAAE,cAAA,EAAgB,UAAA,EAAW,GAAI,MAAA,CAAO,KAAK,SAAS,CAAA,CAAE,OAAA,CAAQ,KAAA,CAAM,CAAA,OAAA,KAAW;AACrF,MAAA,MAAM,QAAA,GA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IAAA,OAAO,IAAI,mBAAA;AAAA,MACT,IAAA;AAAA,MACA;AAAA,QACE,WAAW,IAAA,CAAK,SAAA;AAAA,QAChB,KAAA,EAAO,QAAA,CAAS,GAAA,CAAI,CAAA,CAAA,MAAM;AAAA,UACxB,SAAA,EAAW,CAAA,CAAE,UAAA,KAAe,IAAA,GAAO,CAAC,EAAE,CAAA,GAAI,CAAC,CAAA,CAAE,UAAA,CAAW,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAC,CAAA;AAAA,UACrE,SAAA,EAAW,CAAC,CAAA,CAAE,IAAA,CAAK,WAAA,MAAiB,CAAA,CAAE,QAAA,EAAU,IAAA,GAAO,GAAA,GAAM,EAAA,CAAG,CAAA;AAAA,UAChE,aAAA,EAAe,EAAE,QAAA,EAAU,IAAA,GAAO,CAAC,CAAA,CAAE,QAAA,CAAS,IAAI,CAAA,GAAI,MAAA;AAAA,UACtD,OAAO,IAAA,CAAK;AAAA,SACd,CAAE;AAAA,OACJ;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACF","file":"chunk-SY7FPT77.js","sourcesContent":["import type { k8s } from \"@highstate/library\"\nimport type { Namespace } from \"./namespace\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type InputArray,\n interpolate,\n normalizeInputs,\n type Output,\n output,\n toPromise,\n} from \"@highstate/pulumi\"\nimport { KubeConfig } from \"@kubernetes/client-node\"\nimport { core, rbac, type types } from \"@pulumi/kubernetes\"\nimport { map, unique } from \"remeda\"\nimport { stringify } from \"yaml\"\nimport { Secret } from \"./secret\"\nimport { getNamespaceName, getProvider, type NamespaceLike, type ScopedResource } from \"./shared\"\n\nexport type ClusterAccessScopeArgs = {\n /**\n * The namespace to locate the ServiceAccount in.\n */\n namespace: Input<Namespace>\n\n /**\n * The RBAC rule to apply to the `ServiceAccount`.\n *\n * It will be used to create ClusterRole.\n */\n rule?: Input<types.input.rbac.v1.PolicyRule>\n\n /**\n * The RBAC rules to apply to the `ServiceAccount`.\n *\n * It will be used to create `ClusterRole`.\n */\n rules?: InputArray<types.input.rbac.v1.PolicyRule>\n\n /**\n * Whether to allow the `ServiceAccount` to access resources in the namespace where it is created.\n *\n * By default, it is set to `true`.\n */\n allowOriginNamespace?: boolean\n\n /**\n * The extra namespaces to bind to the `ClusterRole` and allow `ServiceAccount` to access them\n * with specified `rules`.\n */\n extraNamespaces?: InputArray<NamespaceLike>\n\n /**\n * Whether to create `ClusterRoleBinding` to bind the `ServiceAccount` to the `ClusterRole`.\n *\n * This will allow the `ServiceAccount` to access all namespaces and cluster resources.\n */\n clusterWide?: boolean\n}\n\nexport type ClusterAccessScopeForResourcesArgs = {\n /**\n * The namespace to locate the `ServiceAccount` in.\n */\n namespace: Input<Namespace>\n\n /**\n * The verbs to allow on the resources.\n */\n verbs: string[]\n\n /**\n * The resources to allow verbs on.\n */\n resources: InputArray<ScopedResource>\n\n /**\n * Whether to allow access on the whole collection rather than specific resources.\n *\n * The provided resources in this case will be used to determine the types and api groups only.\n */\n collectionAccess?: boolean\n}\n\nexport class ClusterAccessScope extends ComponentResource {\n /**\n * The cluster entity with the reduced access.\n */\n readonly cluster: Output<k8s.Cluster>\n\n constructor(name: string, args: ClusterAccessScopeArgs, opts?: ComponentResourceOptions) {\n super(\"highstate:k8s:ClusterAccessScope\", name, args, opts)\n\n const { serviceAccount, kubeconfig } = output(args.namespace).cluster.apply(cluster => {\n const provider = getProvider(cluster)\n const namespaceName = output(args.namespace).metadata.name\n\n const serviceAccount = new core.v1.ServiceAccount(\n name,\n {\n metadata: {\n name,\n namespace: namespaceName,\n },\n },\n { provider },\n )\n\n const clusterRole = new rbac.v1.ClusterRole(\n name,\n {\n metadata: {\n name: interpolate`highstate.${namespaceName}.${name}`,\n annotations: {\n \"kubernetes.io/description\": interpolate`Created by Highstate for the ServiceAccount \"${name}\" in the namespace \"${namespaceName}\".`,\n },\n },\n rules: normalizeInputs(args.rule, args.rules),\n },\n { provider },\n )\n\n const createRoleBinding = (namespace: Input<string>) => {\n return new rbac.v1.RoleBinding(\n name,\n {\n metadata: { name, namespace },\n roleRef: {\n kind: \"ClusterRole\",\n name: clusterRole.metadata.name,\n apiGroup: \"rbac.authorization.k8s.io\",\n },\n subjects: [\n {\n kind: \"ServiceAccount\",\n name: serviceAccount.metadata.name,\n namespace: namespaceName,\n },\n ],\n },\n { provider },\n )\n }\n\n if (args.allowOriginNamespace ?? true) {\n createRoleBinding(namespaceName)\n }\n\n output(args.extraNamespaces ?? [])\n .apply(map(getNamespaceName))\n .apply(map(createRoleBinding))\n\n return { serviceAccount, kubeconfig: cluster.kubeconfig }\n })\n\n const accessTokenSecret = Secret.create(`${name}-token`, {\n namespace: args.namespace,\n type: \"kubernetes.io/service-account-token\",\n metadata: {\n annotations: {\n \"kubernetes.io/service-account.name\": serviceAccount.metadata.name,\n },\n },\n })\n\n this.cluster = output({\n cluster: output(args.namespace).cluster,\n kubeconfig,\n newToken: accessTokenSecret.getValue(\"token\"),\n serviceAccount: serviceAccount.metadata.name,\n }).apply(({ cluster, kubeconfig, newToken, serviceAccount }) => {\n const config = new KubeConfig()\n config.loadFromString(kubeconfig)\n\n // clear all existing contexts and users\n config.users = []\n config.contexts = []\n\n config.addUser({ name: serviceAccount, token: newToken })\n\n config.addContext({\n name: config.clusters[0].name,\n cluster: config.clusters[0].name,\n user: serviceAccount,\n })\n\n config.setCurrentContext(config.clusters[0].name)\n\n return {\n ...cluster,\n kubeconfig: stringify(JSON.parse(config.exportConfig())),\n }\n })\n }\n\n /**\n * Creates `ClusterAccessScope` for the given resources with the specified verbs.\n *\n * All resources must belong to the same namespace in the same cluster.\n *\n * @param name The name of the resource and the ServiceAccount.\n * @param resources The resources to create access scope for.\n * @param verbs The verbs to allow on the resources.\n */\n static async forResources(\n name: string,\n args: ClusterAccessScopeForResourcesArgs,\n opts?: ComponentResourceOptions,\n ): Promise<ClusterAccessScope> {\n const resolved = await toPromise(\n output(args.resources).apply(resources =>\n resources.map(r => ({\n namespaceId: r.namespace.metadata.uid,\n namespace: r.namespace,\n metadata: r.metadata,\n apiVersion: r.apiVersion,\n kind: r.kind,\n })),\n ),\n )\n\n if (resolved.length === 0) {\n throw new Error(\"No resources provided to forResources.\")\n }\n\n if (unique(resolved.map(r => r.namespaceId)).length > 1) {\n throw new Error(\"All resources must belong to the same namespace.\")\n }\n\n const saNamespaceId = await toPromise(output(args.namespace).metadata.uid)\n\n if (resolved[0].namespaceId !== saNamespaceId) {\n throw new Error(\"The resources must belong to the same namespace as the ServiceAccount.\")\n }\n\n if (args.collectionAccess) {\n // when collection access is requested, we only need to know the types and api groups\n const uniqueTypes = unique(resolved.map(r => `${r.apiVersion}::${r.kind}`))\n\n return new ClusterAccessScope(\n name,\n {\n namespace: args.namespace,\n rules: uniqueTypes.map(t => {\n const [apiVersion, kind] = t.split(\"::\")\n\n return {\n apiGroups: apiVersion === \"v1\" ? [\"\"] : [apiVersion.split(\"/\")[0]],\n resources: [`${kind.toLowerCase()}s`],\n verbs: args.verbs,\n }\n }),\n },\n opts,\n )\n }\n\n return new ClusterAccessScope(\n name,\n {\n namespace: args.namespace,\n rules: resolved.map(r => ({\n apiGroups: r.apiVersion === \"v1\" ? [\"\"] : [r.apiVersion.split(\"/\")[0]],\n resources: [r.kind.toLowerCase() + (r.metadata?.name ? \"s\" : \"\")],\n resourceNames: r.metadata?.name ? [r.metadata.name] : undefined,\n verbs: args.verbs,\n })),\n },\n opts,\n )\n }\n}\n"]}
|
|
@@ -9,21 +9,21 @@ var images_exports = {};
|
|
|
9
9
|
__export(images_exports, {
|
|
10
10
|
default: () => images_default,
|
|
11
11
|
"terminal-kubectl": () => terminal_kubectl,
|
|
12
|
-
"worker
|
|
12
|
+
"worker.k8s-monitor": () => worker_k8s_monitor
|
|
13
13
|
});
|
|
14
14
|
var terminal_kubectl = {
|
|
15
|
-
name: "ghcr.io/
|
|
15
|
+
name: "ghcr.io/highstate-io/highstate/terminal.kubectl",
|
|
16
16
|
tag: "latest",
|
|
17
|
-
image: "ghcr.io/
|
|
17
|
+
image: "ghcr.io/highstate-io/highstate/terminal.kubectl:latest@sha256:2cd011119f6098d41b5bb377420f0106577d3b289ae4fc7982b4578b23c82ef4"
|
|
18
18
|
};
|
|
19
19
|
var worker_k8s_monitor = {
|
|
20
|
-
name: "ghcr.io/
|
|
20
|
+
name: "ghcr.io/highstate-io/highstate/worker.k8s-monitor",
|
|
21
21
|
tag: "latest",
|
|
22
|
-
image: "ghcr.io/
|
|
22
|
+
image: "ghcr.io/highstate-io/highstate/worker.k8s-monitor:latest@sha256:66b985a97925d39a4c6e2b15cbeefadaadfce0cb4d6e5df8881cca85281383d5"
|
|
23
23
|
};
|
|
24
24
|
var images_default = {
|
|
25
25
|
"terminal-kubectl": terminal_kubectl,
|
|
26
|
-
"worker
|
|
26
|
+
"worker.k8s-monitor": worker_k8s_monitor
|
|
27
27
|
};
|
|
28
28
|
var providers = /* @__PURE__ */ new Map();
|
|
29
29
|
function getProvider(cluster) {
|
|
@@ -356,5 +356,5 @@ var WrappedNamespace = class extends Namespace {
|
|
|
356
356
|
};
|
|
357
357
|
|
|
358
358
|
export { Namespace, ScopedResource, commonExtraArgs, getNamespaceName, getProvider, getProviderAsync, images_exports, mapMetadata, mapNamespaceNameToSelector, mapSelectorLikeToSelector, validateCluster };
|
|
359
|
-
//# sourceMappingURL=chunk-
|
|
360
|
-
//# sourceMappingURL=chunk-
|
|
359
|
+
//# sourceMappingURL=chunk-UHWJ2GDK.js.map
|
|
360
|
+
//# sourceMappingURL=chunk-UHWJ2GDK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../assets/images.json","../src/shared.ts","../src/namespace.ts"],"names":["terminal-kubectl","worker.k8s-monitor","entity","cluster","ComponentResource","output","toPromise","core"],"mappings":";;;;;;;AAAA,IAAA,cAAA,GAAA;AAAA,QAAA,CAAA,cAAA,EAAA;AAAA,EAAA,OAAA,EAAA,MAAA,cAAA;AAAA,EAAA,kBAAA,EAAA,MAAAA,gBAAAA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AA,CAAU,IAAA;AAAA,MACV,SAAA,CAAU;AAAA,KACZ;AAAA,EACF;AACF,CAAA;AAEA,IAAM,gBAAA,GAAN,cAA+B,SAAA,CAAU;AAAA,EACvC,WAAA,CAAY,IAAA,EAAc,IAAA,EAA4B,IAAA,EAAiC;AACrF,IAAA,KAAA;AAAA,MACE,gCAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MAEAA,QAAAA,CAAO,KAAK,OAAO,CAAA;AAAA,MACnBA,QAAAA,CAAO,IAAA,CAAK,SAAS,CAAA,CAAE,QAAA;AAAA,MACvBA,QAAAA,CAAO,IAAA,CAAK,SAAS,CAAA,CAAE,IAAA;AAAA,MACvBA,QAAAA,CAAO,IAAA,CAAK,SAAS,CAAA,CAAE;AAAA,KACzB;AAAA,EACF;AACF,CAAA","file":"chunk-UHWJ2GDK.js","sourcesContent":["{\n \"terminal-kubectl\": {\n \"name\": \"ghcr.io/highstate-io/highstate/terminal.kubectl\",\n \"tag\": \"latest\",\n \"image\": \"ghcr.io/highstate-io/highstate/terminal.kubectl:latest@sha256:2cd011119f6098d41b5bb377420f0106577d3b289ae4fc7982b4578b23c82ef4\"\n },\n \"worker.k8s-monitor\": {\n \"name\": \"ghcr.io/highstate-io/highstate/worker.k8s-monitor\",\n \"tag\": \"latest\",\n \"image\": \"ghcr.io/highstate-io/highstate/worker.k8s-monitor:latest@sha256:66b985a97925d39a4c6e2b15cbeefadaadfce0cb4d6e5df8881cca85281383d5\"\n }\n}\n","import type { PartialKeys } from \"@highstate/contract\"\nimport type { k8s } from \"@highstate/library\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type Inputs,\n type Output,\n output,\n secret,\n toPromise,\n type Unwrap,\n} from \"@highstate/pulumi\"\nimport { core, Provider, type types } from \"@pulumi/kubernetes\"\nimport * as images from \"../assets/images.json\"\nimport { Namespace } from \"./namespace\"\n\nconst providers = new Map<`${string}.${string}`, Provider>()\n\nexport function getProvider(cluster: k8s.Cluster): Provider {\n const name = `${cluster.name}.${cluster.connectionId}` as const\n const existing = providers.get(name)\n if (existing) {\n return existing\n }\n\n const provider = new Provider(name, { kubeconfig: secret(cluster.kubeconfig) })\n providers.set(name, provider)\n\n return provider\n}\n\nexport async function getProviderAsync(cluster: Input<k8s.Cluster>): Promise<Provider> {\n const resolvedCluster = await toPromise(cluster)\n\n return getProvider(resolvedCluster)\n}\n\nexport type NamespaceLike = core.v1.Namespace | Namespace | string\n\nexport type ScopedResourceArgs = {\n /**\n * The name of the resource.\n */\n name?: Input<string>\n\n /**\n * The namespace to create the resource in.\n */\n namespace: Input<Namespace>\n\n /**\n * The metadata to apply to the resource.\n */\n metadata?: Input<types.input.meta.v1.ObjectMeta>\n}\n\nexport const commonExtraArgs = [\"name\", \"namespace\", \"metadata\"] as const\n\nexport function mapMetadata(\n args: PartialKeys<ScopedResourceArgs, \"namespace\">,\n fallbackName?: string,\n): Output<Unwrap<types.input.meta.v1.ObjectMeta>> {\n return output(args.metadata).apply(metadata =>\n output({\n ...metadata,\n name: args.name ?? metadata?.name ?? fallbackName,\n namespace:\n metadata?.namespace ?? (args.namespace ? output(args.namespace).metadata.name : undefined),\n }),\n )\n}\n\nexport type SelectorLike = types.input.meta.v1.LabelSelector | Record<string, Input<string>>\n\nexport function mapSelectorLikeToSelector(\n selector: SelectorLike,\n): types.input.meta.v1.LabelSelector {\n if (\"matchLabels\" in selector || \"matchExpressions\" in selector) {\n return selector\n }\n\n return {\n matchLabels: selector as Record<string, Input<string>>,\n }\n}\n\nexport function getNamespaceName(namespace: NamespaceLike): Output<string> {\n if (Namespace.isInstance(namespace)) {\n return namespace.metadata.name\n }\n\n if (core.v1.Namespace.isInstance(namespace)) {\n return namespace.metadata.name\n }\n\n return output(namespace)\n}\n\nexport function mapNamespaceNameToSelector(\n namespace: Input<string>,\n): types.input.meta.v1.LabelSelector {\n return {\n matchLabels: {\n \"kubernetes.io/metadata.name\": namespace,\n },\n }\n}\n\nexport function validateCluster(\n entity: Input<k8s.Resource>,\n cluster: Input<k8s.Cluster>,\n): Input<k8s.Cluster> {\n return output({ entity, cluster }).apply(({ entity, cluster }) => {\n if (entity.clusterId !== cluster.id) {\n throw new Error(\n `Cluster mismatch for ${entity.type} \"${entity.metadata.name}\": \"${entity.clusterId}\" != \"${cluster.id}\"`,\n )\n }\n\n return cluster\n })\n}\n\nexport { images }\n\n/**\n * Base class for all Kubernetes scoped resources.\n *\n * Provides common functionality for resources that have a cluster, namespace, metadata, and entity.\n */\nexport abstract class ScopedResource extends ComponentResource {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n /**\n * The Kubernetes API version (e.g., \"v1\", \"apps/v1\", \"batch/v1\").\n */\n readonly apiVersion: Output<string>,\n\n /**\n * The Kubernetes kind (e.g., \"ConfigMap\", \"Deployment\", \"CronJob\").\n */\n readonly kind: Output<string>,\n\n /**\n * The namespace where the resource is located.\n */\n readonly namespace: Output<Namespace>,\n\n /**\n * The metadata of the underlying Kubernetes resource.\n */\n readonly metadata: Output<types.output.meta.v1.ObjectMeta>,\n ) {\n super(type, name, args, opts)\n }\n\n /**\n * The cluster where the resource is located.\n */\n get cluster(): Output<k8s.Cluster> {\n return this.namespace.cluster\n }\n\n /**\n * The Highstate resource entity.\n */\n abstract get entity(): Output<k8s.ScopedResource>\n}\n","import type { k8s } from \"@highstate/library\"\nimport { getOrCreate } from \"@highstate/contract\"\nimport { toPromise } from \"@highstate/pulumi\"\nimport { core, type types } from \"@pulumi/kubernetes\"\nimport {\n ComponentResource,\n type ComponentResourceOptions,\n type Input,\n type Inputs,\n type Output,\n output,\n type Unwrap,\n} from \"@pulumi/pulumi\"\nimport { getProvider, mapMetadata, type ScopedResourceArgs, validateCluster } from \"./shared\"\n\nexport type NamespaceArgs = Omit<ScopedResourceArgs, \"namespace\"> & {\n /**\n * The cluster where the namespace is located.\n */\n cluster: Input<k8s.Cluster>\n\n /**\n * Whether to apply \"pod-security.kubernetes.io/enforce=privileged\" label to the namespace.\n */\n privileged?: boolean\n}\n\nexport type CreateOrGetNamespaceArgs = NamespaceArgs & {\n /**\n * The resource to use to determine the name of the namespace.\n *\n * If not provided, the namespace will be created, otherwise it will be retrieved/patched.\n */\n resource?: Input<k8s.ScopedResource>\n\n /**\n * The namespace entity to patch/retrieve.\n */\n existing?: Input<k8s.Namespace> | undefined\n}\n\nexport abstract class Namespace extends ComponentResource {\n constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n /**\n * The cluster where the namespace is created.\n */\n readonly cluster: Output<k8s.Cluster>,\n\n /*\n * The metadata of the underlying Kubernetes namespace.\n */\n readonly metadata: Output<types.output.meta.v1.ObjectMeta>,\n\n /**\n * The spec of the underlying Kubernetes namespace.\n */\n readonly spec: Output<types.output.core.v1.NamespaceSpec>,\n\n /**\n * The status of the underlying Kubernetes namespace.\n */\n readonly status: Output<types.output.core.v1.NamespaceStatus>,\n ) {\n super(type, name, args, opts)\n }\n\n /**\n * The Highstate namespace entity.\n */\n get entity(): Output<k8s.Namespace> {\n return output({\n type: \"namespace\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n })\n }\n\n /**\n * Creates a new namespace.\n */\n static create(name: string, args: NamespaceArgs, opts?: ComponentResourceOptions): Namespace {\n return new CreatedNamespace(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes namespace.\n */\n static wrap(\n name: string,\n args: WrappedNamespaceArgs,\n opts?: ComponentResourceOptions,\n ): Namespace {\n return new WrappedNamespace(name, args, opts)\n }\n\n /**\n * Creates a new namespace or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the namespace name. Will not be used when existing namespace is retrieved.\n * @param args The arguments to create or get the namespace with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetNamespaceArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Namespace> {\n if (args.resource) {\n return await Namespace.forResourceAsync(args.resource, args.cluster)\n }\n\n if (args.existing) {\n return await Namespace.forAsync(args.existing, args.cluster)\n }\n\n return new CreatedNamespace(name, args, opts)\n }\n\n /**\n * Creates a new namespace or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the namespace name.\n * @param args The arguments to create or patch the namespace with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetNamespaceArgs,\n opts?: ComponentResourceOptions,\n ): Namespace {\n if (args.resource) {\n return new NamespacePatch(name, {\n ...args,\n name: output(args.resource).metadata.namespace,\n cluster: validateCluster(args.resource, args.cluster),\n })\n }\n\n if (args.existing) {\n return new NamespacePatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n cluster: validateCluster(args.existing, args.cluster),\n })\n }\n\n return new CreatedNamespace(name, args, opts)\n }\n\n /**\n * Patches an existing namespace.\n *\n * Will throw an error if the namespace does not exist.\n *\n * @param name The name of the resource. May not be the same as the namespace name.\n * @param args The arguments to patch the namespace with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: NamespaceArgs, opts?: ComponentResourceOptions): Namespace {\n return new NamespacePatch(name, args, opts)\n }\n\n /**\n * Gets an existing namespace.\n *\n * Will throw an error if the namespace does not exist.\n *\n * @param name The name of the resource. May not be the same as the namespace name.\n * @param args The arguments to get the namespace with.\n * @param opts Optional resource options.\n */\n static get(\n name: string,\n args: ExternalNamespaceArgs,\n opts?: ComponentResourceOptions,\n ): Namespace {\n return new ExternalNamespace(name, args, opts)\n }\n\n private static readonly namespaceCache = new Map<string, Namespace>()\n\n /**\n * Gets an existing namespace for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{clusterId}`.\n *\n * This method it idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the namespace for.\n * @param cluster The cluster where the namespace is located.\n */\n static for(entity: k8s.Namespace, cluster: Input<k8s.Cluster>): Namespace {\n return getOrCreate(\n Namespace.namespaceCache,\n `${entity.clusterName}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Namespace.get(name, {\n name: entity.metadata.name,\n cluster: validateCluster(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing namespace for a given entity.\n * Prefer this method over `get` when possible.\n *\n * @param entity The entity to get the namespace for.\n * @param cluster The cluster where the namespace is located.\n */\n static async forAsync(\n entity: Input<k8s.Namespace>,\n cluster: Input<k8s.Cluster>,\n ): Promise<Namespace> {\n const resolvedEntity = await toPromise(entity)\n\n return Namespace.for(resolvedEntity, cluster)\n }\n\n /**\n * Gets an existing namespace where the provided resource is located.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{clusterId}`.\n *\n * This method it idempotent and will return the same instance for the same resource.\n *\n * @param resource The resource to get the namespace for.\n * @param cluster The cluster where the namespace is located.\n */\n static forResource(resource: k8s.ScopedResource, cluster: Input<k8s.Cluster>): Namespace {\n return getOrCreate(\n Namespace.namespaceCache,\n `${resource.clusterName}.${resource.metadata.namespace}.${resource.clusterId}`,\n name => {\n return Namespace.get(name, {\n name: resource.metadata.namespace,\n cluster: validateCluster(resource, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing namespace for a given entity.\n * Prefer this method over `get` when possible.\n *\n * @param resource The resource to get the namespace for.\n * @param cluster The cluster where the namespace is located.\n */\n static async forResourceAsync(\n resource: Input<k8s.ScopedResource>,\n cluster: Input<k8s.Cluster>,\n ): Promise<Namespace> {\n const resolvedResource = await toPromise(resource)\n\n return Namespace.forResource(resolvedResource, cluster)\n }\n}\n\nfunction mapNamespaceMetadata(\n args: NamespaceArgs,\n fallbackName: string,\n): Output<Unwrap<types.input.meta.v1.ObjectMeta>> {\n return mapMetadata(args, fallbackName).apply(metadata => {\n if (args.privileged) {\n metadata.labels = {\n ...metadata.labels,\n \"pod-security.kubernetes.io/enforce\": \"privileged\",\n }\n }\n\n return metadata\n })\n}\n\nclass CreatedNamespace extends Namespace {\n constructor(name: string, args: NamespaceArgs, opts?: ComponentResourceOptions) {\n const namespace = output(args.cluster).apply(cluster => {\n return new core.v1.Namespace(\n name,\n { metadata: mapNamespaceMetadata(args, name) },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:Namespace\",\n name,\n args,\n opts,\n output(args.cluster),\n namespace.metadata,\n namespace.spec,\n namespace.status,\n )\n }\n}\n\nclass NamespacePatch extends Namespace {\n constructor(name: string, args: NamespaceArgs, opts?: ComponentResourceOptions) {\n const namespace = output(args.cluster).apply(cluster => {\n return new core.v1.NamespacePatch(\n name,\n { metadata: mapNamespaceMetadata(args, name) },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:NamespacePatch\",\n name,\n args,\n opts,\n output(args.cluster),\n namespace.metadata,\n namespace.spec,\n namespace.status,\n )\n }\n}\n\nexport type WrappedNamespaceArgs = {\n /**\n * The underlying Kubernetes namespace to wrap.\n */\n namespace: Input<core.v1.Namespace>\n\n /**\n * The cluster where the namespace is located.\n */\n cluster: Input<k8s.Cluster>\n}\n\nexport type ExternalNamespaceArgs = {\n /**\n * The real name of the namespace in the cluster.\n */\n name: Input<string>\n\n /**\n * The cluster where the namespace is located.\n */\n cluster: Input<k8s.Cluster>\n}\n\nclass ExternalNamespace extends Namespace {\n constructor(name: string, args: ExternalNamespaceArgs, opts?: ComponentResourceOptions) {\n const namespace = output(args.cluster).apply(cluster => {\n return core.v1.Namespace.get(name, args.name, {\n ...opts,\n parent: this,\n provider: getProvider(cluster),\n })\n })\n\n super(\n \"highstate:k8s:ExternalNamespace\",\n name,\n args,\n opts,\n output(args.cluster),\n namespace.metadata,\n namespace.spec,\n namespace.status,\n )\n }\n}\n\nclass WrappedNamespace extends Namespace {\n constructor(name: string, args: WrappedNamespaceArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedNamespace\",\n name,\n args,\n opts,\n\n output(args.cluster),\n output(args.namespace).metadata,\n output(args.namespace).spec,\n output(args.namespace).status,\n )\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExposableWorkload, getExposableWorkloadComponents, exposableWorkloadExtraArgs } from './chunk-
|
|
2
|
-
import { Namespace, mapMetadata, getProvider } from './chunk-
|
|
1
|
+
import { ExposableWorkload, getExposableWorkloadComponents, exposableWorkloadExtraArgs } from './chunk-4NWENXPT.js';
|
|
2
|
+
import { Namespace, mapMetadata, getProvider } from './chunk-UHWJ2GDK.js';
|
|
3
3
|
import { getOrCreate } from '@highstate/contract';
|
|
4
4
|
import { output, interpolate, toPromise } from '@highstate/pulumi';
|
|
5
5
|
import { apps } from '@pulumi/kubernetes';
|
|
@@ -286,5 +286,5 @@ var ExternalDeployment = class extends Deployment {
|
|
|
286
286
|
};
|
|
287
287
|
|
|
288
288
|
export { Deployment };
|
|
289
|
-
//# sourceMappingURL=chunk-
|
|
290
|
-
//# sourceMappingURL=chunk-
|
|
289
|
+
//# sourceMappingURL=chunk-UXEHNDI7.js.map
|
|
290
|
+
//# sourceMappingURL=chunk-UXEHNDI7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/deployment.ts"],"names":["args","podTemplate","labels"],"mappings":";;;;;;;;AA4CO,IAAe,UAAA,GAAf,MAAe,WAAA,SAAmB,iBAAA,CAAkB;AAAA,EAC/C,WAAA,CACR,IAAA,EACA,IAAA,EACA,IAAA,EACA,MAEA,UAAA,EACA,IAAA,EACA,YAAA,EACA,UAAA,EACA,WACA,QAAA,EACA,aAAA,EAEA,OAAA,EACA,MAAA,EAKS,MAKA,MAAA,EACT;AACA,IAAA,KAAA;AAAA,MACE,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA;AAAA,MACA,OAAA;AAAA,MACA;AAAA,KACF;AArBS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AAA,CAAK,IAAI,CAAA,CAAA;AAAA,QAC/D,EAAE,GAAG,IAAA,EAAM,MAAA,EAAQ,MAAM,QAAA,EAAU,WAAA,CAAY,OAAO,CAAA;AAAE,OAC1D;AAAA,IACF,CAAC,CAAA;AAED,IAAA,KAAA;AAAA,MACE,kCAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MAEA,UAAA,CAAW,UAAA;AAAA,MACX,UAAA,CAAW,IAAA;AAAA,MACX,MAAA,CAAO,EAAE,CAAA;AAAA,MACT,MAAA,CAAO,EAAE,CAAA;AAAA,MACT,MAAA,CAAO,KAAK,SAAS,CAAA;AAAA,MACrB,UAAA,CAAW,QAAA;AAAA,MAEX,OAAO,MAAS,CAAA;AAAA,MAChB,OAAO,MAAS,CAAA;AAAA,MAChB,MAAA,CAAO,EAAE,CAAA;AAAA,MAET,UAAA,CAAW,IAAA;AAAA,MACX,UAAA,CAAW;AAAA,KACb;AAAA,EACF;AACF,CAAA","file":"chunk-3DFFUGSJ.js","sourcesContent":["import type { AccessPointRoute } from \"@highstate/common\"\nimport type { k8s } from \"@highstate/library\"\nimport type { Container } from \"./container\"\nimport type { NetworkPolicy } from \"./network-policy\"\nimport type { Service } from \"./service\"\nimport { getOrCreate, type UnitTerminal } from \"@highstate/contract\"\nimport {\n type ComponentResourceOptions,\n type Input,\n type Inputs,\n interpolate,\n type Output,\n output,\n toPromise,\n type Unwrap,\n} from \"@highstate/pulumi\"\nimport { apps, type types } from \"@pulumi/kubernetes\"\nimport { deepmerge } from \"deepmerge-ts\"\nimport { omit } from \"remeda\"\nimport { Namespace } from \"./namespace\"\nimport { getProvider, mapMetadata } from \"./shared\"\nimport {\n ExposableWorkload,\n type ExposableWorkloadArgs,\n exposableWorkloadExtraArgs,\n getExposableWorkloadComponents,\n type WorkloadTerminalArgs,\n} from \"./workload\"\n\nexport type DeploymentArgs = Omit<ExposableWorkloadArgs, \"existing\"> &\n Omit<Partial<types.input.apps.v1.DeploymentSpec>, \"template\"> & {\n template?: {\n metadata?: types.input.meta.v1.ObjectMeta\n spec?: Partial<types.input.core.v1.PodSpec>\n }\n }\n\nexport type CreateOrGetDeploymentArgs = DeploymentArgs & {\n /**\n * The entity to use to determine the deployment to patch.\n */\n existing: Input<k8s.Deployment> | undefined\n}\n\nexport abstract class Deployment extends ExposableWorkload {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n apiVersion: Output<string>,\n kind: Output<string>,\n terminalArgs: Output<Unwrap<WorkloadTerminalArgs>>,\n containers: Output<Container[]>,\n namespace: Output<Namespace>,\n metadata: Output<types.output.meta.v1.ObjectMeta>,\n networkPolicy: Output<NetworkPolicy | undefined>,\n\n service: Output<Service | undefined>,\n routes: Output<AccessPointRoute[]>,\n\n /**\n * The spec of the underlying Kubernetes deployment.\n */\n readonly spec: Output<types.output.apps.v1.DeploymentSpec>,\n\n /**\n * The status of the underlying Kubernetes deployment.\n */\n readonly status: Output<types.output.apps.v1.DeploymentStatus>,\n ) {\n super(\n type,\n name,\n args,\n opts,\n apiVersion,\n kind,\n terminalArgs,\n containers,\n namespace,\n metadata,\n networkPolicy,\n service,\n routes,\n )\n }\n\n protected override get templateMetadata(): Output<types.output.meta.v1.ObjectMeta> {\n return this.spec.template.metadata\n }\n\n protected override getTerminalMeta(): Output<UnitTerminal[\"meta\"]> {\n return output({\n title: \"Deployment\",\n globalTitle: interpolate`Deployment | ${this.metadata.name}`,\n description: \"The shell inside the deployment.\",\n icon: \"devicon:kubernetes\",\n })\n }\n\n /**\n * The Highstate deployment entity.\n */\n get entity(): Output<k8s.Deployment> {\n return output({\n type: \"deployment\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n service: this._service.apply(service => service?.entity),\n })\n }\n\n /**\n * Creates a new deployment.\n */\n static create(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions): Deployment {\n return new CreatedDeployment(name, args, opts)\n }\n\n /**\n * Creates a new deployment or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the deployment name.\n * @param args The arguments to create or patch the deployment with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Deployment {\n if (args.existing) {\n return new DeploymentPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n namespace: Namespace.forResourceAsync(args.existing, output(args.namespace).cluster),\n })\n }\n\n return new CreatedDeployment(name, args, opts)\n }\n\n /**\n * Creates a new deployment or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the deployment name. Will not be used when existing deployment is retrieved.\n * @param args The arguments to create or get the deployment with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Deployment> {\n if (args.existing) {\n return await Deployment.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedDeployment(name, args, opts)\n }\n\n /**\n * Patches an existing deployment.\n *\n * Will throw an error if the deployment does not exist.\n *\n * @param name The name of the resource. May not be the same as the deployment name.\n * @param args The arguments to patch the deployment with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions): Deployment {\n return new DeploymentPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes deployment.\n */\n static wrap(\n name: string,\n args: WrappedDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Deployment {\n return new WrappedDeployment(name, args, opts)\n }\n\n /**\n * Gets an existing deployment.\n *\n * Will throw an error if the deployment does not exist.\n */\n static get(\n name: string,\n args: ExternalDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Deployment {\n return new ExternalDeployment(name, args, opts)\n }\n\n private static readonly deploymentCache = new Map<string, Deployment>()\n\n /**\n * Gets an existing deployment for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{name}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the deployment for.\n * @param cluster The cluster where the deployment is located.\n */\n static for(entity: k8s.Deployment, cluster: Input<k8s.Cluster>): Deployment {\n return getOrCreate(\n Deployment.deploymentCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Deployment.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResource(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing deployment for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{name}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the deployment for.\n * @param cluster The cluster where the deployment is located.\n */\n static async forAsync(\n entity: Input<k8s.Deployment>,\n cluster: Input<k8s.Cluster>,\n ): Promise<Deployment> {\n const resolvedEntity = await toPromise(entity)\n return Deployment.for(resolvedEntity, cluster)\n }\n}\n\nclass CreatedDeployment extends Deployment {\n constructor(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions) {\n const { labels, podTemplate, networkPolicy, containers, service, routes } =\n getExposableWorkloadComponents(name, args, () => this, opts)\n\n const deployment = output(args.namespace).cluster.apply(cluster => {\n return new apps.v1.Deployment(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: output({ args, podTemplate, labels }).apply(({ args, podTemplate, labels }) => {\n return deepmerge(\n {\n template: podTemplate,\n selector: { matchLabels: labels },\n },\n omit(args, exposableWorkloadExtraArgs),\n ) as types.input.apps.v1.DeploymentSpec\n }),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:Deployment\",\n name,\n args,\n opts,\n\n deployment.apiVersion,\n deployment.kind,\n output(args.terminal ?? {}),\n containers,\n output(args.namespace),\n deployment.metadata,\n networkPolicy,\n\n service,\n routes,\n\n deployment.spec,\n deployment.status,\n )\n }\n}\n\nclass DeploymentPatch extends Deployment {\n constructor(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions) {\n const { labels, podTemplate, networkPolicy, containers, service, routes } =\n getExposableWorkloadComponents(name, args, () => this, opts)\n\n const deployment = output(args.namespace).cluster.apply(cluster => {\n return new apps.v1.DeploymentPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: output({ args, podTemplate, labels }).apply(({ args, podTemplate, labels }) => {\n return deepmerge(\n {\n template: podTemplate,\n selector: { matchLabels: labels },\n },\n omit(args, exposableWorkloadExtraArgs),\n ) as types.input.apps.v1.DeploymentSpec\n }),\n },\n {\n ...opts,\n parent: this,\n provider: getProvider(cluster),\n },\n )\n })\n\n super(\n \"highstate:k8s:DeploymentPatch\",\n name,\n args,\n opts,\n\n deployment.apiVersion,\n deployment.kind,\n output(args.terminal ?? {}),\n containers,\n output(args.namespace),\n deployment.metadata,\n networkPolicy,\n\n service,\n routes,\n\n deployment.spec,\n deployment.status,\n )\n }\n}\n\nexport type WrappedDeploymentArgs = {\n /**\n * The underlying Kubernetes deployment to wrap.\n */\n deployment: Input<apps.v1.Deployment>\n\n /**\n * The namespace where the deployment is located.\n */\n namespace: Input<Namespace>\n\n /**\n * The args for the terminal to use.\n */\n terminal?: Input<WorkloadTerminalArgs>\n}\n\nclass WrappedDeployment extends Deployment {\n constructor(name: string, args: WrappedDeploymentArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedDeployment\",\n name,\n args,\n opts,\n\n output(args.deployment).apiVersion,\n output(args.deployment).kind,\n output(args.terminal ?? {}),\n output([]),\n output(args.namespace),\n output(args.deployment).metadata,\n\n output(undefined),\n output(undefined),\n output([]),\n\n output(args.deployment).spec,\n output(args.deployment).status,\n )\n }\n}\n\nexport type ExternalDeploymentArgs = {\n /**\n * The name of the deployment to get.\n */\n name: Input<string>\n\n /**\n * The namespace where the deployment is located.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalDeployment extends Deployment {\n constructor(name: string, args: ExternalDeploymentArgs, opts?: ComponentResourceOptions) {\n const deployment = output(args.namespace).cluster.apply(cluster => {\n return apps.v1.Deployment.get(\n name,\n interpolate`${output(args.namespace).metadata.name}/${args.name}`,\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:ExternalDeployment\",\n name,\n args,\n opts,\n\n deployment.apiVersion,\n deployment.kind,\n output({}),\n output([]),\n output(args.namespace),\n deployment.metadata,\n\n output(undefined),\n output(undefined),\n output([]),\n\n deployment.spec,\n deployment.status,\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/deployment.ts"],"names":["args","podTemplate","labels"],"mappings":";;;;;;;;AA4CO,IAAe,UAAA,GAAf,MAAe,WAAA,SAAmB,iBAAA,CAAkB;AAAA,EAC/C,WAAA,CACR,IAAA,EACA,IAAA,EACA,IAAA,EACA,MAEA,UAAA,EACA,IAAA,EACA,YAAA,EACA,UAAA,EACA,WACA,QAAA,EACA,aAAA,EAEA,OAAA,EACA,MAAA,EAKS,MAKA,MAAA,EACT;AACA,IAAA,KAAA;AAAA,MACE,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA;AAAA,MACA,OAAA;AAAA,MACA;AAAA,KACF;AArBS,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAKA,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAiBX;AAAA,EAEA,IAAuB,gBAAA,GAA4D;AACjF,IAAA,OAAO,IAAA,CAAK,KAAK,QAAA,CAAS,QAAA;AAAA,EAC5B;AAAA,EAEmB,eAAA,GAAgD;AACjE,IAAA,OAAO,MAAA,CAAO;AAAA,MACZ,KAAA,EAAO,YAAA;AAAA,MACP,WAAA,EAAa,WAAA,CAAA,aAAA,EAA2B,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA,C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CAAA;AAAA,MACT,MAAA,CAAO,KAAK,SAAS,CAAA;AAAA,MACrB,UAAA,CAAW,QAAA;AAAA,MAEX,OAAO,MAAS,CAAA;AAAA,MAChB,OAAO,MAAS,CAAA;AAAA,MAChB,MAAA,CAAO,EAAE,CAAA;AAAA,MAET,UAAA,CAAW,IAAA;AAAA,MACX,UAAA,CAAW;AAAA,KACb;AAAA,EACF;AACF,CAAA","file":"chunk-UXEHNDI7.js","sourcesContent":["import type { AccessPointRoute } from \"@highstate/common\"\nimport type { k8s } from \"@highstate/library\"\nimport type { Container } from \"./container\"\nimport type { NetworkPolicy } from \"./network-policy\"\nimport type { Service } from \"./service\"\nimport { getOrCreate, type UnitTerminal } from \"@highstate/contract\"\nimport {\n type ComponentResourceOptions,\n type Input,\n type Inputs,\n interpolate,\n type Output,\n output,\n toPromise,\n type Unwrap,\n} from \"@highstate/pulumi\"\nimport { apps, type types } from \"@pulumi/kubernetes\"\nimport { deepmerge } from \"deepmerge-ts\"\nimport { omit } from \"remeda\"\nimport { Namespace } from \"./namespace\"\nimport { getProvider, mapMetadata } from \"./shared\"\nimport {\n ExposableWorkload,\n type ExposableWorkloadArgs,\n exposableWorkloadExtraArgs,\n getExposableWorkloadComponents,\n type WorkloadTerminalArgs,\n} from \"./workload\"\n\nexport type DeploymentArgs = Omit<ExposableWorkloadArgs, \"existing\"> &\n Omit<Partial<types.input.apps.v1.DeploymentSpec>, \"template\"> & {\n template?: {\n metadata?: types.input.meta.v1.ObjectMeta\n spec?: Partial<types.input.core.v1.PodSpec>\n }\n }\n\nexport type CreateOrGetDeploymentArgs = DeploymentArgs & {\n /**\n * The entity to use to determine the deployment to patch.\n */\n existing: Input<k8s.Deployment> | undefined\n}\n\nexport abstract class Deployment extends ExposableWorkload {\n protected constructor(\n type: string,\n name: string,\n args: Inputs,\n opts: ComponentResourceOptions | undefined,\n\n apiVersion: Output<string>,\n kind: Output<string>,\n terminalArgs: Output<Unwrap<WorkloadTerminalArgs>>,\n containers: Output<Container[]>,\n namespace: Output<Namespace>,\n metadata: Output<types.output.meta.v1.ObjectMeta>,\n networkPolicy: Output<NetworkPolicy | undefined>,\n\n service: Output<Service | undefined>,\n routes: Output<AccessPointRoute[]>,\n\n /**\n * The spec of the underlying Kubernetes deployment.\n */\n readonly spec: Output<types.output.apps.v1.DeploymentSpec>,\n\n /**\n * The status of the underlying Kubernetes deployment.\n */\n readonly status: Output<types.output.apps.v1.DeploymentStatus>,\n ) {\n super(\n type,\n name,\n args,\n opts,\n apiVersion,\n kind,\n terminalArgs,\n containers,\n namespace,\n metadata,\n networkPolicy,\n service,\n routes,\n )\n }\n\n protected override get templateMetadata(): Output<types.output.meta.v1.ObjectMeta> {\n return this.spec.template.metadata\n }\n\n protected override getTerminalMeta(): Output<UnitTerminal[\"meta\"]> {\n return output({\n title: \"Deployment\",\n globalTitle: interpolate`Deployment | ${this.metadata.name}`,\n description: \"The shell inside the deployment.\",\n icon: \"devicon:kubernetes\",\n })\n }\n\n /**\n * The Highstate deployment entity.\n */\n get entity(): Output<k8s.Deployment> {\n return output({\n type: \"deployment\",\n clusterId: this.cluster.id,\n clusterName: this.cluster.name,\n metadata: this.metadata,\n service: this._service.apply(service => service?.entity),\n })\n }\n\n /**\n * Creates a new deployment.\n */\n static create(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions): Deployment {\n return new CreatedDeployment(name, args, opts)\n }\n\n /**\n * Creates a new deployment or patches an existing one.\n *\n * @param name The name of the resource. May not be the same as the deployment name.\n * @param args The arguments to create or patch the deployment with.\n * @param opts Optional resource options.\n */\n static createOrPatch(\n name: string,\n args: CreateOrGetDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Deployment {\n if (args.existing) {\n return new DeploymentPatch(name, {\n ...args,\n name: output(args.existing).metadata.name,\n namespace: Namespace.forResourceAsync(args.existing, output(args.namespace).cluster),\n })\n }\n\n return new CreatedDeployment(name, args, opts)\n }\n\n /**\n * Creates a new deployment or gets an existing one.\n *\n * @param name The name of the resource. May not be the same as the deployment name. Will not be used when existing deployment is retrieved.\n * @param args The arguments to create or get the deployment with.\n * @param opts Optional resource options.\n */\n static async createOrGet(\n name: string,\n args: CreateOrGetDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Promise<Deployment> {\n if (args.existing) {\n return await Deployment.forAsync(args.existing, output(args.namespace).cluster)\n }\n\n return new CreatedDeployment(name, args, opts)\n }\n\n /**\n * Patches an existing deployment.\n *\n * Will throw an error if the deployment does not exist.\n *\n * @param name The name of the resource. May not be the same as the deployment name.\n * @param args The arguments to patch the deployment with.\n * @param opts Optional resource options.\n */\n static patch(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions): Deployment {\n return new DeploymentPatch(name, args, opts)\n }\n\n /**\n * Wraps an existing Kubernetes deployment.\n */\n static wrap(\n name: string,\n args: WrappedDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Deployment {\n return new WrappedDeployment(name, args, opts)\n }\n\n /**\n * Gets an existing deployment.\n *\n * Will throw an error if the deployment does not exist.\n */\n static get(\n name: string,\n args: ExternalDeploymentArgs,\n opts?: ComponentResourceOptions,\n ): Deployment {\n return new ExternalDeployment(name, args, opts)\n }\n\n private static readonly deploymentCache = new Map<string, Deployment>()\n\n /**\n * Gets an existing deployment for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{name}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the deployment for.\n * @param cluster The cluster where the deployment is located.\n */\n static for(entity: k8s.Deployment, cluster: Input<k8s.Cluster>): Deployment {\n return getOrCreate(\n Deployment.deploymentCache,\n `${entity.clusterName}.${entity.metadata.namespace}.${entity.metadata.name}.${entity.clusterId}`,\n name => {\n return Deployment.get(name, {\n name: entity.metadata.name,\n namespace: Namespace.forResource(entity, cluster),\n })\n },\n )\n }\n\n /**\n * Gets an existing deployment for a given entity.\n * Prefer this method over `get` when possible.\n *\n * It automatically names the resource with the following format: `{clusterName}.{namespace}.{name}.{clusterId}`.\n *\n * This method is idempotent and will return the same instance for the same entity.\n *\n * @param entity The entity to get the deployment for.\n * @param cluster The cluster where the deployment is located.\n */\n static async forAsync(\n entity: Input<k8s.Deployment>,\n cluster: Input<k8s.Cluster>,\n ): Promise<Deployment> {\n const resolvedEntity = await toPromise(entity)\n return Deployment.for(resolvedEntity, cluster)\n }\n}\n\nclass CreatedDeployment extends Deployment {\n constructor(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions) {\n const { labels, podTemplate, networkPolicy, containers, service, routes } =\n getExposableWorkloadComponents(name, args, () => this, opts)\n\n const deployment = output(args.namespace).cluster.apply(cluster => {\n return new apps.v1.Deployment(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: output({ args, podTemplate, labels }).apply(({ args, podTemplate, labels }) => {\n return deepmerge(\n {\n template: podTemplate,\n selector: { matchLabels: labels },\n },\n omit(args, exposableWorkloadExtraArgs),\n ) as types.input.apps.v1.DeploymentSpec\n }),\n },\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:Deployment\",\n name,\n args,\n opts,\n\n deployment.apiVersion,\n deployment.kind,\n output(args.terminal ?? {}),\n containers,\n output(args.namespace),\n deployment.metadata,\n networkPolicy,\n\n service,\n routes,\n\n deployment.spec,\n deployment.status,\n )\n }\n}\n\nclass DeploymentPatch extends Deployment {\n constructor(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions) {\n const { labels, podTemplate, networkPolicy, containers, service, routes } =\n getExposableWorkloadComponents(name, args, () => this, opts)\n\n const deployment = output(args.namespace).cluster.apply(cluster => {\n return new apps.v1.DeploymentPatch(\n name,\n {\n metadata: mapMetadata(args, name),\n spec: output({ args, podTemplate, labels }).apply(({ args, podTemplate, labels }) => {\n return deepmerge(\n {\n template: podTemplate,\n selector: { matchLabels: labels },\n },\n omit(args, exposableWorkloadExtraArgs),\n ) as types.input.apps.v1.DeploymentSpec\n }),\n },\n {\n ...opts,\n parent: this,\n provider: getProvider(cluster),\n },\n )\n })\n\n super(\n \"highstate:k8s:DeploymentPatch\",\n name,\n args,\n opts,\n\n deployment.apiVersion,\n deployment.kind,\n output(args.terminal ?? {}),\n containers,\n output(args.namespace),\n deployment.metadata,\n networkPolicy,\n\n service,\n routes,\n\n deployment.spec,\n deployment.status,\n )\n }\n}\n\nexport type WrappedDeploymentArgs = {\n /**\n * The underlying Kubernetes deployment to wrap.\n */\n deployment: Input<apps.v1.Deployment>\n\n /**\n * The namespace where the deployment is located.\n */\n namespace: Input<Namespace>\n\n /**\n * The args for the terminal to use.\n */\n terminal?: Input<WorkloadTerminalArgs>\n}\n\nclass WrappedDeployment extends Deployment {\n constructor(name: string, args: WrappedDeploymentArgs, opts?: ComponentResourceOptions) {\n super(\n \"highstate:k8s:WrappedDeployment\",\n name,\n args,\n opts,\n\n output(args.deployment).apiVersion,\n output(args.deployment).kind,\n output(args.terminal ?? {}),\n output([]),\n output(args.namespace),\n output(args.deployment).metadata,\n\n output(undefined),\n output(undefined),\n output([]),\n\n output(args.deployment).spec,\n output(args.deployment).status,\n )\n }\n}\n\nexport type ExternalDeploymentArgs = {\n /**\n * The name of the deployment to get.\n */\n name: Input<string>\n\n /**\n * The namespace where the deployment is located.\n */\n namespace: Input<Namespace>\n}\n\nclass ExternalDeployment extends Deployment {\n constructor(name: string, args: ExternalDeploymentArgs, opts?: ComponentResourceOptions) {\n const deployment = output(args.namespace).cluster.apply(cluster => {\n return apps.v1.Deployment.get(\n name,\n interpolate`${output(args.namespace).metadata.name}/${args.name}`,\n { ...opts, parent: this, provider: getProvider(cluster) },\n )\n })\n\n super(\n \"highstate:k8s:ExternalDeployment\",\n name,\n args,\n opts,\n\n deployment.apiVersion,\n deployment.kind,\n output({}),\n output([]),\n output(args.namespace),\n deployment.metadata,\n\n output(undefined),\n output(undefined),\n output([]),\n\n deployment.spec,\n deployment.status,\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Deployment } from './chunk-UXEHNDI7.js';
|
|
2
|
+
import './chunk-4NWENXPT.js';
|
|
3
|
+
import './chunk-DJE2YX64.js';
|
|
4
|
+
import './chunk-LR6OTL6T.js';
|
|
5
|
+
import './chunk-UHWJ2GDK.js';
|
|
6
|
+
import './chunk-PZ5AY32C.js';
|
|
7
|
+
//# sourceMappingURL=deployment-LVMOBFVO.js.map
|
|
8
|
+
//# sourceMappingURL=deployment-LVMOBFVO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"deployment-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"deployment-LVMOBFVO.js"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"./dist/units/existing-cluster/index.js": 2212294583,
|
|
9
9
|
"./dist/units/gateway-api/index.js": 2212294583,
|
|
10
10
|
"./dist/units/reduced-access-cluster/index.js": 2212294583,
|
|
11
|
-
"./dist/impl/gateway-route.js":
|
|
12
|
-
"./dist/impl/tls-certificate.js":
|
|
11
|
+
"./dist/impl/gateway-route.js": 3488593175,
|
|
12
|
+
"./dist/impl/tls-certificate.js": 3570797326
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Gateway, HttpRoute, TcpRoute, UdpRoute } from '../chunk-
|
|
2
|
-
import { Certificate } from '../chunk-
|
|
3
|
-
import { Service, l4EndpointToServicePort } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import { Namespace, mapMetadata, getProvider } from '../chunk-
|
|
1
|
+
import { Gateway, HttpRoute, TcpRoute, UdpRoute } from '../chunk-Q35R54GK.js';
|
|
2
|
+
import { Certificate } from '../chunk-77AY36LR.js';
|
|
3
|
+
import { Service, l4EndpointToServicePort } from '../chunk-DJE2YX64.js';
|
|
4
|
+
import '../chunk-LR6OTL6T.js';
|
|
5
|
+
import { Namespace, mapMetadata, getProvider } from '../chunk-UHWJ2GDK.js';
|
|
6
6
|
import '../chunk-PZ5AY32C.js';
|
|
7
7
|
import { gatewayRouteMediator, filterEndpoints } from '@highstate/common';
|
|
8
8
|
import { k8s } from '@highstate/library';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Certificate } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import { getProvider, Namespace } from '../chunk-
|
|
1
|
+
import { Certificate } from '../chunk-77AY36LR.js';
|
|
2
|
+
import '../chunk-LR6OTL6T.js';
|
|
3
|
+
import { getProvider, Namespace } from '../chunk-UHWJ2GDK.js';
|
|
4
4
|
import '../chunk-PZ5AY32C.js';
|
|
5
5
|
import { tlsCertificateMediator } from '@highstate/common';
|
|
6
6
|
import { k8s } from '@highstate/library';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { Gateway, HttpRoute, TcpRoute, UdpRoute, mapHttpRouteRuleMatch, resolveBackendRef } from './chunk-
|
|
2
|
-
export { Certificate } from './chunk-
|
|
3
|
-
export { Chart, RenderedChart, getChartService, getChartServiceOutput, resolveHelmChart } from './chunk-
|
|
1
|
+
export { Gateway, HttpRoute, TcpRoute, UdpRoute, mapHttpRouteRuleMatch, resolveBackendRef } from './chunk-Q35R54GK.js';
|
|
2
|
+
export { Certificate } from './chunk-77AY36LR.js';
|
|
3
|
+
export { Chart, RenderedChart, getChartService, getChartServiceOutput, resolveHelmChart } from './chunk-KCPQLLNX.js';
|
|
4
4
|
export { dns01SolverMediator } from './chunk-HH2JJELM.js';
|
|
5
|
-
import { ClusterAccessScope } from './chunk-
|
|
6
|
-
export { ClusterAccessScope } from './chunk-
|
|
7
|
-
export { Deployment } from './chunk-
|
|
8
|
-
export { StatefulSet } from './chunk-
|
|
9
|
-
import { Workload, getWorkloadComponents, ConfigMap } from './chunk-
|
|
10
|
-
export { ConfigMap, ExposableWorkload, NativeNetworkPolicy, NetworkPolicy, PersistentVolumeClaim, Workload, exposableWorkloadExtraArgs, getAutoVolumeName, getBestEndpoint, getExposableWorkloadComponents, getFallbackContainerName, getWorkloadComponents, getWorkloadVolumeResourceUuid, mapContainerEnvironment, mapContainerToRaw, mapEnvironmentSource, mapVolumeMount, mapWorkloadVolume, networkPolicyMediator, podSpecDefaults, requireBestEndpoint, workloadExtraArgs } from './chunk-
|
|
11
|
-
export { Service, getServiceType, isEndpointFromCluster, l4EndpointToServicePort, mapContainerPortToServicePort, mapServiceToLabelSelector } from './chunk-
|
|
12
|
-
export { Secret } from './chunk-
|
|
13
|
-
export { createK8sTerminal, detectExternalIps } from './chunk-
|
|
14
|
-
import { commonExtraArgs, Namespace, mapMetadata, getProvider, images_exports } from './chunk-
|
|
15
|
-
export { Namespace, ScopedResource, commonExtraArgs, getNamespaceName, getProvider, getProviderAsync, images_exports as images, mapMetadata, mapNamespaceNameToSelector, mapSelectorLikeToSelector, validateCluster } from './chunk-
|
|
5
|
+
import { ClusterAccessScope } from './chunk-SY7FPT77.js';
|
|
6
|
+
export { ClusterAccessScope } from './chunk-SY7FPT77.js';
|
|
7
|
+
export { Deployment } from './chunk-UXEHNDI7.js';
|
|
8
|
+
export { StatefulSet } from './chunk-23KLAP3X.js';
|
|
9
|
+
import { Workload, getWorkloadComponents, ConfigMap } from './chunk-4NWENXPT.js';
|
|
10
|
+
export { ConfigMap, ExposableWorkload, NativeNetworkPolicy, NetworkPolicy, PersistentVolumeClaim, Workload, exposableWorkloadExtraArgs, getAutoVolumeName, getBestEndpoint, getExposableWorkloadComponents, getFallbackContainerName, getWorkloadComponents, getWorkloadVolumeResourceUuid, mapContainerEnvironment, mapContainerToRaw, mapEnvironmentSource, mapVolumeMount, mapWorkloadVolume, networkPolicyMediator, podSpecDefaults, requireBestEndpoint, workloadExtraArgs } from './chunk-4NWENXPT.js';
|
|
11
|
+
export { Service, getServiceType, isEndpointFromCluster, l4EndpointToServicePort, mapContainerPortToServicePort, mapServiceToLabelSelector } from './chunk-DJE2YX64.js';
|
|
12
|
+
export { Secret } from './chunk-LR6OTL6T.js';
|
|
13
|
+
export { createK8sTerminal, detectExternalIps } from './chunk-5CMNORLF.js';
|
|
14
|
+
import { commonExtraArgs, Namespace, mapMetadata, getProvider, images_exports } from './chunk-UHWJ2GDK.js';
|
|
15
|
+
export { Namespace, ScopedResource, commonExtraArgs, getNamespaceName, getProvider, getProviderAsync, images_exports as images, mapMetadata, mapNamespaceNameToSelector, mapSelectorLikeToSelector, validateCluster } from './chunk-UHWJ2GDK.js';
|
|
16
16
|
import './chunk-PZ5AY32C.js';
|
|
17
17
|
import { getOrCreate, text, trimIndentation } from '@highstate/contract';
|
|
18
18
|
import { output, interpolate, toPromise, normalize } from '@highstate/pulumi';
|
|
@@ -918,7 +918,7 @@ async function createMonitorWorker(namespace, resources) {
|
|
|
918
918
|
});
|
|
919
919
|
return output$1({
|
|
920
920
|
name: "monitor",
|
|
921
|
-
image: images_exports["worker
|
|
921
|
+
image: images_exports["worker.k8s-monitor"].image,
|
|
922
922
|
params: {
|
|
923
923
|
kubeconfig: scope.cluster.kubeconfig,
|
|
924
924
|
resources: output$1(resources).apply((resources2) => resources2.map((r) => r.entity))
|