@alchemy.run/kubernetes 0.0.0 → 2.0.0-beta.85

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.
Files changed (94) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +41 -4
  3. package/lib/BuiltinAdapters.d.ts +43 -0
  4. package/lib/BuiltinAdapters.d.ts.map +1 -0
  5. package/lib/BuiltinAdapters.js +129 -0
  6. package/lib/BuiltinAdapters.js.map +1 -0
  7. package/lib/Client.d.ts +97 -0
  8. package/lib/Client.d.ts.map +1 -0
  9. package/lib/Client.js +312 -0
  10. package/lib/Client.js.map +1 -0
  11. package/lib/ClusterAdapter.d.ts +324 -0
  12. package/lib/ClusterAdapter.d.ts.map +1 -0
  13. package/lib/ClusterAdapter.js +65 -0
  14. package/lib/ClusterAdapter.js.map +1 -0
  15. package/lib/Connection.d.ts +210 -0
  16. package/lib/Connection.d.ts.map +1 -0
  17. package/lib/Connection.js +58 -0
  18. package/lib/Connection.js.map +1 -0
  19. package/lib/Deployment.d.ts +401 -0
  20. package/lib/Deployment.d.ts.map +1 -0
  21. package/lib/Deployment.js +550 -0
  22. package/lib/Deployment.js.map +1 -0
  23. package/lib/HelmChart.d.ts +147 -0
  24. package/lib/HelmChart.d.ts.map +1 -0
  25. package/lib/HelmChart.js +248 -0
  26. package/lib/HelmChart.js.map +1 -0
  27. package/lib/Job.d.ts +333 -0
  28. package/lib/Job.d.ts.map +1 -0
  29. package/lib/Job.js +443 -0
  30. package/lib/Job.js.map +1 -0
  31. package/lib/LocalCluster.d.ts +243 -0
  32. package/lib/LocalCluster.d.ts.map +1 -0
  33. package/lib/LocalCluster.js +359 -0
  34. package/lib/LocalCluster.js.map +1 -0
  35. package/lib/Manifest.d.ts +157 -0
  36. package/lib/Manifest.d.ts.map +1 -0
  37. package/lib/Manifest.js +205 -0
  38. package/lib/Manifest.js.map +1 -0
  39. package/lib/Objects.d.ts +60 -0
  40. package/lib/Objects.d.ts.map +1 -0
  41. package/lib/Objects.js +132 -0
  42. package/lib/Objects.js.map +1 -0
  43. package/lib/Providers.d.ts +24 -0
  44. package/lib/Providers.d.ts.map +1 -0
  45. package/lib/Providers.js +36 -0
  46. package/lib/Providers.js.map +1 -0
  47. package/lib/index.d.ts +10 -0
  48. package/lib/index.d.ts.map +1 -0
  49. package/lib/index.js +10 -0
  50. package/lib/index.js.map +1 -0
  51. package/lib/internal/declared.d.ts +19 -0
  52. package/lib/internal/declared.d.ts.map +1 -0
  53. package/lib/internal/declared.js +435 -0
  54. package/lib/internal/declared.js.map +1 -0
  55. package/lib/internal/helm.d.ts +65 -0
  56. package/lib/internal/helm.d.ts.map +1 -0
  57. package/lib/internal/helm.js +173 -0
  58. package/lib/internal/helm.js.map +1 -0
  59. package/lib/internal/kind.d.ts +17 -0
  60. package/lib/internal/kind.d.ts.map +1 -0
  61. package/lib/internal/kind.js +31 -0
  62. package/lib/internal/kind.js.map +1 -0
  63. package/lib/internal/kubeconfig.d.ts +79 -0
  64. package/lib/internal/kubeconfig.d.ts.map +1 -0
  65. package/lib/internal/kubeconfig.js +222 -0
  66. package/lib/internal/kubeconfig.js.map +1 -0
  67. package/lib/internal/registry.d.ts +44 -0
  68. package/lib/internal/registry.d.ts.map +1 -0
  69. package/lib/internal/registry.js +72 -0
  70. package/lib/internal/registry.js.map +1 -0
  71. package/lib/internal/workload.d.ts +127 -0
  72. package/lib/internal/workload.d.ts.map +1 -0
  73. package/lib/internal/workload.js +411 -0
  74. package/lib/internal/workload.js.map +1 -0
  75. package/package.json +55 -3
  76. package/src/BuiltinAdapters.ts +202 -0
  77. package/src/Client.ts +496 -0
  78. package/src/ClusterAdapter.ts +373 -0
  79. package/src/Connection.ts +234 -0
  80. package/src/Deployment.ts +872 -0
  81. package/src/HelmChart.ts +388 -0
  82. package/src/Job.ts +709 -0
  83. package/src/LocalCluster.ts +631 -0
  84. package/src/Manifest.ts +301 -0
  85. package/src/Objects.ts +213 -0
  86. package/src/Providers.ts +52 -0
  87. package/src/globals.d.ts +2 -0
  88. package/src/index.ts +9 -0
  89. package/src/internal/declared.ts +471 -0
  90. package/src/internal/helm.ts +245 -0
  91. package/src/internal/kind.ts +43 -0
  92. package/src/internal/kubeconfig.ts +364 -0
  93. package/src/internal/registry.ts +108 -0
  94. package/src/internal/workload.ts +504 -0
