@alchemy.run/kubernetes 0.0.0 → 2.0.0-beta.84
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/LICENSE +201 -0
- package/README.md +41 -4
- package/lib/BuiltinAdapters.d.ts +23 -0
- package/lib/BuiltinAdapters.d.ts.map +1 -0
- package/lib/BuiltinAdapters.js +124 -0
- package/lib/BuiltinAdapters.js.map +1 -0
- package/lib/Client.d.ts +80 -0
- package/lib/Client.d.ts.map +1 -0
- package/lib/Client.js +296 -0
- package/lib/Client.js.map +1 -0
- package/lib/ClusterAdapter.d.ts +322 -0
- package/lib/ClusterAdapter.d.ts.map +1 -0
- package/lib/ClusterAdapter.js +65 -0
- package/lib/ClusterAdapter.js.map +1 -0
- package/lib/Connection.d.ts +210 -0
- package/lib/Connection.d.ts.map +1 -0
- package/lib/Connection.js +58 -0
- package/lib/Connection.js.map +1 -0
- package/lib/Deployment.d.ts +382 -0
- package/lib/Deployment.d.ts.map +1 -0
- package/lib/Deployment.js +533 -0
- package/lib/Deployment.js.map +1 -0
- package/lib/HelmChart.d.ts +147 -0
- package/lib/HelmChart.d.ts.map +1 -0
- package/lib/HelmChart.js +248 -0
- package/lib/HelmChart.js.map +1 -0
- package/lib/Job.d.ts +314 -0
- package/lib/Job.d.ts.map +1 -0
- package/lib/Job.js +426 -0
- package/lib/Job.js.map +1 -0
- package/lib/LocalCluster.d.ts +243 -0
- package/lib/LocalCluster.d.ts.map +1 -0
- package/lib/LocalCluster.js +359 -0
- package/lib/LocalCluster.js.map +1 -0
- package/lib/Manifest.d.ts +148 -0
- package/lib/Manifest.d.ts.map +1 -0
- package/lib/Manifest.js +200 -0
- package/lib/Manifest.js.map +1 -0
- package/lib/Objects.d.ts +60 -0
- package/lib/Objects.d.ts.map +1 -0
- package/lib/Objects.js +132 -0
- package/lib/Objects.js.map +1 -0
- package/lib/Providers.d.ts +24 -0
- package/lib/Providers.d.ts.map +1 -0
- package/lib/Providers.js +36 -0
- package/lib/Providers.js.map +1 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/internal/declared.d.ts +19 -0
- package/lib/internal/declared.d.ts.map +1 -0
- package/lib/internal/declared.js +435 -0
- package/lib/internal/declared.js.map +1 -0
- package/lib/internal/helm.d.ts +65 -0
- package/lib/internal/helm.d.ts.map +1 -0
- package/lib/internal/helm.js +173 -0
- package/lib/internal/helm.js.map +1 -0
- package/lib/internal/kind.d.ts +17 -0
- package/lib/internal/kind.d.ts.map +1 -0
- package/lib/internal/kind.js +31 -0
- package/lib/internal/kind.js.map +1 -0
- package/lib/internal/kubeconfig.d.ts +79 -0
- package/lib/internal/kubeconfig.d.ts.map +1 -0
- package/lib/internal/kubeconfig.js +222 -0
- package/lib/internal/kubeconfig.js.map +1 -0
- package/lib/internal/registry.d.ts +44 -0
- package/lib/internal/registry.d.ts.map +1 -0
- package/lib/internal/registry.js +72 -0
- package/lib/internal/registry.js.map +1 -0
- package/lib/internal/workload.d.ts +127 -0
- package/lib/internal/workload.d.ts.map +1 -0
- package/lib/internal/workload.js +411 -0
- package/lib/internal/workload.js.map +1 -0
- package/package.json +55 -3
- package/src/BuiltinAdapters.ts +194 -0
- package/src/Client.ts +465 -0
- package/src/ClusterAdapter.ts +370 -0
- package/src/Connection.ts +234 -0
- package/src/Deployment.ts +851 -0
- package/src/HelmChart.ts +388 -0
- package/src/Job.ts +689 -0
- package/src/LocalCluster.ts +631 -0
- package/src/Manifest.ts +295 -0
- package/src/Objects.ts +213 -0
- package/src/Providers.ts +52 -0
- package/src/globals.d.ts +2 -0
- package/src/index.ts +9 -0
- package/src/internal/declared.ts +471 -0
- package/src/internal/helm.ts +245 -0
- package/src/internal/kind.ts +43 -0
- package/src/internal/kubeconfig.ts +364 -0
- package/src/internal/registry.ts +108 -0
- package/src/internal/workload.ts +503 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import type { Input } from "alchemy/Input";
|
|
2
|
+
import { Platform, type Main, type PlatformProps } from "alchemy/Platform";
|
|
3
|
+
import * as Provider from "alchemy/Provider";
|
|
4
|
+
import { Resource } from "alchemy/Resource";
|
|
5
|
+
import { type HostRuntimeContext, type ServerHost as ServerHostService } from "alchemy/Runtime/Process";
|
|
6
|
+
import { Stack } from "alchemy/Stack";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { type IdentityState, type RegistryState, type WorkloadBindingContract, type WorkloadIdentityOptions, type WorkloadImageSource, type WorkloadServices } from "./ClusterAdapter.ts";
|
|
9
|
+
import { type ClusterLike, type Connection } from "./Connection.ts";
|
|
10
|
+
import { type KubernetesObjectRef } from "./Objects.ts";
|
|
11
|
+
import type { Providers } from "./Providers.ts";
|
|
12
|
+
export declare const isDeployment: (value: any) => value is Deployment;
|
|
13
|
+
/**
|
|
14
|
+
* The image-source props shared by the workload platforms. Exactly one of
|
|
15
|
+
* `main` (bundle an inline Effect program), `context`/`dockerfile` (build
|
|
16
|
+
* the user's own Dockerfile), or `image` (a pre-built registry reference).
|
|
17
|
+
*/
|
|
18
|
+
export interface DeploymentPropsBase extends PlatformProps {
|
|
19
|
+
/**
|
|
20
|
+
* Target cluster the workload is deployed onto: a cluster resource
|
|
21
|
+
* (`Kubernetes.LocalCluster`, `AWS.EKS.Cluster`), a
|
|
22
|
+
* `Kubernetes.KubeConfig(...)`, or a raw `Kubernetes.Connection`. The
|
|
23
|
+
* connection supplies authentication and the registry `main` / `context`
|
|
24
|
+
* images are pushed to. Also accepts an Effect that produces any of
|
|
25
|
+
* these, so `{ cluster: Cluster }` and `{ cluster: yield* Cluster }`
|
|
26
|
+
* both type-check.
|
|
27
|
+
*/
|
|
28
|
+
cluster: ClusterLike | Effect.Effect<Input<ClusterLike>, never, any>;
|
|
29
|
+
/**
|
|
30
|
+
* Base name for the generated Deployment / Service / ServiceAccount. If
|
|
31
|
+
* omitted, a deterministic name is derived from the stack, stage, and
|
|
32
|
+
* logical id.
|
|
33
|
+
*/
|
|
34
|
+
name?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Kubernetes namespace to deploy into. The namespace must already exist.
|
|
37
|
+
* @default "default"
|
|
38
|
+
*/
|
|
39
|
+
namespace?: string;
|
|
40
|
+
/**
|
|
41
|
+
* HTTP port exposed by the container and the Service.
|
|
42
|
+
* @default 3000
|
|
43
|
+
*/
|
|
44
|
+
port?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Replica count for the Deployment.
|
|
47
|
+
* @default 1
|
|
48
|
+
*/
|
|
49
|
+
replicas?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Kubernetes Service type. `LoadBalancer` provisions the platform's
|
|
52
|
+
* cloud load balancer and exposes its hostname as the Deployment `url`.
|
|
53
|
+
* @default "LoadBalancer"
|
|
54
|
+
*/
|
|
55
|
+
serviceType?: "ClusterIP" | "NodePort" | "LoadBalancer";
|
|
56
|
+
/**
|
|
57
|
+
* Annotations applied to the Service (e.g. load-balancer scheme /
|
|
58
|
+
* target-type hints).
|
|
59
|
+
*/
|
|
60
|
+
serviceAnnotations?: Record<string, string>;
|
|
61
|
+
/**
|
|
62
|
+
* Container entrypoint override (Kubernetes `command`). Mostly useful with
|
|
63
|
+
* `image` / `context` sources.
|
|
64
|
+
*/
|
|
65
|
+
command?: string[];
|
|
66
|
+
/**
|
|
67
|
+
* Container arguments (Kubernetes `args`).
|
|
68
|
+
*/
|
|
69
|
+
args?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Container CPU/memory requests + limits (Kubernetes resource quantities).
|
|
72
|
+
*/
|
|
73
|
+
resources?: {
|
|
74
|
+
requests?: {
|
|
75
|
+
cpu?: string;
|
|
76
|
+
memory?: string;
|
|
77
|
+
};
|
|
78
|
+
limits?: {
|
|
79
|
+
cpu?: string;
|
|
80
|
+
memory?: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Additional environment variables for the container.
|
|
85
|
+
*/
|
|
86
|
+
env?: Record<string, any>;
|
|
87
|
+
/**
|
|
88
|
+
* Container image build architecture.
|
|
89
|
+
* @default the connection's `architecture`, else "amd64"
|
|
90
|
+
*/
|
|
91
|
+
architecture?: "amd64" | "arm64";
|
|
92
|
+
/**
|
|
93
|
+
* Deep-partial Kubernetes Pod template merged into the synthesized
|
|
94
|
+
* template (objects merge recursively; arrays and primitives replace) —
|
|
95
|
+
* a literal object in the shape of `PodTemplateSpec`, e.g.
|
|
96
|
+
* `{ spec: { tolerations: [...], nodeSelector: {...} } }`.
|
|
97
|
+
*/
|
|
98
|
+
podTemplate?: Record<string, unknown>;
|
|
99
|
+
/**
|
|
100
|
+
* Cloud-specific workload-identity options, consumed by the cluster
|
|
101
|
+
* platform's identity adapter (on EKS: `{ managedPolicyArns: [...] }`
|
|
102
|
+
* attaches extra managed policies to the generated pod-identity role; on
|
|
103
|
+
* GKE: `{ gcpServiceAccount }` runs the pods as an existing Google
|
|
104
|
+
* service account instead of the ServiceAccount's own principal).
|
|
105
|
+
*/
|
|
106
|
+
identity?: WorkloadIdentityOptions;
|
|
107
|
+
/**
|
|
108
|
+
* Deployment / pod labels, merged over the generated
|
|
109
|
+
* `app.kubernetes.io/name` label. Also used as the Service selector.
|
|
110
|
+
*/
|
|
111
|
+
labels?: Record<string, string>;
|
|
112
|
+
/**
|
|
113
|
+
* User-defined tags applied to workload-owned cloud resources (identity
|
|
114
|
+
* roles, image repositories).
|
|
115
|
+
*/
|
|
116
|
+
tags?: Record<string, string>;
|
|
117
|
+
}
|
|
118
|
+
/** Bundle an inline Effect program (`main`) into a generated image. */
|
|
119
|
+
export interface BundledDeploymentProps extends DeploymentPropsBase {
|
|
120
|
+
/**
|
|
121
|
+
* Module entrypoint for the bundled program. This should typically be
|
|
122
|
+
* `import.meta.url` from an inline Effect program.
|
|
123
|
+
*/
|
|
124
|
+
main: string;
|
|
125
|
+
/**
|
|
126
|
+
* Environment image used as the generated Dockerfile's `FROM`; must be
|
|
127
|
+
* able to run the bun runtime.
|
|
128
|
+
* @default "oven/bun:1"
|
|
129
|
+
*/
|
|
130
|
+
image?: string;
|
|
131
|
+
/** Named export to load from `main`. @default "default" */
|
|
132
|
+
handler?: string;
|
|
133
|
+
/** Bundler configuration for the entrypoint. */
|
|
134
|
+
build?: WorkloadImageSource["build"];
|
|
135
|
+
/** Environment Dockerfile (path or inline content). */
|
|
136
|
+
dockerfile?: WorkloadImageSource["dockerfile"];
|
|
137
|
+
/** Build context for a path {@link dockerfile} environment. */
|
|
138
|
+
context?: string;
|
|
139
|
+
}
|
|
140
|
+
/** Build the user's own Dockerfile (`context` + optional `dockerfile` path). */
|
|
141
|
+
export interface DockerfileDeploymentProps extends DeploymentPropsBase {
|
|
142
|
+
/** Docker build context directory. */
|
|
143
|
+
context?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Path to the Dockerfile (relative to the cwd), or inline content.
|
|
146
|
+
* @default `${context}/Dockerfile`
|
|
147
|
+
*/
|
|
148
|
+
dockerfile?: WorkloadImageSource["dockerfile"];
|
|
149
|
+
}
|
|
150
|
+
/** Run a pre-built registry image. */
|
|
151
|
+
export interface ImageDeploymentProps extends DeploymentPropsBase {
|
|
152
|
+
/**
|
|
153
|
+
* A pre-built image reference, e.g. `nginx:1.27`, pulled by the nodes as
|
|
154
|
+
* written. EKS clusters mirror it into ECR first.
|
|
155
|
+
*/
|
|
156
|
+
image: string;
|
|
157
|
+
}
|
|
158
|
+
export type DeploymentProps = BundledDeploymentProps | DockerfileDeploymentProps | ImageDeploymentProps;
|
|
159
|
+
export interface Deployment extends Resource<"Kubernetes.Deployment", DeploymentProps, {
|
|
160
|
+
/** The connection of the cluster the deployment runs on. */
|
|
161
|
+
connection: Connection;
|
|
162
|
+
/** The Kubernetes namespace the deployment's objects live in. */
|
|
163
|
+
namespace: string;
|
|
164
|
+
/** The name of the Kubernetes Deployment. */
|
|
165
|
+
deploymentName: string;
|
|
166
|
+
/** The name of the Kubernetes Service exposing the deployment. */
|
|
167
|
+
serviceName: string;
|
|
168
|
+
/** The name of the service account the pods run as. */
|
|
169
|
+
serviceAccountName: string;
|
|
170
|
+
/** The container port the server listens on. */
|
|
171
|
+
port: number;
|
|
172
|
+
/** The URI of the container image the deployment runs. */
|
|
173
|
+
imageUri: string;
|
|
174
|
+
/**
|
|
175
|
+
* Workload-identity state provisioned by the cluster platform's
|
|
176
|
+
* adapter (on EKS: the pod-identity role + association; on GKE: the
|
|
177
|
+
* Workload Identity principal and the IAM grants applied to it).
|
|
178
|
+
*/
|
|
179
|
+
identity: IdentityState | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* Image-registry state provisioned by the cluster platform's adapter
|
|
182
|
+
* (on EKS: the ECR repository).
|
|
183
|
+
*/
|
|
184
|
+
registry: RegistryState | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* The LoadBalancer URL (`http://<hostname>[:port]` — the cloud load
|
|
187
|
+
* balancer listens on the Service `port`, so a non-80 port is part of
|
|
188
|
+
* the URL) when `serviceType` is `LoadBalancer`, otherwise
|
|
189
|
+
* `undefined`. May be `undefined` immediately after a create while
|
|
190
|
+
* the cloud load balancer is still provisioning.
|
|
191
|
+
*/
|
|
192
|
+
url: string | undefined;
|
|
193
|
+
/** References to the Kubernetes objects created for the deployment. */
|
|
194
|
+
kubernetesObjects: KubernetesObjectRef[];
|
|
195
|
+
/** The content hash of the container image source. */
|
|
196
|
+
code: {
|
|
197
|
+
hash: string;
|
|
198
|
+
};
|
|
199
|
+
}, WorkloadBindingContract, Providers> {
|
|
200
|
+
}
|
|
201
|
+
export type DeploymentServices = ServerHostService | WorkloadServices;
|
|
202
|
+
export type DeploymentShape = Main<DeploymentServices>;
|
|
203
|
+
export interface DeploymentRuntimeContext extends HostRuntimeContext {
|
|
204
|
+
readonly Type: "Kubernetes.Deployment";
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* A replicated Kubernetes server on any cluster, running a container image
|
|
208
|
+
* or an HTTP server written in Effect.
|
|
209
|
+
*
|
|
210
|
+
* `Deployment` provisions a Kubernetes `Deployment` + `Service` (+
|
|
211
|
+
* `ServiceAccount`) via server-side apply, with the container image from
|
|
212
|
+
* exactly one of three sources flat on props: `main` (bundle an inline
|
|
213
|
+
* Effect program), `context` (build your own Dockerfile), or `image` (a
|
|
214
|
+
* pre-built registry reference). `main` and `context` images are built on
|
|
215
|
+
* the deploying machine and pushed to the connection's registry
|
|
216
|
+
* (`Kubernetes.LocalCluster` includes one; EKS uses ECR; GKE uses
|
|
217
|
+
* Artifact Registry). Bindings attach environment variables on any
|
|
218
|
+
* cluster; cloud credential grants need a platform with workload identity.
|
|
219
|
+
* On `AWS.EKS.Cluster` targets it accepts the `{ env, policyStatements }`
|
|
220
|
+
* contract of `AWS.Lambda.Function`: IAM policy statements go to a
|
|
221
|
+
* generated pod-identity role. On `GCP.Container.Cluster` targets it
|
|
222
|
+
* accepts the `{ env, iam }` contract of `GCP.Run.Service`: IAM roles are
|
|
223
|
+
* granted to the Kubernetes ServiceAccount's Workload Identity Federation
|
|
224
|
+
* principal.
|
|
225
|
+
* ### Creating a Deployment
|
|
226
|
+
* **Example:** Run an image on a local cluster
|
|
227
|
+
* ```typescript
|
|
228
|
+
* const cluster = yield* Kubernetes.LocalCluster("Cluster", {
|
|
229
|
+
* name: "alchemy",
|
|
230
|
+
* });
|
|
231
|
+
*
|
|
232
|
+
* const web = yield* Kubernetes.Deployment("Web", {
|
|
233
|
+
* cluster,
|
|
234
|
+
* image: "ghcr.io/stefanprodan/podinfo:6.15.0",
|
|
235
|
+
* replicas: 2,
|
|
236
|
+
* port: 9898,
|
|
237
|
+
* serviceType: "ClusterIP",
|
|
238
|
+
* });
|
|
239
|
+
* web.serviceName; // K8s-native attrs
|
|
240
|
+
* ```
|
|
241
|
+
*
|
|
242
|
+
* **Example:** Any cluster via kubeconfig
|
|
243
|
+
* ```typescript
|
|
244
|
+
* const cluster = Kubernetes.KubeConfig({ context: "prod-east" });
|
|
245
|
+
*
|
|
246
|
+
* const nginx = yield* Kubernetes.Deployment("Nginx", {
|
|
247
|
+
* cluster,
|
|
248
|
+
* image: "nginx:1.27",
|
|
249
|
+
* replicas: 3,
|
|
250
|
+
* port: 80,
|
|
251
|
+
* serviceType: "LoadBalancer",
|
|
252
|
+
* });
|
|
253
|
+
* nginx.url; // the load balancer's address
|
|
254
|
+
* ```
|
|
255
|
+
*
|
|
256
|
+
* **Example:** Build your own Dockerfile
|
|
257
|
+
* ```typescript
|
|
258
|
+
* const legacy = yield* Kubernetes.Deployment("LegacyApp", {
|
|
259
|
+
* cluster,
|
|
260
|
+
* context: "./legacy",
|
|
261
|
+
* replicas: 2,
|
|
262
|
+
* port: 8080,
|
|
263
|
+
* });
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
266
|
+
* ### Effect Servers
|
|
267
|
+
* **Example:** Inline Effect server
|
|
268
|
+
* ```typescript
|
|
269
|
+
* const api = yield* Kubernetes.Deployment(
|
|
270
|
+
* "Api",
|
|
271
|
+
* { cluster, main: import.meta.url, port: 3000, replicas: 2 },
|
|
272
|
+
* Effect.gen(function* () {
|
|
273
|
+
* return {
|
|
274
|
+
* fetch: Effect.succeed(HttpServerResponse.text("ok")),
|
|
275
|
+
* };
|
|
276
|
+
* }),
|
|
277
|
+
* );
|
|
278
|
+
* ```
|
|
279
|
+
*
|
|
280
|
+
* **Example:** Push to your own registry
|
|
281
|
+
* ```typescript
|
|
282
|
+
* const cluster = Kubernetes.KubeConfig({
|
|
283
|
+
* context: "prod-east",
|
|
284
|
+
* registry: { server: "ghcr.io/acme" },
|
|
285
|
+
* });
|
|
286
|
+
*
|
|
287
|
+
* const api = yield* Kubernetes.Deployment(
|
|
288
|
+
* "Api",
|
|
289
|
+
* { cluster, main: import.meta.url, port: 3000 },
|
|
290
|
+
* Effect.gen(function* () {
|
|
291
|
+
* return {
|
|
292
|
+
* fetch: Effect.succeed(HttpServerResponse.text("ok")),
|
|
293
|
+
* };
|
|
294
|
+
* }),
|
|
295
|
+
* );
|
|
296
|
+
* ```
|
|
297
|
+
*
|
|
298
|
+
* **Example:** DynamoDB binding on EKS
|
|
299
|
+
* ```typescript
|
|
300
|
+
* const cluster = yield* AWS.EKS.Cluster("Cluster", { compute: "auto" });
|
|
301
|
+
*
|
|
302
|
+
* const api = yield* Kubernetes.Deployment(
|
|
303
|
+
* "Api",
|
|
304
|
+
* { cluster, main: import.meta.url, port: 3000 },
|
|
305
|
+
* Effect.gen(function* () {
|
|
306
|
+
* const putItem = yield* AWS.DynamoDB.PutItem(table);
|
|
307
|
+
* return {
|
|
308
|
+
* fetch: Effect.gen(function* () {
|
|
309
|
+
* yield* putItem({ Item: { id: { S: "1" } } });
|
|
310
|
+
* return HttpServerResponse.text("ok");
|
|
311
|
+
* }),
|
|
312
|
+
* };
|
|
313
|
+
* }).pipe(Effect.provide(AWS.DynamoDB.PutItemHttp)),
|
|
314
|
+
* );
|
|
315
|
+
* ```
|
|
316
|
+
*
|
|
317
|
+
* **Example:** Tagged Effect server
|
|
318
|
+
* ```typescript
|
|
319
|
+
* export class Api extends Kubernetes.Deployment<Api, {
|
|
320
|
+
* health: () => Effect.Effect<string>;
|
|
321
|
+
* }>()("Api") {}
|
|
322
|
+
*
|
|
323
|
+
* export default Api.make(
|
|
324
|
+
* { cluster, main: import.meta.url, port: 3000 },
|
|
325
|
+
* Effect.gen(function* () {
|
|
326
|
+
* return {
|
|
327
|
+
* fetch: Effect.gen(function* () {
|
|
328
|
+
* return HttpServerResponse.text("ok");
|
|
329
|
+
* }),
|
|
330
|
+
* health: () => Effect.succeed("ok"),
|
|
331
|
+
* };
|
|
332
|
+
* }),
|
|
333
|
+
* );
|
|
334
|
+
* ```
|
|
335
|
+
*
|
|
336
|
+
* ### Bundling & Tree-shaking
|
|
337
|
+
* `main` is bundled with rolldown at deploy time. Unused code is
|
|
338
|
+
* tree-shaken. `effect`, alchemy, and `@distilled.cloud` are marked
|
|
339
|
+
* pure so unused parts prune more aggressively. Your app is not
|
|
340
|
+
* marked pure.
|
|
341
|
+
*
|
|
342
|
+
* **Example:** Mark additional packages as pure
|
|
343
|
+
* Only list packages with no top-level side effects.
|
|
344
|
+
* ```typescript
|
|
345
|
+
* {
|
|
346
|
+
* main: import.meta.url,
|
|
347
|
+
* build: {
|
|
348
|
+
* pure: { packages: ["my-lib", "@my-scope/*"] },
|
|
349
|
+
* },
|
|
350
|
+
* }
|
|
351
|
+
* ```
|
|
352
|
+
*
|
|
353
|
+
* **Example:** Turn it off
|
|
354
|
+
* ```typescript
|
|
355
|
+
* {
|
|
356
|
+
* main: import.meta.url,
|
|
357
|
+
* build: { pure: false },
|
|
358
|
+
* }
|
|
359
|
+
* ```
|
|
360
|
+
*
|
|
361
|
+
* ### Kubernetes Escape Hatch
|
|
362
|
+
* **Example:** Tune the synthesized pod template
|
|
363
|
+
* ```typescript
|
|
364
|
+
* const tuned = yield* Kubernetes.Deployment("Api", {
|
|
365
|
+
* cluster,
|
|
366
|
+
* main: import.meta.url,
|
|
367
|
+
* port: 3000,
|
|
368
|
+
* podTemplate: {
|
|
369
|
+
* spec: {
|
|
370
|
+
* tolerations: [{ key: "gpu", operator: "Exists" }],
|
|
371
|
+
* nodeSelector: { pool: "arm" },
|
|
372
|
+
* },
|
|
373
|
+
* },
|
|
374
|
+
* });
|
|
375
|
+
* ```
|
|
376
|
+
*
|
|
377
|
+
* @resource
|
|
378
|
+
* @product Workloads
|
|
379
|
+
*/
|
|
380
|
+
export declare const Deployment: Platform<Deployment, DeploymentServices, DeploymentShape, DeploymentRuntimeContext>;
|
|
381
|
+
export declare const DeploymentProvider: () => import("effect/Layer").Layer<Provider.Provider<Deployment>, never, import("alchemy/AlchemyContext").AlchemyContext | import("@alchemy.run/docker/Docker").Docker | import("effect/FileSystem").FileSystem | import("effect/Path").Path | Stack | import("alchemy/Stage").Stage>;
|
|
382
|
+
//# sourceMappingURL=Deployment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Deployment.d.ts","sourceRoot":"","sources":["../src/De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