@celljs/ta-gateway 4.16.0 → 4.18.0

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 (65) hide show
  1. package/README.en.md +5 -2
  2. package/README.md +5 -2
  3. package/esm/node/docker-engine.d.ts +5 -1
  4. package/esm/node/docker-engine.js +7 -1
  5. package/esm/node/docker-sandbox.d.ts +10 -1
  6. package/esm/node/docker-sandbox.js +24 -5
  7. package/esm/node/egress-proxy.d.ts +98 -0
  8. package/esm/node/egress-proxy.js +428 -0
  9. package/esm/node/environments.d.ts +5 -2
  10. package/esm/node/environments.js +4 -2
  11. package/esm/node/gateway-cli.js +13 -6
  12. package/esm/node/gateway-policy.d.ts +6 -1
  13. package/esm/node/gateway-policy.js +10 -1
  14. package/esm/node/gateway-quotas.d.ts +6 -1
  15. package/esm/node/gateway-quotas.js +17 -0
  16. package/esm/node/gateway-server.d.ts +35 -1
  17. package/esm/node/gateway-server.js +150 -16
  18. package/esm/node/gateway-service-util.d.ts +41 -0
  19. package/esm/node/gateway-service-util.js +178 -0
  20. package/esm/node/gateway-service.d.ts +5 -41
  21. package/esm/node/gateway-service.js +19 -173
  22. package/esm/node/gateway-socket.d.ts +1 -1
  23. package/esm/node/gateway-socket.js +1 -1
  24. package/esm/node/index.d.ts +4 -0
  25. package/esm/node/index.js +4 -0
  26. package/esm/node/kubernetes-api.d.ts +35 -0
  27. package/esm/node/kubernetes-api.js +115 -0
  28. package/esm/node/kubernetes-sandbox.d.ts +198 -0
  29. package/esm/node/kubernetes-sandbox.js +279 -0
  30. package/esm/node/sandbox-provider.d.ts +11 -1
  31. package/esm/node/sandbox-provider.js +2 -1
  32. package/esm/node/tenant-store.d.ts +15 -0
  33. package/esm/node/tenant-store.js +15 -0
  34. package/lib/node/docker-engine.d.ts +5 -1
  35. package/lib/node/docker-engine.js +7 -1
  36. package/lib/node/docker-sandbox.d.ts +10 -1
  37. package/lib/node/docker-sandbox.js +24 -5
  38. package/lib/node/egress-proxy.d.ts +99 -0
  39. package/lib/node/egress-proxy.js +433 -0
  40. package/lib/node/environments.d.ts +5 -2
  41. package/lib/node/environments.js +4 -2
  42. package/lib/node/gateway-cli.js +13 -6
  43. package/lib/node/gateway-policy.d.ts +6 -1
  44. package/lib/node/gateway-policy.js +10 -1
  45. package/lib/node/gateway-quotas.d.ts +6 -1
  46. package/lib/node/gateway-quotas.js +17 -0
  47. package/lib/node/gateway-server.d.ts +35 -1
  48. package/lib/node/gateway-server.js +148 -14
  49. package/lib/node/gateway-service-util.d.ts +42 -0
  50. package/lib/node/gateway-service-util.js +182 -0
  51. package/lib/node/gateway-service.d.ts +5 -41
  52. package/lib/node/gateway-service.js +41 -196
  53. package/lib/node/gateway-socket.d.ts +1 -1
  54. package/lib/node/gateway-socket.js +10 -10
  55. package/lib/node/index.d.ts +4 -0
  56. package/lib/node/index.js +4 -0
  57. package/lib/node/kubernetes-api.d.ts +36 -0
  58. package/lib/node/kubernetes-api.js +120 -0
  59. package/lib/node/kubernetes-sandbox.d.ts +199 -0
  60. package/lib/node/kubernetes-sandbox.js +283 -0
  61. package/lib/node/sandbox-provider.d.ts +11 -1
  62. package/lib/node/sandbox-provider.js +2 -1
  63. package/lib/node/tenant-store.d.ts +15 -0
  64. package/lib/node/tenant-store.js +15 -0
  65. package/package.json +4 -4
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GatewaySocket = void 0;
4
4
  const ta_protocol_1 = require("@celljs/ta-protocol");
5
- const gateway_service_1 = require("./gateway-service");
5
+ const gateway_service_util_1 = require("./gateway-service-util");
6
6
  /** What a browser sends before the Ta of its tenant answers, at most: then it is cut off, to connect again. */