package/lib/Client.js ADDED
@@ -0,0 +1,312 @@
1
+ import * as https from "node:https";
2
+ import { isPlainObject, unwrapRedacted } from "alchemy/Util/data";
3
+ import { collectRedactedSecrets, redactJson } from "alchemy/Util/Redaction";
4
+ /**
5
+ * Internal Kubernetes API client: transport-agnostic server-side apply and
6
+ * kind discovery for arbitrary (CRD) manifests. Powers
7
+ * `Kubernetes.Manifest`, `Kubernetes.Deployment`, `Kubernetes.Job`,
8
+ * `Kubernetes.HelmChart`, and the `AWS.EKS.Cluster` kubernetes-object
9
+ * binding channel. Not exported from the Kubernetes index.
10
+ *
11
+ * Authentication is delegated to the connection's {@link ClusterAdapter}:
12
+ * every request mints headers through the resolved
13
+ * {@link ClusterTransport}, so short-lived tokens (EKS SigV4 presigns,
14
+ * exec-plugin credentials) stay fresh.
15
+ */
16
+ import * as Data from "effect/Data";
17
+ import * as Effect from "effect/Effect";
18
+ import * as Schedule from "effect/Schedule";
19
+ import { ClusterNotFoundError, findClusterAdapter, } from "./ClusterAdapter.js";
20
+ import { driftMask, hashDriftSelection } from "./internal/declared.js";
21
+ import { buildKubernetesObjectPathWithSpec, chunkByApplyRank, DEFAULT_APPLY_RANK, kubernetesObjectKey, lookupKubernetesKindSpec, sortRefsForDelete, toKubernetesObjectRef, } from "./Objects.js";
22
+ export class KubernetesClientOperationFailed extends Data.TaggedError("KubernetesClientOperationFailed") {
23
+ }
24
+ export class KubernetesApiError extends Data.TaggedError("KubernetesApiError") {
25
+ get message() {
26
+ return `${this.method} ${this.path} responded ${this.statusCode}: ${this.body.length > 0 ? this.body.slice(0, 1000) : "(empty body)"}`;
27
+ }
28
+ }
29
+ /** An object ref that cannot be mapped to a REST path (e.g. a namespaced kind without a namespace). */
30
+ export class KubernetesObjectPathError extends Data.TaggedError("KubernetesObjectPathError") {
31
+ }
32
+ const fieldManager = "alchemy";
33
+ /** Deadline for auth-header minting and for each HTTP attempt. */
34
+ const requestTimeout = "10 seconds";
35
+ /**
36
+ * Resolve the {@link ClusterTransport} for a connection through its
37
+ * registered adapter.
38
+ */
39
+ export const connectCluster = (connection) => findClusterAdapter(connection.auth.kind).pipe(Effect.flatMap((adapter) => adapter.connect(connection)));
40
+ /** 404 from the apiserver, including a removed CRD's discovery 404. */
41
+ export class KubernetesNotFound extends Data.TaggedError("KubernetesNotFound") {
42
+ get message() {
43
+ return `${this.method} ${this.path} responded 404: ${this.body.length > 0 ? this.body.slice(0, 1000) : "(empty body)"}`;
44
+ }
45
+ }
46
+ /**
47
+ * The effect's result when the cluster exists. `ClusterNotFoundError`
48
+ * becomes `undefined`; auth and HTTP failures stay failures.
49
+ */
50
+ export const ifClusterExists = (effect) => effect.pipe(Effect.catchTag("Kubernetes.ClusterNotFoundError", () => Effect.undefined));
51
+ const requestJson = Effect.fn(function* ({ transport, method, path, body, redactions = [], }) {
52
+ // Outside the attempt retry: a hung token mint must not be retried as
53
+ // if it were a refused connection.
54
+ const headers = yield* transport.headers.pipe(Effect.timeout(requestTimeout));
55
+ const url = new URL(path, transport.endpoint);
56
+ // JSON.stringify(Redacted) emits the display placeholder. Unwrap only at
57
+ // the wire so plans and state keep the wrapper.
58
+ const prepared = yield* Effect.sync(() => {
59
+ const payload = body === undefined ? undefined : JSON.stringify(unwrapRedacted(body));
60
+ return {
61
+ payload,
62
+ contentLength: payload === undefined ? undefined : Buffer.byteLength(payload),
63
+ ca: transport.certificateAuthorityData === undefined
64
+ ? undefined
65
+ : Buffer.from(transport.certificateAuthorityData, "base64").toString("utf8"),
66
+ secrets: [...(body === undefined ? [] : collectRedactedSecrets(body)), ...redactions],
67
+ };
68
+ });
69
+ const response = yield* Effect.callback((resume, signal) => {
70
+ const request = https.request({
71
+ signal,
72
+ protocol: url.protocol,
73
+ hostname: url.hostname,
74
+ port: url.port || 443,
75
+ path: `${url.pathname}${url.search}`,
76
+ method,
77
+ headers: {
78
+ ...headers,
79
+ Accept: "application/json",
80
+ ...(prepared.payload === undefined
81
+ ? {}
82
+ : {
83
+ "Content-Type": "application/apply-patch+yaml",
84
+ "Content-Length": prepared.contentLength,
85
+ }),
86
+ },
87
+ ...(prepared.ca === undefined ? {} : { ca: prepared.ca }),
88
+ ...(transport.clientCert
89
+ ? {
90
+ cert: transport.clientCert.certificate,
91
+ key: transport.clientCert.key,
92
+ }
93
+ : {}),
94
+ ...(transport.insecureSkipTlsVerify ? { rejectUnauthorized: false } : {}),
95
+ }, (incoming) => {
96
+ const chunks = [];
97
+ incoming.on("data", (chunk) => {
98
+ chunks.push(chunk);
99
+ });
100
+ incoming.on("error", (error) => {
101
+ resume(Effect.fail(error));
102
+ });
103
+ incoming.on("aborted", () => {
104
+ resume(Effect.fail(new KubernetesClientOperationFailed({
105
+ message: `Kubernetes ${method} ${path} response aborted`,
106
+ })));
107
+ });
108
+ incoming.on("end", () => {
109
+ if (incoming.complete === false) {
110
+ resume(Effect.fail(new KubernetesClientOperationFailed({
111
+ message: `Kubernetes ${method} ${path} response ended before completion`,
112
+ })));
113
+ return;
114
+ }
115
+ const statusCode = incoming.statusCode ?? 500;
116
+ resume(Effect.sync(() => ({
117
+ statusCode,
118
+ body: Buffer.concat(chunks).toString("utf8"),
119
+ })));
120
+ });
121
+ });
122
+ request.on("error", (error) => {
123
+ resume(Effect.fail(error instanceof Error
124
+ ? error
125
+ : new KubernetesClientOperationFailed({ message: String(error) })));
126
+ });
127
+ if (prepared.payload !== undefined)
128
+ request.write(prepared.payload);
129
+ request.end();
130
+ // Bun's TLS client ignores AbortSignal. Destroying the socket releases it.
131
+ // Effect.callback already drops a second resume, and this finalizer runs
132
+ // on the same interrupt that aborts `signal`.
133
+ return Effect.sync(() => {
134
+ request.destroy();
135
+ request.socket?.destroy();
136
+ });
137
+ }).pipe(Effect.timeout(requestTimeout), Effect.mapError((error) => new KubernetesClientOperationFailed({
138
+ message: `Failed Kubernetes ${method} ${path}: ${error instanceof Error ? error.message : String(error)}`,
139
+ })),
140
+ // Transport-level failures (ECONNREFUSED/ECONNRESET/ETIMEDOUT/DNS,
141
+ // the per-attempt deadline) are transient — a fresh managed endpoint's
142
+ // load balancer can refuse connections for a short window after the
143
+ // cluster reports ready. Every request here is idempotent (GET / SSA
144
+ // PATCH / DELETE), so retry them. HTTP status errors are classified
145
+ // below and are not retried here.
146
+ Effect.retry({
147
+ schedule: Schedule.max([Schedule.spaced("5 seconds"), Schedule.recurs(8)]),
148
+ }));
149
+ if (response.statusCode < 200 || response.statusCode >= 300) {
150
+ // Error bodies can echo the request. Scrub only failures —
151
+ // a successful dry-run is the object we compare for drift.
152
+ const responseBody = yield* Effect.sync(() => redactJson(response.body, prepared.secrets));
153
+ if (response.statusCode === 404) {
154
+ return yield* new KubernetesNotFound({ method, path, body: responseBody });
155
+ }
156
+ return yield* new KubernetesApiError({
157
+ method,
158
+ path,
159
+ statusCode: response.statusCode,
160
+ body: responseBody,
161
+ });
162
+ }
163
+ if (!response.body.trim())
164
+ return undefined;
165
+ return yield* Effect.sync(() => {
166
+ try {
167
+ return JSON.parse(response.body);
168
+ }
169
+ catch {
170
+ return response.body;
171
+ }
172
+ });
173
+ });
174
+ // One resolution per (endpoint, apiVersion, kind) per process. Plain cached
175
+ // values (no finalizers), so module scope is safe.
176
+ const discoveredKinds = new Map();
177
+ /**
178
+ * Resolve the REST mapping (plural + scope) for an arbitrary kind: static
179
+ * table fast path, then the Kubernetes discovery API (`/apis/{g}/{v}` or
180
+ * `/api/v1`). This is what lets `Kubernetes.Manifest` apply any CRD.
181
+ */
182
+ export const resolveKindSpec = Effect.fn(function* ({ transport, input, }) {
183
+ const staticSpec = lookupKubernetesKindSpec(input);
184
+ if (staticSpec)
185
+ return staticSpec;
186
+ const cacheKey = `${transport.endpoint}|${input.apiVersion}|${input.kind}`;
187
+ const cached = discoveredKinds.get(cacheKey);
188
+ if (cached)
189
+ return cached;
190
+ const discoveryPath = input.apiVersion.includes("/")
191
+ ? `/apis/${input.apiVersion}`
192
+ : `/api/${input.apiVersion}`;
193
+ const listed = (yield* requestJson({
194
+ transport,
195
+ method: "GET",
196
+ path: discoveryPath,
197
+ }));
198
+ const resource = listed.resources?.find((candidate) => candidate.kind === input.kind &&
199
+ typeof candidate.name === "string" &&
200
+ !candidate.name.includes("/"));
201
+ if (!resource?.name) {
202
+ return yield* new KubernetesNotFound({
203
+ method: "GET",
204
+ path: discoveryPath,
205
+ body: `Kind '${input.kind}' not found in API group '${input.apiVersion}'`,
206
+ });
207
+ }
208
+ const spec = {
209
+ plural: resource.name,
210
+ scope: resource.namespaced ? "Namespaced" : "Cluster",
211
+ applyRank: DEFAULT_APPLY_RANK,
212
+ };
213
+ discoveredKinds.set(cacheKey, spec);
214
+ return spec;
215
+ });
216
+ const buildPath = Effect.fn(function* ({ transport, object, }) {
217
+ const spec = yield* resolveKindSpec({ transport, input: object });
218
+ return yield* Effect.try({
219
+ try: () => buildKubernetesObjectPathWithSpec(object, spec),
220
+ catch: (error) => new KubernetesObjectPathError({
221
+ message: error instanceof Error ? error.message : String(error),
222
+ cause: error,
223
+ }),
224
+ });
225
+ });
226
+ // ─────────────────────────────────────────────────────────── object ops ──
227
+ export const readObject = Effect.fn(function* ({ transport, object, }) {
228
+ return yield* requestJson({
229
+ transport,
230
+ method: "GET",
231
+ path: yield* buildPath({ transport, object }),
232
+ }).pipe(
233
+ // Drift reads a whole Helm release at once. A 429 is the apiserver
234
+ // asking for a pause, not a failed object.
235
+ Effect.retry({
236
+ while: (error) => error instanceof KubernetesApiError && error.statusCode === 429,
237
+ schedule: Schedule.max([Schedule.spaced("1 second"), Schedule.recurs(4)]),
238
+ }));
239
+ });
240
+ export const applyObject = Effect.fn(function* ({ transport, object, redactions, }) {
241
+ const basePath = yield* buildPath({
242
+ transport,
243
+ object: toKubernetesObjectRef(object),
244
+ });
245
+ const path = `${basePath}?fieldManager=${fieldManager}&force=true`;
246
+ // A freshly provisioned cluster's API server briefly 5xxes while warming
247
+ // up, and the creator's bootstrap access can propagate asynchronously
248
+ // (401/403 in the first minute).
249
+ return yield* requestJson({
250
+ transport,
251
+ method: "PATCH",
252
+ path,
253
+ body: object,
254
+ redactions,
255
+ }).pipe(Effect.retry({
256
+ while: (e) => e instanceof KubernetesApiError &&
257
+ (e.statusCode >= 500 ||
258
+ e.statusCode === 429 ||
259
+ e.statusCode === 401 ||
260
+ e.statusCode === 403),
261
+ schedule: Schedule.max([Schedule.spaced("6 seconds"), Schedule.recurs(10)]),
262
+ }));
263
+ });
264
+ export const deleteObject = Effect.fn(function* ({ transport, object, }) {
265
+ yield* buildPath({ transport, object }).pipe(Effect.flatMap((path) => requestJson({
266
+ transport,
267
+ method: "DELETE",
268
+ // batch/v1 Jobs orphan their pods on DELETE unless a propagation
269
+ // policy is set; Background matches kubectl's default.
270
+ path: `${path}?propagationPolicy=Background`,
271
+ })), Effect.catchTag("KubernetesNotFound", () => Effect.void));
272
+ });
273
+ export const reconcileObjects = Effect.fn(function* ({ transport, previousObjects, desiredObjects, redactions, }) {
274
+ const desiredRefs = desiredObjects.map(toKubernetesObjectRef);
275
+ const desiredKeys = new Set(desiredRefs.map(kubernetesObjectKey));
276
+ const removedObjects = previousObjects.filter((object) => !desiredKeys.has(kubernetesObjectKey(object)));
277
+ for (const object of sortRefsForDelete(removedObjects)) {
278
+ yield* deleteObject({
279
+ transport,
280
+ object,
281
+ });
282
+ }
283
+ const baselines = new Map();
284
+ for (const chunk of chunkByApplyRank(desiredObjects)) {
285
+ yield* Effect.forEach(chunk, (object) => Effect.gen(function* () {
286
+ const applied = yield* applyObject({
287
+ transport,
288
+ object,
289
+ redactions,
290
+ });
291
+ const ref = toKubernetesObjectRef(object);
292
+ const witnessed = isPlainObject(applied) ? applied : undefined;
293
+ baselines.set(kubernetesObjectKey(ref), {
294
+ driftMask: driftMask(object, witnessed),
295
+ baselineHash: yield* hashDriftSelection(object, witnessed ?? object),
296
+ });
297
+ }), { concurrency: "unbounded" });
298
+ }
299
+ return desiredRefs.map((ref) => ({
300
+ ...ref,
301
+ ...baselines.get(kubernetesObjectKey(ref)),
302
+ }));
303
+ });
304
+ export const deleteObjects = Effect.fn(function* ({ transport, objects, }) {
305
+ for (const object of sortRefsForDelete(objects)) {
306
+ yield* deleteObject({
307
+ transport,
308
+ object,
309
+ });
310
+ }
311
+ });
312
+ //# sourceMappingURL=Client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Client.js","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC5E;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GAEnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EACL,iCAAiC,EACjC,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,GAItB,MAAM,cAAc,CAAC;AAEtB,MAAM,OAAO,+BAAgC,SAAQ,IAAI,CAAC,WAAW,CACnE,iCAAiC,CAIjC;CAAG;AAEL,MAAM,OAAO,kBAAmB,SAAQ,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAK3E;IACA,IAAa,OAAO;QAClB,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI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G,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE;gBACtC,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;gBACvC,YAAY,EAAE,KAAK,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,SAAS,IAAI,MAAM,CAAC;aACrE,CAAC,CAAC;QACL,CAAC,CAAC,EACJ,EAAE,WAAW,EAAE,WAAW,EAAE,CAC7B,CAAC;IACJ,CAAC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/B,GAAG,GAAG;QACN,GAAG,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;KAC3C,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,EAChD,SAAS,EACT,OAAO,GAIR;IACC,KAAK,MAAM,MAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC;QAChD,KAAK,CAAC,CAAC,YAAY,CAAC;YAClB,SAAS;YACT,MAAM;SACP,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,324 @@
1
+ import type { InlineDockerfile } from "@alchemy.run/docker/Dockerfile";
2
+ import type { DockerfileBuild } from "@alchemy.run/docker/ImageSource";
3
+ import type * as Bundle from "alchemy/Bundle/Bundle";
4
+ import type { ResourceBinding } from "alchemy/Resource";
5
+ import type { ResourceContext } from "alchemy/ResourceContext";
6
+ import type { Stack } from "alchemy/Stack";
7
+ import type { Stage } from "alchemy/Stage";
8
+ /**
9
+ * The extension seam between the cluster-agnostic `Kubernetes.*` workloads
10
+ * and the platform a cluster runs on.
11
+ *
12
+ * A {@link ClusterAdapterService} is registered under a keyed Context tag —
13
+ * `Kubernetes.ClusterAdapter/<auth kind>` — and resolved dynamically from
14
+ * the ambient provider context by {@link findClusterAdapter}, mirroring how
15
+ * resource providers are resolved by type. `Kubernetes.providers()` ships
16
+ * the built-in adapters (`kubeconfig`, `token`, `client-cert`, `exec`);
17
+ * cloud provider layers contribute theirs (`AWS.providers()` registers
18
+ * `aws-eks`).
19
+ *
20
+ * An adapter owns everything platform-specific:
21
+ *
22
+ * - **connect** (required) — resolve the API server endpoint/CA and mint
23
+ * per-request auth headers.
24
+ * - **identity** (optional) — provision workload identity for a namespace +
25
+ * service account and translate host bindings into cloud credentials
26
+ * (EKS Pod Identity, GKE Workload Identity Federation).
27
+ * - **registry** (optional) — build/mirror container images into a managed
28
+ * registry the cluster can pull from (ECR on EKS, Artifact Registry on GKE).
29
+ * - **bootstrap** (optional) — platform-specific generated container
30
+ * entries for Effect-native workloads (e.g. wiring the AWS credential
31
+ * chain for Pod Identity).
32
+ * - **loadBalancerDefaults** (optional) — platform defaults for
33
+ * `LoadBalancer` Services (EKS Auto Mode's `loadBalancerClass` +
34
+ * internet-facing scheme).
35
+ */
36
+ import * as Context from "effect/Context";
37
+ import * as Effect from "effect/Effect";
38
+ import type { Connection } from "./Connection.ts";
39
+ /**
40
+ * Per-resource engine services ambient inside every provider lifecycle
41
+ * operation. Adapter methods run inside the workload providers' lifecycle
42
+ * ops, so they may require these (physical-name generation needs the
43
+ * resource's ResourceContext + Stack + Stage) — everything else an adapter
44
+ * needs is captured at its layer build.
45
+ */
46
+ export type AdapterLifecycleServices = ResourceContext | Stack | Stage;
47
+ declare const ClusterNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
48
+ readonly _tag: "Kubernetes.ClusterNotFoundError";
49
+ } & Readonly<A>;
50
+ /**
51
+ * The target cluster no longer exists (definitively — e.g. the managed
52
+ * control plane is deleted or deleting). Distinct from transient
53
+ * unreachability: `read`/`delete` treat this as "everything in-cluster is
54
+ * already gone".
55
+ */
56
+ export declare class ClusterNotFoundError extends ClusterNotFoundError_base<{
57
+ message: string;
58
+ }> {
59
+ }
60
+ /**
61
+ * A resolved transport to a cluster's API server. `headers` is an Effect
62
+ * so short-lived tokens (EKS SigV4 presigns, exec plugin credentials) are
63
+ * minted per request.
64
+ */
65
+ export interface ClusterTransport {
66
+ /** The API server endpoint URL. */
67
+ endpoint: string;
68
+ /** Base64-encoded PEM certificate authority bundle. */
69
+ certificateAuthorityData?: string;
70
+ /** Skip TLS verification (self-signed local clusters). */
71
+ insecureSkipTlsVerify?: boolean;
72
+ /** Mint the auth headers for one request. */
73
+ headers: Effect.Effect<Record<string, string>, Error>;
74
+ /** PEM client certificate credentials for mutual TLS. */
75
+ clientCert?: {
76
+ certificate: string;
77
+ key: string;
78
+ };
79
+ }
80
+ /**
81
+ * Workload identity state persisted on a workload's attributes, keyed by
82
+ * adapter kind. Cloud providers extend it via module augmentation — AWS
83
+ * registers:
84
+ *
85
+ * ```ts
86
+ * declare module "@alchemy.run/kubernetes/ClusterAdapter" {
87
+ * interface IdentityStateRegistry {
88
+ * "aws-pod-identity": {
89
+ * roleArn: string;
90
+ * roleName: string;
91
+ * associationArn: string;
92
+ * associationId: string;
93
+ * };
94
+ * }
95
+ * }
96
+ * ```
97
+ */
98
+ export interface IdentityStateRegistry {
99
+ }
100
+ /** The discriminated identity-state union across all registered adapters. */
101
+ export type IdentityState = {
102
+ [K in keyof IdentityStateRegistry]: {
103
+ readonly kind: K;
104
+ } & IdentityStateRegistry[K];
105
+ }[keyof IdentityStateRegistry];
106
+ /**
107
+ * Image-registry state persisted on a workload's attributes, keyed by
108
+ * adapter kind (AWS registers `"aws-ecr"` with the repository name/URI).
109
+ * The built-in `"registry"` entry records images pushed to a connection's
110
+ * {@link Connection.registry}.
111
+ */
112
+ export interface RegistryStateRegistry {
113
+ registry: {
114
+ /** The registry `server` the image was pushed to. */
115
+ server: string;
116
+ /** The repository the image was pushed to (`<server>/<name>`). */
117
+ repository: string;
118
+ };
119
+ }
120
+ /** The discriminated registry-state union across all registered adapters. */
121
+ export type RegistryState = {
122
+ [K in keyof RegistryStateRegistry]: {
123
+ readonly kind: K;
124
+ } & RegistryStateRegistry[K];
125
+ }[keyof RegistryStateRegistry];
126
+ /**
127
+ * Cloud-specific workload identity options, extended via module
128
+ * augmentation (AWS adds `managedPolicyArns`, GCP `gcpServiceAccount`).
129
+ */
130
+ export interface WorkloadIdentityOptions {
131
+ }
132
+ /**
133
+ * The binding contract of `Kubernetes.Deployment` / `Kubernetes.Job`
134
+ * hosts. The core contract is environment variables; cloud providers
135
+ * augment it with their credential-grant channels (AWS adds
136
+ * `policyStatements`, GCP adds `iam`), which the matching {@link ClusterAdapterService}'s
137
+ * identity adapter materializes at deploy time.
138
+ */
139
+ export interface WorkloadBindingContract {
140
+ env?: Record<string, any>;
141
+ }
142
+ /**
143
+ * Ambient runtime services the workload platforms assume inside the
144
+ * deployed container, keyed by contributor and extended via module
145
+ * augmentation — AWS registers its credential-chain services so inline
146
+ * impls can use AWS bindings without providing them:
147
+ *
148
+ * ```ts
149
+ * declare module "@alchemy.run/kubernetes/ClusterAdapter" {
150
+ * interface WorkloadServicesRegistry {
151
+ * aws: Credentials | Region | AWSEnvironment;
152
+ * }
153
+ * }
154
+ * ```
155
+ */
156
+ export interface WorkloadServicesRegistry {
157
+ }
158
+ /** The union of all registered ambient workload services. */
159
+ export type WorkloadServices = WorkloadServicesRegistry[keyof WorkloadServicesRegistry];
160
+ /**
161
+ * The image-source shape shared by every workload: exactly one of `main`
162
+ * (bundle an inline Effect program), `context`/`dockerfile` (build the
163
+ * user's Dockerfile), or `image` (a pre-built registry reference).
164
+ * Structurally mirrors the AWS container platforms' source props.
165
+ */
166
+ export interface WorkloadImageSource {
167
+ main?: string;
168
+ handler?: string;
169
+ /**
170
+ * Bundler configuration for `main`, or Docker build args and secrets for
171
+ * a `context`/`dockerfile` build. Unused bundled code is tree-shaken.
172
+ * `effect`, alchemy, and `@distilled.cloud` are marked pure so unused
173
+ * parts prune more aggressively. List extra packages with
174
+ * `pure.packages`, or disable with `pure: false`.
175
+ */
176
+ build?: Bundle.BundleConfig & DockerfileBuild;
177
+ context?: string;
178
+ dockerfile?: string | InlineDockerfile;
179
+ image?: string;
180
+ }
181
+ export interface WorkloadIdentityReconcileOptions {
182
+ /** Logical resource id. */
183
+ id: string;
184
+ /** The resolved cluster connection. */
185
+ connection: Connection;
186
+ /** The namespace the workload runs in. */
187
+ namespace: string;
188
+ /** The service account name the workload's pods run as. */
189
+ serviceAccount: string;
190
+ /** Host bindings attached to the workload. */
191
+ bindings: ResourceBinding<WorkloadBindingContract>[];
192
+ /** Cloud-specific identity options from the workload's `identity` prop. */
193
+ options: WorkloadIdentityOptions | undefined;
194
+ /**
195
+ * Previously persisted identity state, if any — untyped hints because
196
+ * legacy pre-rename rows carry the old flat attribute shape; adapters
197
+ * narrow structurally and re-observe cloud state as the authority.
198
+ */
199
+ state: Record<string, unknown> | undefined;
200
+ /** Internal + user tags for identity-owned cloud resources. */
201
+ tags: Record<string, string>;
202
+ }
203
+ export interface WorkloadIdentityResult {
204
+ /** Extra container environment collected from bindings. */
205
+ env: Record<string, any>;
206
+ /** Annotations to stamp on the workload's ServiceAccount object. */
207
+ serviceAccountAnnotations?: Record<string, string>;
208
+ /** Serializable state persisted on the workload's attributes. */
209
+ state: IdentityState | undefined;
210
+ }
211
+ export interface WorkloadIdentityDeleteOptions {
212
+ /** The persisted cluster connection (may reference a gone cluster). */
213
+ connection: Connection | undefined;
214
+ /**
215
+ * The persisted identity state. Untyped because legacy pre-rename rows
216
+ * carry the old flat attribute shape — adapters narrow structurally.
217
+ */
218
+ state: Record<string, unknown> | undefined;
219
+ }
220
+ export interface ImageRegistryResolveOptions {
221
+ /** Logical resource id — keys generated repository names. */
222
+ id: string;
223
+ /** The image-source props bag. */
224
+ source: WorkloadImageSource;
225
+ /** Target image platform (`linux/amd64` / `linux/arm64`). */
226
+ platform: string;
227
+ /** Port the generated Dockerfile exposes (`main` sources only). */
228
+ port?: number;
229
+ /** True when `main` bundles as-is (no Effect bootstrap entry). */
230
+ isExternal?: boolean;
231
+ /** The generated-entry bootstrap wrapped around `main`. */
232
+ bootstrap: (importPath: string) => string;
233
+ /** Tags for registry-owned cloud resources. */
234
+ tags: Record<string, string>;
235
+ /**
236
+ * Previously persisted registry state, if any — untyped hints because
237
+ * legacy pre-rename rows carry the old flat attribute shape; adapters
238
+ * narrow structurally.
239
+ */
240
+ state: Record<string, unknown> | undefined;
241
+ /** Plan-status session for build/push progress notes. */
242
+ session: {
243
+ note: (message: string) => Effect.Effect<void>;
244
+ };
245
+ }
246
+ export interface ImageRegistryResult {
247
+ /** Full image reference the pod spec should run. */
248
+ imageUri: string;
249
+ /** Content hash identifying the image. */
250
+ codeHash: string;
251
+ /** Serializable state persisted on the workload's attributes. */
252
+ state: RegistryState | undefined;
253
+ }
254
+ export interface ImageRegistryHashOptions {
255
+ source: WorkloadImageSource;
256
+ platform: string;
257
+ port?: number;
258
+ isExternal?: boolean;
259
+ bootstrap: (importPath: string) => string;
260
+ }
261
+ export interface ImageRegistryDeleteOptions {
262
+ /**
263
+ * The persisted registry state. Untyped because legacy pre-rename rows
264
+ * carry the old flat attribute shape — adapters narrow structurally.
265
+ */
266
+ state: Record<string, unknown> | undefined;
267
+ }
268
+ export interface ClusterAdapterService {
269
+ readonly kind: "Kubernetes.ClusterAdapter";
270
+ /**
271
+ * Resolve the transport for a connection: discover the endpoint/CA when
272
+ * the connection doesn't carry them, and return a per-request auth
273
+ * header mint. Fails with {@link ClusterNotFoundError} when the cluster
274
+ * definitively no longer exists.
275
+ */
276
+ readonly connect: (connection: Connection) => Effect.Effect<ClusterTransport, ClusterNotFoundError | Error>;
277
+ /** Workload identity provisioning (Pod Identity on EKS, Workload Identity Federation on GKE). */
278
+ readonly identity?: {
279
+ readonly reconcile: (options: WorkloadIdentityReconcileOptions) => Effect.Effect<WorkloadIdentityResult, any, AdapterLifecycleServices>;
280
+ readonly delete: (options: WorkloadIdentityDeleteOptions) => Effect.Effect<void, any, AdapterLifecycleServices>;
281
+ };
282
+ /** Managed container-image registry (ECR on EKS, Artifact Registry on GKE). */
283
+ readonly registry?: {
284
+ readonly resolve: (options: ImageRegistryResolveOptions) => Effect.Effect<ImageRegistryResult, any, AdapterLifecycleServices>;
285
+ /** Plan-time content hash used by `diff` to surface source drift. */
286
+ readonly hash: (options: ImageRegistryHashOptions) => Effect.Effect<string | undefined, any, AdapterLifecycleServices>;
287
+ readonly delete: (options: ImageRegistryDeleteOptions) => Effect.Effect<void, any, AdapterLifecycleServices>;
288
+ };
289
+ /**
290
+ * Platform-specific generated container entries for Effect-native
291
+ * workloads. Defaults to the platform-neutral bootstraps when omitted.
292
+ */
293
+ readonly bootstrap?: {
294
+ readonly server?: (handler: string) => (importPath: string) => string;
295
+ readonly job?: (handler: string) => (importPath: string) => string;
296
+ };
297
+ /**
298
+ * Platform defaults applied to a `LoadBalancer` Service (EKS Auto Mode
299
+ * sets `loadBalancerClass: eks.amazonaws.com/nlb` and defaults the
300
+ * scheme to internet-facing). User `serviceAnnotations` always win.
301
+ */
302
+ readonly loadBalancerDefaults?: (options: {
303
+ connection: Connection;
304
+ }) => Effect.Effect<{
305
+ loadBalancerClass?: string | undefined;
306
+ annotations?: Record<string, string>;
307
+ }, any, AdapterLifecycleServices>;
308
+ }
309
+ /**
310
+ * The keyed Context tag for an adapter. Same auth kind → same tag, so a
311
+ * layer built with `ClusterAdapter("aws-eks")` is found by any dynamic
312
+ * lookup for that kind.
313
+ */
314
+ export declare const ClusterAdapter: (authKind: string) => Context.Service<ClusterAdapterService, ClusterAdapterService>;
315
+ /**
316
+ * Resolve the {@link ClusterAdapterService} for a connection's auth kind
317
+ * from the ambient context (the stack's composed provider layers). Dies
318
+ * with setup guidance when no adapter is registered — that means the
319
+ * provider layer contributing it (e.g. `AWS.providers()` for `aws-eks`)
320
+ * is missing from the stack.
321
+ */
322
+ export declare const findClusterAdapter: (authKind: string) => Effect.Effect<ClusterAdapterService>;
323
+ export {};
324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