7
7
  const MAX_QUEUED = 256;
8
8
  /** And as many bytes at most: a message may be 32 MB, and 256 of them would hold the gateway's memory for one browser. */
@@ -90,11 +90,11 @@ class GatewaySocket {
90
90
  this.close(1008, 'Too many messages.');
91
91
  return;
92
92
  }
93
- if (this.failure === undefined && gateway_service_1.GatewayServiceUtil.mayPrompt(text) && !this.admitPrompt(text)) {
93
+ if (this.failure === undefined && gateway_service_util_1.GatewayServiceUtil.mayPrompt(text) && !this.admitPrompt(text)) {
94
94
  return;
95
95
  }
96
96
  // Most messages are the Ta's, some large (pictures): forwarded without being read.
97
- if (this.failure === undefined && !gateway_service_1.GatewayServiceUtil.mayOwn(text)) {
97
+ if (this.failure === undefined && !gateway_service_util_1.GatewayServiceUtil.mayOwn(text)) {
98
98
  this.forward(text);
99
99
  return;
100
100
  }
@@ -106,13 +106,13 @@ class GatewaySocket {
106
106
  this.close(1007, 'Not JSON.');
107
107
  return;
108
108
  }
109
- if (gateway_service_1.GatewayServiceUtil.owns(message.method)) {
109
+ if (gateway_service_util_1.GatewayServiceUtil.owns(message.method)) {
110
110
  void this.answer(message.id, message.method, Array.isArray(message.params) ? message.params : []);
111
111
  return;
112
112
  }
113
113
  if (this.failure !== undefined) {
114
114
  if (message.method !== undefined && message.id !== undefined) {
115
- this.browser.send(gateway_service_1.GatewayServiceUtil.error(message.id, `Your environment did not start: ${this.failure}`, ta_protocol_1.TaErrorCode.ENVIRONMENT_FAILED, 'Restart it, or pick another (TaGatewayServer).'));
115
+ this.browser.send(gateway_service_util_1.GatewayServiceUtil.error(message.id, `Your environment did not start: ${this.failure}`, ta_protocol_1.TaErrorCode.ENVIRONMENT_FAILED, 'Restart it, or pick another (TaGatewayServer).'));
116
116
  }
117
117
  return;
118
118
  }
@@ -127,7 +127,7 @@ class GatewaySocket {
127
127
  catch (_a) {
128
128
  return true;
129
129
  }
130
- if (typeof message.method !== 'string' || !gateway_service_1.GatewayServiceUtil.PROMPTS.includes(message.method) || !this.quotas) {
130
+ if (typeof message.method !== 'string' || !gateway_service_util_1.GatewayServiceUtil.PROMPTS.includes(message.method) || !this.quotas) {
131
131
  return true;
132
132
  }
133
133
  if (this.quotas.takePrompt(this.caller.tenant)) {
@@ -135,7 +135,7 @@ class GatewaySocket {
135
135
  }
136
136
  const seconds = Math.ceil(this.quotas.retryAfter(this.caller.tenant) / 1000);
137
137
  if (message.id !== undefined) {
138
- this.browser.send(gateway_service_1.GatewayServiceUtil.error(message.id, `You sent as many messages this minute as your account may (${this.quotas.limits(this.caller.tenant).promptsPerMinute}).`, ta_protocol_1.TaErrorCode.RATE_LIMITED, `Send it again in ${seconds} s.`));
138
+ this.browser.send(gateway_service_util_1.GatewayServiceUtil.error(message.id, `You sent as many messages this minute as your account may (${this.quotas.limits(this.caller.tenant).promptsPerMinute}).`, ta_protocol_1.TaErrorCode.RATE_LIMITED, `Send it again in ${seconds} s.`));
139
139
  }
140
140
  return false;
141
141
  }
@@ -156,11 +156,11 @@ class GatewaySocket {
156
156
  let reply;
157
157
  this.answering++;
158
158
  try {
159
- reply = gateway_service_1.GatewayServiceUtil.result(id, await this.service.call(this.caller, method, params));
159
+ reply = gateway_service_util_1.GatewayServiceUtil.result(id, await this.service.call(this.caller, method, params));
160
160
  }
161
161
  catch (error) {
162
- const known = error instanceof gateway_service_1.GatewayCallError;
163
- reply = gateway_service_1.GatewayServiceUtil.error(id, error.message, known ? error.code : ta_protocol_1.TaErrorCode.COMMAND_FAILED, known ? error.hint : 'The gateway could not do it; try again.');
162
+ const known = error instanceof gateway_service_util_1.GatewayCallError;
163
+ reply = gateway_service_util_1.GatewayServiceUtil.error(id, error.message, known ? error.code : ta_protocol_1.TaErrorCode.COMMAND_FAILED, known ? error.hint : 'The gateway could not do it; try again.');
164
164
  }
165
165
  this.answering--;
166
166
  if (id !== undefined && this.browser.open) {
@@ -1,11 +1,15 @@
1
1
  export * from './command-sandbox';
2
2
  export * from './docker-engine';
3
3
  export * from './docker-sandbox';
4
+ export * from './egress-proxy';
4
5
  export * from './environments';
5
6
  export * from './gateway-cli';
6
7
  export * from './gateway-server';
7
8
  export * from './gateway-service';
9
+ export * from './gateway-service-util';
8
10
  export * from './gateway-socket';
11
+ export * from './kubernetes-api';
12
+ export * from './kubernetes-sandbox';
9
13
  export * from './local-sandbox';
10
14
  export * from './sandbox-provider';
11
15
  export * from './sign-in-links';
package/lib/node/index.js CHANGED
@@ -17,11 +17,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./command-sandbox"), exports);
18
18
  __exportStar(require("./docker-engine"), exports);
19
19
  __exportStar(require("./docker-sandbox"), exports);
20
+ __exportStar(require("./egress-proxy"), exports);
20
21
  __exportStar(require("./environments"), exports);
21
22
  __exportStar(require("./gateway-cli"), exports);
22
23
  __exportStar(require("./gateway-server"), exports);
23
24
  __exportStar(require("./gateway-service"), exports);
25
+ __exportStar(require("./gateway-service-util"), exports);
24
26
  __exportStar(require("./gateway-socket"), exports);
27
+ __exportStar(require("./kubernetes-api"), exports);
28
+ __exportStar(require("./kubernetes-sandbox"), exports);
25
29
  __exportStar(require("./local-sandbox"), exports);
26
30
  __exportStar(require("./sandbox-provider"), exports);
27
31
  __exportStar(require("./sign-in-links"), exports);
@@ -0,0 +1,36 @@
1
+ export declare class KubernetesError extends Error {
2
+ readonly status: number;
3
+ constructor(status: number, message: string);
4
+ }
5
+ /** The calls a provider makes: a JSON body or text back; KubernetesError for an answer not 2xx. */
6
+ export interface KubernetesCalls {
7
+ call<T = unknown>(method: string, path: string, body?: unknown, type?: string): Promise<T>;
8
+ text(path: string): Promise<string>;
9
+ }
10
+ export interface KubernetesApiOptions {
11
+ /** https://<host>:<port> of the API server. */
12
+ server: string;
13
+ token?: string;
14
+ /** The CA of the server, PEM. */
15
+ ca?: string;
16
+ }
17
+ /**
18
+ * The API of a cluster over HTTPS, without a client library: what a provider of sandboxes needs is a few
19
+ * resources by their paths.
20
+ */
21
+ export declare class KubernetesApi implements KubernetesCalls {
22
+ protected readonly options: KubernetesApiOptions;
23
+ /** In a pod of the cluster: its service account, and the namespace it runs in. */
24
+ static inCluster(env?: Record<string, string | undefined>, read?: (path: string) => string): KubernetesApiOptions & {
25
+ namespace: string;
26
+ };
27
+ constructor(options: KubernetesApiOptions);
28
+ call<T = unknown>(method: string, path: string, body?: unknown, type?: string): Promise<T>;
29
+ text(path: string): Promise<string>;
30
+ protected send(method: string, path: string, body?: string, type?: string): Promise<string>;
31
+ }
32
+ export declare namespace KubernetesUtil {
33
+ /** A quantity of Kubernetes (`4Gi`, `500M`, `250m`, `123456n`) as a number of its unit (bytes, CPUs). */
34
+ function quantity(value: string | number | undefined): number | undefined;
35
+ }
36
+ //# sourceMappingURL=kubernetes-api.d.ts.map
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KubernetesUtil = exports.KubernetesApi = exports.KubernetesError = void 0;
4
+ const node_fs_1 = require("node:fs");
5
+ const node_http_1 = require("node:http");
6
+ const node_https_1 = require("node:https");
7
+ /** Where a pod finds the API of its cluster: its service account's token, CA and namespace. */
8
+ const ACCOUNT = '/var/run/secrets/kubernetes.io/serviceaccount';
9
+ class KubernetesError extends Error {
10
+ constructor(status, message) {
11
+ super(message);
12
+ this.status = status;
13
+ }
14
+ }
15
+ exports.KubernetesError = KubernetesError;
16
+ /**
17
+ * The API of a cluster over HTTPS, without a client library: what a provider of sandboxes needs is a few
18
+ * resources by their paths.
19
+ */
20
+ class KubernetesApi {
21
+ /** In a pod of the cluster: its service account, and the namespace it runs in. */
22
+ static inCluster(env = process.env, read = (path) => (0, node_fs_1.readFileSync)(path, 'utf8')) {
23
+ var _a;
24
+ const host = env.KUBERNETES_SERVICE_HOST;
25
+ if (!host) {
26
+ throw new Error('Not in a pod of Kubernetes (no KUBERNETES_SERVICE_HOST): give "server" and "token" of the cluster.');
27
+ }
28
+ const port = (_a = env.KUBERNETES_SERVICE_PORT) !== null && _a !== void 0 ? _a : '443';
29
+ return {
30
+ server: `https://${host.includes(':') ? `[${host}]` : host}:${port}`,
31
+ token: read(`${ACCOUNT}/token`).trim(),
32
+ ca: read(`${ACCOUNT}/ca.crt`),
33
+ namespace: read(`${ACCOUNT}/namespace`).trim(),
34
+ };
35
+ }
36
+ constructor(options) {
37
+ this.options = options;
38
+ }
39
+ async call(method, path, body, type = 'application/json') {
40
+ const text = await this.send(method, path, body === undefined ? undefined : JSON.stringify(body), type);
41
+ return (text ? JSON.parse(text) : undefined);
42
+ }
43
+ text(path) {
44
+ return this.send('GET', path);
45
+ }
46
+ send(method, path, body, type) {
47
+ const url = new URL(path, this.options.server);
48
+ const options = {
49
+ method,
50
+ headers: {
51
+ accept: 'application/json, */*',
52
+ ...(this.options.token ? { authorization: `Bearer ${this.options.token}` } : {}),
53
+ ...(body !== undefined ? { 'content-type': type !== null && type !== void 0 ? type : 'application/json', 'content-length': Buffer.byteLength(body) } : {}),
54
+ },
55
+ ...(this.options.ca ? { ca: this.options.ca } : {}),
56
+ timeout: 30000,
57
+ };
58
+ const send = url.protocol === 'https:' ? node_https_1.request : node_http_1.request;
59
+ return new Promise((resolve, reject) => {
60
+ const request = send(url, options, response => {
61
+ const chunks = [];
62
+ response.on('data', chunk => chunks.push(chunk));
63
+ response.on('end', () => {
64
+ var _a, _b;
65
+ const text = Buffer.concat(chunks).toString('utf8');
66
+ const status = (_a = response.statusCode) !== null && _a !== void 0 ? _a : 0;
67
+ if (status >= 200 && status < 300) {
68
+ resolve(text);
69
+ return;
70
+ }
71
+ let message = text.slice(0, 300);
72
+ try {
73
+ message = (_b = JSON.parse(text).message) !== null && _b !== void 0 ? _b : message;
74
+ }
75
+ catch (_c) {
76
+ // Not JSON.
77
+ }
78
+ reject(new KubernetesError(status, `${method} ${url.pathname}: ${status} ${message}`));
79
+ });
80
+ response.on('error', reject);
81
+ });
82
+ request.on('timeout', () => request.destroy(new Error(`${method} ${url.pathname}: no answer in time`)));
83
+ request.on('error', reject);
84
+ request.end(body);
85
+ });
86
+ }
87
+ }
88
+ exports.KubernetesApi = KubernetesApi;
89
+ var KubernetesUtil;
90
+ (function (KubernetesUtil) {
91
+ /** A quantity of Kubernetes (`4Gi`, `500M`, `250m`, `123456n`) as a number of its unit (bytes, CPUs). */
92
+ function quantity(value) {
93
+ if (typeof value === 'number') {
94
+ return value;
95
+ }
96
+ const match = /^([0-9.]+)([a-zA-Z]*)$/.exec(String(value !== null && value !== void 0 ? value : '').trim());
97
+ if (!match) {
98
+ return undefined;
99
+ }
100
+ const scale = {
101
+ '': 1,
102
+ n: 1e-9,
103
+ u: 1e-6,
104
+ m: 1e-3,
105
+ k: 1e3,
106
+ K: 1e3,
107
+ M: 1e6,
108
+ G: 1e9,
109
+ T: 1e12,
110
+ Ki: 2 ** 10,
111
+ Mi: 2 ** 20,
112
+ Gi: 2 ** 30,
113
+ Ti: 2 ** 40,
114
+ };
115
+ const factor = scale[match[2]];
116
+ return factor === undefined ? undefined : Number(match[1]) * factor;
117
+ }
118
+ KubernetesUtil.quantity = quantity;
119
+ })(KubernetesUtil || (exports.KubernetesUtil = KubernetesUtil = {}));
120
+ //# sourceMappingURL=kubernetes-api.js.map
@@ -0,0 +1,199 @@
1
+ import { KubernetesApi, type KubernetesCalls } from './kubernetes-api';
2
+ import { type SandboxEndpoint, type SandboxProvider, type SandboxProviderConfig, type SandboxState, type SandboxTenant, type SandboxUsage } from './sandbox-provider';
3
+ export interface KubernetesSandboxOptions {
4
+ image: string;
5
+ imagePullPolicy?: string;
6
+ namespace: string;
7
+ /** Each sandbox at most: a quantity of memory (`4Gi`), CPUs. */
8
+ memory: string;
9
+ cpus: number;
10
+ /** The volume of its home: its size, and the class of storage (the cluster's default without one). */
11
+ storage: string;
12
+ storageClass?: string;
13
+ /** gVisor, Kata: the isolation of the cluster's choice, a RuntimeClass. */
14
+ runtimeClass?: string;
15
+ /** Names of the Sandbox and its Secret: `<prefix><tenant>`. */
16
+ prefix: string;
17
+ /** More of the environment of every sandbox. */
18
+ env: Record<string, string>;
19
+ nodeSelector?: Record<string, string>;
20
+ imagePullSecrets?: string[];
21
+ /** The domain of the cluster's services, for the address of a sandbox. */
22
+ clusterDomain: string;
23
+ }
24
+ /** What the API answers of a Sandbox, as far as the provider reads it. */
25
+ interface SandboxObject {
26
+ metadata: {
27
+ name: string;
28
+ uid?: string;
29
+ annotations?: Record<string, string>;
30
+ };
31
+ spec: {
32
+ operatingMode?: 'Running' | 'Suspended';
33
+ };
34
+ status?: {
35
+ serviceFQDN?: string;
36
+ conditions?: {
37
+ type: string;
38
+ status: string;
39
+ reason?: string;
40
+ message?: string;
41
+ }[];
42
+ };
43
+ }
44
+ export declare namespace KubernetesSandboxUtil {
45
+ /** The annotation of a Sandbox and its pod that tells the environment the gateway gave it (as `cell.ta.env` of docker). */
46
+ const ENV_ANNOTATION = "cell.ta/env";
47
+ const COMPONENT = "ta-sandbox";
48
+ function options(config: SandboxProviderConfig, inCluster?: () => {
49
+ namespace: string;
50
+ }): KubernetesSandboxOptions;
51
+ /** The API: `server` and `token` (`$NAME`: of the gateway's environment) of the configuration, else the pod's own. */
52
+ function api(config: SandboxProviderConfig, env?: Record<string, string | undefined>): KubernetesApi;
53
+ function ready(sandbox: SandboxObject | undefined): boolean;
54
+ }
55
+ /**
56
+ * `kubernetes`: a Sandbox of kubernetes-sigs/agent-sandbox per tenant (docs/design/ta-deploy.md 6): a pod of ta serve,
57
+ * its home in a volume of its own that stays while it is suspended, a headless Service for a stable address. Stopping
58
+ * suspends it (the pod goes, the volume stays); its token and the environment of the gateway are in a Secret of its
59
+ * own, not in the Sandbox, which more people may read.
60
+ */
61
+ export declare class KubernetesSandbox implements SandboxProvider {
62
+ readonly id: string;
63
+ protected readonly options: KubernetesSandboxOptions;
64
+ readonly type = "kubernetes";
65
+ readonly name: string;
66
+ readonly gatewayUrl?: string;
67
+ /** A first pull of the image and a volume to bind take longer than a container. */
68
+ readonly readyTimeoutMs: number;
69
+ protected readonly api: KubernetesCalls;
70
+ constructor(id: string, config: SandboxProviderConfig, api?: KubernetesCalls, options?: KubernetesSandboxOptions);
71
+ start(tenant: SandboxTenant): Promise<SandboxEndpoint>;
72
+ stop(tenant: SandboxTenant): Promise<void>;
73
+ state(tenant: SandboxTenant): Promise<SandboxState>;
74
+ /** From metrics.k8s.io, when the cluster has metrics-server. */
75
+ usage(tenant: SandboxTenant): Promise<SandboxUsage | undefined>;
76
+ logs(tenant: SandboxTenant, lines: number): Promise<string>;
77
+ /** The Sandbox of a tenant, as the API is given it. */
78
+ manifest(tenant: SandboxTenant): {
79
+ apiVersion: string;
80
+ kind: string;
81
+ metadata: {
82
+ name: string;
83
+ labels: {
84
+ 'app.kubernetes.io/name': string;
85
+ 'app.kubernetes.io/component': string;
86
+ 'cell.ta/tenant': string;
87
+ };
88
+ annotations: {
89
+ "cell.ta/env": string;
90
+ 'cell.ta/account': string;
91
+ };
92
+ };
93
+ spec: {
94
+ operatingMode: string;
95
+ service: boolean;
96
+ failedPodPolicy: string;
97
+ podTemplate: {
98
+ metadata: {
99
+ labels: {
100
+ 'app.kubernetes.io/name': string;
101
+ 'app.kubernetes.io/component': string;
102
+ 'cell.ta/tenant': string;
103
+ };
104
+ annotations: {
105
+ "cell.ta/env": string;
106
+ };
107
+ };
108
+ spec: {
109
+ automountServiceAccountToken: boolean;
110
+ enableServiceLinks: boolean;
111
+ hostname: string;
112
+ securityContext: {
113
+ runAsUser: number;
114
+ runAsGroup: number;
115
+ fsGroup: number;
116
+ seccompProfile: {
117
+ type: string;
118
+ };
119
+ };
120
+ runtimeClassName?: string | undefined;
121
+ nodeSelector?: Record<string, string> | undefined;
122
+ imagePullSecrets?: {
123
+ name: string;
124
+ }[] | undefined;
125
+ containers: {
126
+ name: string;
127
+ image: string;
128
+ imagePullPolicy?: string | undefined;
129
+ workingDir: string;
130
+ command: string[];
131
+ envFrom: {
132
+ secretRef: {
133
+ name: string;
134
+ };
135
+ }[];
136
+ ports: {
137
+ name: string;
138
+ containerPort: number;
139
+ }[];
140
+ resources: {
141
+ limits: {
142
+ memory: string;
143
+ cpu: string;
144
+ };
145
+ requests: {
146
+ memory: string;
147
+ cpu: string;
148
+ };
149
+ };
150
+ securityContext: {
151
+ capabilities: {
152
+ drop: string[];
153
+ };
154
+ };
155
+ readinessProbe: {
156
+ httpGet: {
157
+ path: string;
158
+ port: number;
159
+ };
160
+ periodSeconds: number;
161
+ failureThreshold: number;
162
+ };
163
+ volumeMounts: {
164
+ name: string;
165
+ mountPath: string;
166
+ }[];
167
+ }[];
168
+ };
169
+ };
170
+ volumeClaimTemplates: {
171
+ metadata: {
172
+ name: string;
173
+ labels: {
174
+ 'app.kubernetes.io/name': string;
175
+ 'app.kubernetes.io/component': string;
176
+ 'cell.ta/tenant': string;
177
+ };
178
+ };
179
+ spec: {
180
+ accessModes: string[];
181
+ resources: {
182
+ requests: {
183
+ storage: string;
184
+ };
185
+ };
186
+ storageClassName?: string | undefined;
187
+ };
188
+ }[];
189
+ };
190
+ };
191
+ /** Its token and the environment of the gateway, owned by its Sandbox, which takes it along when it goes. */
192
+ protected putSecret(tenant: SandboxTenant, sandbox: SandboxObject): Promise<void>;
193
+ protected deletePod(name: string): Promise<void>;
194
+ protected read(name: string): Promise<SandboxObject | undefined>;
195
+ protected path(name?: string): string;
196
+ protected resourceName(tenant: SandboxTenant): string;
197
+ }
198
+ export {};
199
+ //# sourceMappingURL=kubernetes-sandbox.d.ts.map