@highstate/k8s 0.4.5
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/index.d.ts +676 -0
- package/dist/index.js +950 -0
- package/dist/shared-hajqPzR4.js +64 -0
- package/dist/units/access-point/index.js +13 -0
- package/dist/units/cert-manager/index.js +34 -0
- package/dist/units/dns01-issuer/index.js +51 -0
- package/dist/units/existing-cluster/index.js +38 -0
- package/package.json +47 -0
package/dist/index.d.ts
ADDED
@@ -0,0 +1,676 @@
|
|
1
|
+
import { k8s } from '@highstate/library';
|
2
|
+
import { Input, Unwrap, Output, InputArray, ComponentResource, ComponentResourceOptions, Resource, ResourceOptions, InputMap } from '@highstate/pulumi';
|
3
|
+
import { Provider, core, types, apps, batch, helm } from '@pulumi/kubernetes';
|
4
|
+
import { gateway, types as types$1 } from '@highstate/gateway-api';
|
5
|
+
import { PartialKeys, RequiredKeys } from '@highstate/contract';
|
6
|
+
import { DnsRecord } from '@highstate/common';
|
7
|
+
import { Input as Input$1, ComponentResource as ComponentResource$1, Output as Output$1, ComponentResourceOptions as ComponentResourceOptions$1 } from '@pulumi/pulumi';
|
8
|
+
|
9
|
+
declare function createProvider(cluster: Input<k8s.Cluster>): Promise<Provider>;
|
10
|
+
declare function createNamespace(name: string, provider: Provider, args?: core.v1.NamespaceArgs): core.v1.Namespace;
|
11
|
+
type NamespaceLike = core.v1.Namespace | string;
|
12
|
+
type CommonArgs = {
|
13
|
+
/**
|
14
|
+
* The name of the resource.
|
15
|
+
*/
|
16
|
+
name?: string;
|
17
|
+
/**
|
18
|
+
* The namespace to create the resource in.
|
19
|
+
*/
|
20
|
+
namespace?: Input<NamespaceLike>;
|
21
|
+
/**
|
22
|
+
* The metadata to apply to the resource.
|
23
|
+
*/
|
24
|
+
metadata?: Input<types.input.meta.v1.ObjectMeta>;
|
25
|
+
};
|
26
|
+
declare function mapMetadata(args: Unwrap<CommonArgs>, fallbackName?: string): types.input.meta.v1.ObjectMeta;
|
27
|
+
declare function resolveChartPath(packageName: string, chartName: string, parent: string): string;
|
28
|
+
type SelectorLike = types.input.meta.v1.LabelSelector | Record<string, Input<string>>;
|
29
|
+
declare function mapSelectorLikeToSelector(selector: SelectorLike): types.input.meta.v1.LabelSelector;
|
30
|
+
declare function mapNamespaceLikeToNamespaceName(namespace: NamespaceLike): Output<string>;
|
31
|
+
declare function mapNamespaceNameToSelector(namespace: Input<string>): types.input.meta.v1.LabelSelector;
|
32
|
+
|
33
|
+
interface FullBackendRef {
|
34
|
+
/**
|
35
|
+
* The name of the resource being referenced.
|
36
|
+
*/
|
37
|
+
name: Input<string>;
|
38
|
+
/**
|
39
|
+
* The namespace of the resource being referenced.
|
40
|
+
* May be undefined if the resource is not in a namespace.
|
41
|
+
*/
|
42
|
+
namespace?: Input<string | undefined>;
|
43
|
+
/**
|
44
|
+
* The port of the resource being referenced.
|
45
|
+
*/
|
46
|
+
port: Input<number>;
|
47
|
+
}
|
48
|
+
interface ServiceBackendRef {
|
49
|
+
/**
|
50
|
+
* The name of the service being referenced.
|
51
|
+
*/
|
52
|
+
service: Input<core.v1.Service>;
|
53
|
+
/**
|
54
|
+
* The port of the service being referenced.
|
55
|
+
*/
|
56
|
+
port: Input<number> | Input<string>;
|
57
|
+
}
|
58
|
+
type BackendRef = FullBackendRef | ServiceBackendRef | core.v1.Service;
|
59
|
+
|
60
|
+
type HttpRouteArgs = Omit<CommonArgs, "namespace"> & {
|
61
|
+
/**
|
62
|
+
* The gateway to associate with the route.
|
63
|
+
*/
|
64
|
+
gateway: Input<gateway.v1.Gateway>;
|
65
|
+
/**
|
66
|
+
* The alias for `hostnames: [hostname]`.
|
67
|
+
*/
|
68
|
+
hostname?: Input<string>;
|
69
|
+
/**
|
70
|
+
* The rule of the route.
|
71
|
+
*/
|
72
|
+
rule?: Input<HttpRouteRuleArgs>;
|
73
|
+
/**
|
74
|
+
* The rules of the route.
|
75
|
+
*/
|
76
|
+
rules?: InputArray<HttpRouteRuleArgs>;
|
77
|
+
} & Omit<Partial<types$1.input.gateway.v1.HTTPRouteSpec>, "rules">;
|
78
|
+
type HttpRouteRuleArgs = Omit<types$1.input.gateway.v1.HTTPRouteSpecRules, "matches" | "filters" | "backendRefs"> & {
|
79
|
+
/**
|
80
|
+
* The conditions of the rule.
|
81
|
+
* Can be specified as string to match on the path.
|
82
|
+
*/
|
83
|
+
matches?: InputArray<HttpRouteRuleMatchOptions>;
|
84
|
+
/**
|
85
|
+
* The condition of the rule.
|
86
|
+
* Can be specified as string to match on the path.
|
87
|
+
*/
|
88
|
+
match?: Input<HttpRouteRuleMatchOptions>;
|
89
|
+
/**
|
90
|
+
* The filters of the rule.
|
91
|
+
*/
|
92
|
+
filters?: InputArray<types$1.input.gateway.v1.HTTPRouteSpecRulesFilters>;
|
93
|
+
/**
|
94
|
+
* The filter of the rule.
|
95
|
+
*/
|
96
|
+
filter?: Input<types$1.input.gateway.v1.HTTPRouteSpecRulesFilters>;
|
97
|
+
/**
|
98
|
+
* The service to route to.
|
99
|
+
*/
|
100
|
+
backend?: Input<BackendRef>;
|
101
|
+
};
|
102
|
+
type HttpRouteRuleMatchOptions = types$1.input.gateway.v1.HTTPRouteSpecRulesMatches | string;
|
103
|
+
declare class HttpRoute extends ComponentResource {
|
104
|
+
/**
|
105
|
+
* The underlying Kubernetes resource.
|
106
|
+
*/
|
107
|
+
readonly route: Output<gateway.v1.HTTPRoute>;
|
108
|
+
constructor(name: string, args: HttpRouteArgs, opts?: ComponentResourceOptions);
|
109
|
+
}
|
110
|
+
|
111
|
+
type ServiceArgs = CommonArgs & {
|
112
|
+
port?: Input<types.input.core.v1.ServicePort>;
|
113
|
+
} & types.input.core.v1.ServiceSpec;
|
114
|
+
declare class Service extends ComponentResource {
|
115
|
+
/**
|
116
|
+
* The underlying Kubernetes service.
|
117
|
+
*/
|
118
|
+
readonly service: Output<core.v1.Service>;
|
119
|
+
constructor(name: string, args: ServiceArgs, opts?: ComponentResourceOptions);
|
120
|
+
}
|
121
|
+
declare function mapContainerPortToServicePort(port: types.input.core.v1.ContainerPort): types.input.core.v1.ServicePort;
|
122
|
+
declare function mapServiceToLabelSelector(service: core.v1.Service): types.input.meta.v1.LabelSelector;
|
123
|
+
declare function getServiceHost(service: core.v1.Service): Output<string>;
|
124
|
+
|
125
|
+
type Container = Omit<PartialKeys<types.input.core.v1.Container, "name">, "volumeMounts"> & {
|
126
|
+
/**
|
127
|
+
* The single port to add to the container.
|
128
|
+
*/
|
129
|
+
port?: Input<types.input.core.v1.ContainerPort>;
|
130
|
+
/**
|
131
|
+
* The volume mount to attach to the container.
|
132
|
+
*/
|
133
|
+
volumeMount?: Input<ContainerVolumeMount>;
|
134
|
+
/**
|
135
|
+
* The volume mounts to attach to the container.
|
136
|
+
*/
|
137
|
+
volumeMounts?: InputArray<ContainerVolumeMount>;
|
138
|
+
/**
|
139
|
+
* The volume to include in the parent workload.
|
140
|
+
* It is like the `volumes` property, but defined at the container level.
|
141
|
+
* It will be defined as a volume mount in the parent workload automatically.
|
142
|
+
*/
|
143
|
+
volume?: Input<WorkloadVolume>;
|
144
|
+
/**
|
145
|
+
* The volumes to include in the parent workload.
|
146
|
+
* It is like the `volumes` property, but defined at the container level.
|
147
|
+
* It will be defined as a volume mount in the parent workload automatically.
|
148
|
+
*/
|
149
|
+
volumes?: InputArray<WorkloadVolume>;
|
150
|
+
/**
|
151
|
+
* The map of environment variables to set in the container.
|
152
|
+
* It is like the `env` property, but more convenient to use.
|
153
|
+
*/
|
154
|
+
environment?: Input<ContainerEnvironment>;
|
155
|
+
/**
|
156
|
+
* The source of environment variables to set in the container.
|
157
|
+
* It is like the `envFrom` property, but more convenient to use.
|
158
|
+
*/
|
159
|
+
environmentSource?: Input<ContainerEnvironmentSource>;
|
160
|
+
/**
|
161
|
+
* The sources of environment variables to set in the container.
|
162
|
+
* It is like the `envFrom` property, but more convenient to use.
|
163
|
+
*/
|
164
|
+
environmentSources?: InputArray<ContainerEnvironmentSource>;
|
165
|
+
};
|
166
|
+
type ContainerEnvironment = Record<string, Input<string | undefined | null | ContainerEnvironmentVariable>>;
|
167
|
+
type ContainerEnvironmentVariable = types.input.core.v1.EnvVarSource | {
|
168
|
+
/**
|
169
|
+
* The secret to select from.
|
170
|
+
*/
|
171
|
+
secret: Input<core.v1.Secret>;
|
172
|
+
/**
|
173
|
+
* The key of the secret to select from.
|
174
|
+
*/
|
175
|
+
key: string;
|
176
|
+
} | {
|
177
|
+
/**
|
178
|
+
* The config map to select from.
|
179
|
+
*/
|
180
|
+
configMap: Input<core.v1.ConfigMap>;
|
181
|
+
/**
|
182
|
+
* The key of the config map to select from.
|
183
|
+
*/
|
184
|
+
key: string;
|
185
|
+
};
|
186
|
+
type ContainerEnvironmentSource = types.input.core.v1.EnvFromSource | core.v1.ConfigMap | core.v1.Secret;
|
187
|
+
type ContainerVolumeMount = types.input.core.v1.VolumeMount | (Omit<types.input.core.v1.VolumeMount, "name"> & {
|
188
|
+
/**
|
189
|
+
* The volume to mount.
|
190
|
+
*/
|
191
|
+
volume: Input<WorkloadVolume>;
|
192
|
+
});
|
193
|
+
type WorkloadVolume = types.input.core.v1.Volume | core.v1.PersistentVolumeClaim | core.v1.ConfigMap | core.v1.Secret;
|
194
|
+
|
195
|
+
type DeploymentArgs = CommonArgs & {
|
196
|
+
container?: Input<Container>;
|
197
|
+
containers?: InputArray<Container>;
|
198
|
+
gateway?: Input<gateway.v1.Gateway>;
|
199
|
+
service?: Input<ServiceArgs>;
|
200
|
+
httpRoute?: Input<HttpRouteArgs>;
|
201
|
+
} & Omit<Partial<types.input.apps.v1.DeploymentSpec>, "template"> & {
|
202
|
+
template?: {
|
203
|
+
metadata?: types.input.meta.v1.ObjectMeta;
|
204
|
+
spec?: Partial<types.input.core.v1.PodSpec>;
|
205
|
+
};
|
206
|
+
};
|
207
|
+
declare class Deployment extends ComponentResource {
|
208
|
+
/**
|
209
|
+
* The underlying Kubernetes deployment.
|
210
|
+
*/
|
211
|
+
readonly deployment: Output<apps.v1.Deployment>;
|
212
|
+
/**
|
213
|
+
* The service associated with the deployment.
|
214
|
+
*/
|
215
|
+
readonly service: Output<Service | undefined>;
|
216
|
+
/**
|
217
|
+
* The HTTP route associated with the deployment.
|
218
|
+
*/
|
219
|
+
readonly httpRoute: Output<HttpRoute | undefined>;
|
220
|
+
constructor(name: string, args: DeploymentArgs, opts?: ComponentResourceOptions);
|
221
|
+
getRequiredService(): Output<Service>;
|
222
|
+
}
|
223
|
+
|
224
|
+
type PersistentVolumeClaimArgs = CommonArgs & types.input.core.v1.PersistentVolumeClaimSpec;
|
225
|
+
|
226
|
+
type StatefulSetArgs = CommonArgs & {
|
227
|
+
container?: Input<Container>;
|
228
|
+
containers?: InputArray<Container>;
|
229
|
+
volumeClaim?: Input<PersistentVolumeClaimArgs>;
|
230
|
+
volumeClaims?: InputArray<PersistentVolumeClaimArgs>;
|
231
|
+
service?: Input<ServiceArgs>;
|
232
|
+
} & Partial<types.input.apps.v1.StatefulSetSpec>;
|
233
|
+
declare class StatefulSet extends ComponentResource {
|
234
|
+
/**
|
235
|
+
* The underlying Kubernetes stateful set.
|
236
|
+
*/
|
237
|
+
readonly statefulSet: Output<apps.v1.StatefulSet>;
|
238
|
+
/**
|
239
|
+
* The service associated with the stateful set.
|
240
|
+
*/
|
241
|
+
readonly service: Output<Service>;
|
242
|
+
constructor(name: string, args: StatefulSetArgs, opts?: ComponentResourceOptions);
|
243
|
+
}
|
244
|
+
|
245
|
+
type NetworkPolicyPort = {
|
246
|
+
/**
|
247
|
+
* The protocol to match.
|
248
|
+
*
|
249
|
+
* If not provided, "TCP" will be used.
|
250
|
+
*/
|
251
|
+
protocol?: string;
|
252
|
+
} & ({
|
253
|
+
/**
|
254
|
+
* The single port to match.
|
255
|
+
*/
|
256
|
+
port: number;
|
257
|
+
} | {
|
258
|
+
/**
|
259
|
+
* The range of ports to match.
|
260
|
+
*/
|
261
|
+
range: [start: number, end: number];
|
262
|
+
});
|
263
|
+
type IngressRuleArgs = {
|
264
|
+
/**
|
265
|
+
* Whether to allow all incoming traffic.
|
266
|
+
*
|
267
|
+
* If set to `true`, all other rules will be ignored for matched traffic.
|
268
|
+
*/
|
269
|
+
fromAll?: Input<boolean>;
|
270
|
+
/**
|
271
|
+
* The allowed cidr for incoming traffic.
|
272
|
+
*
|
273
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
274
|
+
*/
|
275
|
+
fromCidr?: Input<string>;
|
276
|
+
/**
|
277
|
+
* The list of allowed cidrs for incoming traffic.
|
278
|
+
*
|
279
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
280
|
+
*/
|
281
|
+
fromCidrs?: InputArray<string>;
|
282
|
+
/**
|
283
|
+
* The service to allow traffic from.
|
284
|
+
*
|
285
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
286
|
+
*/
|
287
|
+
fromService?: Input<core.v1.Service>;
|
288
|
+
/**
|
289
|
+
* The list of allowed services for incoming traffic.
|
290
|
+
*
|
291
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
292
|
+
*/
|
293
|
+
fromServices?: InputArray<core.v1.Service>;
|
294
|
+
/**
|
295
|
+
* The namespace to allow traffic from.
|
296
|
+
*
|
297
|
+
* If provided with `fromSelector(s)`, it will be ANDed with them.
|
298
|
+
* Otherwise, it will match all pods in the namespace.
|
299
|
+
*
|
300
|
+
* Will be ORed with other conditions inside the same rule (except ports and selectors).
|
301
|
+
*/
|
302
|
+
fromNamespace?: Input<NamespaceLike>;
|
303
|
+
/**
|
304
|
+
* The list of allowed namespaces for incoming traffic.
|
305
|
+
*
|
306
|
+
* If provided with `fromSelector(s)`, it will be ANDed with them.
|
307
|
+
* Otherwise, it will match all pods in the namespaces.
|
308
|
+
*
|
309
|
+
* Will be ORed with other conditions inside the same rule (except ports and selectors).
|
310
|
+
*/
|
311
|
+
fromNamespaces?: InputArray<NamespaceLike>;
|
312
|
+
/**
|
313
|
+
* The selector for incoming traffic.
|
314
|
+
*
|
315
|
+
* If provided with `fromNamespace(s)`, it will be ANDed with them.
|
316
|
+
* Otherwise, it will match pods in all namespaces.
|
317
|
+
*
|
318
|
+
* Will be ORed with other conditions inside the same rule (except ports and namespaces).
|
319
|
+
*/
|
320
|
+
fromSelector?: Input<SelectorLike>;
|
321
|
+
/**
|
322
|
+
* The list of selectors for incoming traffic.
|
323
|
+
*
|
324
|
+
* If provided with `fromNamespace(s)`, it will be ANDed with them.
|
325
|
+
* Otherwise, it will match pods in all namespaces.
|
326
|
+
*
|
327
|
+
* Will be ORed with other conditions inside the same rule (except ports and namespaces).
|
328
|
+
*/
|
329
|
+
fromSelectors?: InputArray<SelectorLike>;
|
330
|
+
/**
|
331
|
+
* The port to allow incoming traffic on.
|
332
|
+
*
|
333
|
+
* Will be ANDed with all conditions inside the same rule.
|
334
|
+
*/
|
335
|
+
toPort?: Input<NetworkPolicyPort>;
|
336
|
+
/**
|
337
|
+
* The list of allowed ports for incoming traffic.
|
338
|
+
*
|
339
|
+
* Will be ANDed with all conditions inside the same rule.
|
340
|
+
*/
|
341
|
+
toPorts?: InputArray<NetworkPolicyPort>;
|
342
|
+
};
|
343
|
+
type EgressRuleArgs = {
|
344
|
+
/**
|
345
|
+
* Whether to allow all outgoing traffic.
|
346
|
+
*
|
347
|
+
* If set to `true`, all other rules will be ignored for matched traffic.
|
348
|
+
*/
|
349
|
+
toAll?: Input<boolean>;
|
350
|
+
/**
|
351
|
+
* The allowed cidr for outgoing traffic.
|
352
|
+
*
|
353
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
354
|
+
*/
|
355
|
+
toCidr?: Input<string>;
|
356
|
+
/**
|
357
|
+
* The list of allowed cidrs for outgoing traffic.
|
358
|
+
*
|
359
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
360
|
+
*/
|
361
|
+
toCidrs?: InputArray<string>;
|
362
|
+
/**
|
363
|
+
* the FQDN to allow outgoing traffic.
|
364
|
+
*
|
365
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
366
|
+
*/
|
367
|
+
toFqdn?: Input<string>;
|
368
|
+
/**
|
369
|
+
* The list of allowed FQDNs for outgoing traffic.
|
370
|
+
*
|
371
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
372
|
+
*/
|
373
|
+
toFqdns?: InputArray<string>;
|
374
|
+
/**
|
375
|
+
* The service to allow traffic to.
|
376
|
+
*
|
377
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
378
|
+
*/
|
379
|
+
toService?: Input<core.v1.Service>;
|
380
|
+
/**
|
381
|
+
* The list of allowed services for outgoing traffic.
|
382
|
+
*
|
383
|
+
* Will be ORed with other conditions inside the same rule (except ports).
|
384
|
+
*/
|
385
|
+
toServices?: InputArray<core.v1.Service>;
|
386
|
+
/**
|
387
|
+
* The namespace to allow traffic to.
|
388
|
+
*
|
389
|
+
* If provided with `toSelector(s)`, it will be ANDed with them.
|
390
|
+
* Otherwise, it will match all pods in the namespace.
|
391
|
+
*
|
392
|
+
* Will be ORed with other conditions inside the same rule (except ports and selectors).
|
393
|
+
*/
|
394
|
+
toNamespace?: Input<NamespaceLike>;
|
395
|
+
/**
|
396
|
+
* The list of allowed namespaces for outgoing traffic.
|
397
|
+
*
|
398
|
+
* If provided with `toSelector(s)`, it will be ANDed with them.
|
399
|
+
* Otherwise, it will match all pods in the namespaces.
|
400
|
+
*
|
401
|
+
* Will be ORed with other conditions inside the same rule (except ports and selectors).
|
402
|
+
*/
|
403
|
+
toNamespaces?: InputArray<NamespaceLike>;
|
404
|
+
/**
|
405
|
+
* The selector for outgoing traffic.
|
406
|
+
*
|
407
|
+
* If provided with `toNamespace(s)`, it will be ANDe with them.
|
408
|
+
*
|
409
|
+
* Otherwise, it will match pods only in all namespaces.
|
410
|
+
*/
|
411
|
+
toSelector?: Input<SelectorLike>;
|
412
|
+
/**
|
413
|
+
* The list of selectors for outgoing traffic.
|
414
|
+
*
|
415
|
+
* If provided with `toNamespace(s)`, it will be ANDed with them.
|
416
|
+
* Otherwise, it will match pods only in all namespaces.
|
417
|
+
*/
|
418
|
+
toSelectors?: InputArray<SelectorLike>;
|
419
|
+
/**
|
420
|
+
* The port to allow outgoing traffic on.
|
421
|
+
*
|
422
|
+
* Will be ANDed with all conditions inside the same rule.
|
423
|
+
*/
|
424
|
+
toPort?: Input<NetworkPolicyPort>;
|
425
|
+
/**
|
426
|
+
* The list of allowed ports for outgoing traffic.
|
427
|
+
*
|
428
|
+
* Will be ANDed with all conditions inside the same rule.
|
429
|
+
*/
|
430
|
+
toPorts?: InputArray<NetworkPolicyPort>;
|
431
|
+
};
|
432
|
+
type NetworkPolicyArgs = CommonArgs & {
|
433
|
+
/**
|
434
|
+
* The description of this network policy.
|
435
|
+
*/
|
436
|
+
description?: Input<string>;
|
437
|
+
/**
|
438
|
+
* The pod selector for this network policy.
|
439
|
+
* If not provided, it will select all pods in the namespace.
|
440
|
+
*/
|
441
|
+
selector?: SelectorLike;
|
442
|
+
/**
|
443
|
+
* The rule for incoming traffic.
|
444
|
+
*/
|
445
|
+
ingressRule?: Input<IngressRuleArgs>;
|
446
|
+
/**
|
447
|
+
* The rules for incoming traffic.
|
448
|
+
*/
|
449
|
+
ingressRules?: InputArray<IngressRuleArgs>;
|
450
|
+
/**
|
451
|
+
* The rule for outgoing traffic.
|
452
|
+
*/
|
453
|
+
egressRule?: Input<EgressRuleArgs>;
|
454
|
+
/**
|
455
|
+
* The rules for outgoing traffic.
|
456
|
+
*/
|
457
|
+
egressRules?: InputArray<EgressRuleArgs>;
|
458
|
+
/**
|
459
|
+
* Enable the isolation of ingress traffic, so that only matched traffic can ingress.
|
460
|
+
*/
|
461
|
+
isolateIngress?: Input<boolean>;
|
462
|
+
/**
|
463
|
+
* Enable the isolation of egress traffic, so that only matched traffic can egress.
|
464
|
+
*/
|
465
|
+
isolateEgress?: Input<boolean>;
|
466
|
+
};
|
467
|
+
type FullNetworkPolicyArgs = NetworkPolicyArgs & {
|
468
|
+
/**
|
469
|
+
* The name of the CNI plugin to use for creating network policies.
|
470
|
+
* If not provided or set to `unknown`, it will use the native `NetworkPolicy` resource.
|
471
|
+
*/
|
472
|
+
cni?: Input<string | undefined>;
|
473
|
+
};
|
474
|
+
type NormalizedRuleArgs = {
|
475
|
+
all: boolean;
|
476
|
+
cidrs: string[];
|
477
|
+
fqdns: string[];
|
478
|
+
services: core.v1.Service[];
|
479
|
+
namespaces: NamespaceLike[];
|
480
|
+
selectors: SelectorLike[];
|
481
|
+
ports: NetworkPolicyPort[];
|
482
|
+
};
|
483
|
+
type NormalizedNetworkPolicyArgs = Omit<Unwrap<NetworkPolicyArgs>, "podSelector" | "ingressRule" | "ingressRules" | "egressRule" | "egressRules" | "isolateIngress" | "isolateEgress"> & {
|
484
|
+
podSelector: Unwrap<types.input.meta.v1.LabelSelector>;
|
485
|
+
isolateIngress: boolean;
|
486
|
+
isolateEgress: boolean;
|
487
|
+
ingressRules: NormalizedRuleArgs[];
|
488
|
+
egressRules: NormalizedRuleArgs[];
|
489
|
+
};
|
490
|
+
/**
|
491
|
+
* The abstract resource for creating network policies.
|
492
|
+
* Will use different resources depending on the environment.
|
493
|
+
*
|
494
|
+
* Note: In the worst case, it will create native `NetworkPolicy` resources and ignore some features like L7 rules.
|
495
|
+
*/
|
496
|
+
declare abstract class NetworkPolicy extends ComponentResource {
|
497
|
+
/**
|
498
|
+
* The underlying network policy resource.
|
499
|
+
*/
|
500
|
+
readonly networkPolicy: Output<Resource>;
|
501
|
+
protected constructor(name: string, args: Unwrap<NetworkPolicyArgs>, opts?: ResourceOptions);
|
502
|
+
protected abstract create(name: string, args: NormalizedNetworkPolicyArgs, opts?: ResourceOptions): Input<Resource>;
|
503
|
+
static create(name: string, args: FullNetworkPolicyArgs, opts?: ResourceOptions): Output<NetworkPolicy>;
|
504
|
+
}
|
505
|
+
|
506
|
+
type UseAccessPointResult = {
|
507
|
+
/**
|
508
|
+
* The gateway instance created according to the access point.
|
509
|
+
*/
|
510
|
+
gateway: gateway.v1.Gateway;
|
511
|
+
/**
|
512
|
+
* The DNS record associated created according to the access point and gateway.
|
513
|
+
*/
|
514
|
+
dnsRecord: DnsRecord;
|
515
|
+
};
|
516
|
+
type UseAccessPointArgs = Omit<CreateGatewayArgs, "gateway"> & {
|
517
|
+
accessPoint: Input<k8s.AccessPoint>;
|
518
|
+
};
|
519
|
+
declare function useAccessPoint(args: UseAccessPointArgs): Promise<UseAccessPointResult>;
|
520
|
+
type CreateGatewayArgs = {
|
521
|
+
name: string;
|
522
|
+
namespace: Input<NamespaceLike>;
|
523
|
+
annotations?: Input<Record<string, string>>;
|
524
|
+
fqdn: Input<string>;
|
525
|
+
gateway: Input<k8s.Gateway>;
|
526
|
+
provider: Provider;
|
527
|
+
};
|
528
|
+
|
529
|
+
type ScriptDistribution = "alpine" | "ubuntu";
|
530
|
+
type DistributionEnvironment = {
|
531
|
+
/**
|
532
|
+
* The utility packages that should be installed before running "preInstallScripts".
|
533
|
+
*
|
534
|
+
* Useful for installing tools like `curl` to install additional repositories.
|
535
|
+
*/
|
536
|
+
preInstallPackages?: InputArray<string>;
|
537
|
+
/**
|
538
|
+
* The pre-install scripts that should be run before installing packages.
|
539
|
+
* Typically, these scripts are used to install additional repositories.
|
540
|
+
*/
|
541
|
+
preInstallScripts?: InputMap<string>;
|
542
|
+
/**
|
543
|
+
* The packages that are available in the environment.
|
544
|
+
*/
|
545
|
+
packages?: InputArray<string>;
|
546
|
+
};
|
547
|
+
type ScriptEnvironment = {
|
548
|
+
[distribution in ScriptDistribution]?: DistributionEnvironment;
|
549
|
+
} & {
|
550
|
+
/**
|
551
|
+
* The setup scripts that should be run before the script.
|
552
|
+
*/
|
553
|
+
setupScripts?: InputMap<string>;
|
554
|
+
/**
|
555
|
+
* The cleanup scripts that should be run after the script.
|
556
|
+
*/
|
557
|
+
cleanupScripts?: InputMap<string>;
|
558
|
+
/**
|
559
|
+
* The arbitrary scripts available in the environment.
|
560
|
+
*/
|
561
|
+
scripts?: InputMap<string>;
|
562
|
+
/**
|
563
|
+
* The volumes that should be defined in the environment.
|
564
|
+
*/
|
565
|
+
volumes?: InputArray<WorkloadVolume>;
|
566
|
+
/**
|
567
|
+
* The volume mounts that should be defined in the environment.
|
568
|
+
*/
|
569
|
+
volumeMounts?: InputArray<ContainerVolumeMount>;
|
570
|
+
/**
|
571
|
+
* The environment variables that should be defined in the environment.
|
572
|
+
*/
|
573
|
+
environment?: Input<ContainerEnvironment>;
|
574
|
+
};
|
575
|
+
|
576
|
+
type ScriptBundleArgs = CommonArgs & {
|
577
|
+
/**
|
578
|
+
* The environment to bundle the scripts from.
|
579
|
+
*/
|
580
|
+
environment?: Input$1<ScriptEnvironment>;
|
581
|
+
/**
|
582
|
+
* The environments to bundle the scripts from.
|
583
|
+
*/
|
584
|
+
environments?: InputArray<ScriptEnvironment>;
|
585
|
+
/**
|
586
|
+
* The distribution to use for the scripts.
|
587
|
+
*/
|
588
|
+
distribution: ScriptDistribution;
|
589
|
+
};
|
590
|
+
declare class ScriptBundle extends ComponentResource$1 {
|
591
|
+
/**
|
592
|
+
* The config map containing the scripts.
|
593
|
+
*/
|
594
|
+
readonly configMap: Output$1<core.v1.ConfigMap>;
|
595
|
+
/**
|
596
|
+
* The volumes that should be included in the workload.
|
597
|
+
*/
|
598
|
+
readonly volumes: Output$1<WorkloadVolume[]>;
|
599
|
+
/**
|
600
|
+
* The volume mounts that should be defined in the container.
|
601
|
+
*/
|
602
|
+
readonly volumeMounts: Output$1<ContainerVolumeMount[]>;
|
603
|
+
/**
|
604
|
+
* The environment variables that should be defined in the container.
|
605
|
+
*/
|
606
|
+
readonly environment: Output$1<ContainerEnvironment>;
|
607
|
+
/**
|
608
|
+
* The distribution to use for the scripts.
|
609
|
+
*/
|
610
|
+
readonly distribution: ScriptDistribution;
|
611
|
+
constructor(name: string, args: ScriptBundleArgs, opts?: ComponentResourceOptions$1);
|
612
|
+
}
|
613
|
+
|
614
|
+
interface ScriptContainer extends Container {
|
615
|
+
/**
|
616
|
+
* The script bundle to use.
|
617
|
+
*/
|
618
|
+
bundle: Input$1<ScriptBundle>;
|
619
|
+
/**
|
620
|
+
* The name of the main script to run.
|
621
|
+
* The script must be available in the bundle.
|
622
|
+
*/
|
623
|
+
main: Input$1<string>;
|
624
|
+
}
|
625
|
+
/**
|
626
|
+
* Creates a spec for a container that runs a script.
|
627
|
+
* This spec can be used to create a complete workload or an init container.
|
628
|
+
*
|
629
|
+
* @param options The options to create the container spec.
|
630
|
+
* @returns The container spec.
|
631
|
+
*/
|
632
|
+
declare function createScriptContainer(options: ScriptContainer): Output$1<Container>;
|
633
|
+
|
634
|
+
type JobArgs = CommonArgs & {
|
635
|
+
container?: Input<Container>;
|
636
|
+
containers?: InputArray<Container>;
|
637
|
+
} & Omit<Partial<types.input.batch.v1.JobSpec>, "template"> & {
|
638
|
+
template?: {
|
639
|
+
metadata?: types.input.meta.v1.ObjectMeta;
|
640
|
+
spec?: Partial<types.input.core.v1.PodSpec>;
|
641
|
+
};
|
642
|
+
};
|
643
|
+
declare class Job extends ComponentResource {
|
644
|
+
/**
|
645
|
+
* The underlying Kubernetes job.
|
646
|
+
*/
|
647
|
+
readonly job: Output<batch.v1.Job>;
|
648
|
+
constructor(name: string, args: JobArgs, opts?: ComponentResourceOptions);
|
649
|
+
}
|
650
|
+
|
651
|
+
type CronJobArgs = CommonArgs & {
|
652
|
+
container?: Input<Container>;
|
653
|
+
containers?: InputArray<Container>;
|
654
|
+
} & Omit<RequiredKeys<Partial<types.input.batch.v1.CronJobSpec>, "schedule">, "jobTemplate"> & {
|
655
|
+
jobTemplate?: {
|
656
|
+
metadata?: types.input.meta.v1.ObjectMeta;
|
657
|
+
spec?: Omit<types.input.batch.v1.JobSpec, "template"> & {
|
658
|
+
template?: {
|
659
|
+
metadata?: types.input.meta.v1.ObjectMeta;
|
660
|
+
spec?: Partial<types.input.core.v1.PodSpec>;
|
661
|
+
};
|
662
|
+
};
|
663
|
+
};
|
664
|
+
};
|
665
|
+
declare class CronJob extends ComponentResource {
|
666
|
+
/**
|
667
|
+
* The underlying Kubernetes job.
|
668
|
+
*/
|
669
|
+
readonly cronJob: Output<batch.v1.CronJob>;
|
670
|
+
constructor(name: string, args: CronJobArgs, opts?: ComponentResourceOptions);
|
671
|
+
}
|
672
|
+
|
673
|
+
declare function getChartServiceOutput(chart: helm.v4.Chart, name: string): Output$1<core.v1.Service>;
|
674
|
+
declare function getChartService(chart: helm.v4.Chart, name: string): Promise<core.v1.Service>;
|
675
|
+
|
676
|
+
export { type CommonArgs, type Container, type ContainerEnvironment, type ContainerEnvironmentSource, type ContainerEnvironmentVariable, type ContainerVolumeMount, CronJob, type CronJobArgs, Deployment, type DeploymentArgs, type FullNetworkPolicyArgs, HttpRoute, type HttpRouteArgs, Job, type JobArgs, type NamespaceLike, NetworkPolicy, type NetworkPolicyArgs, type NetworkPolicyPort, type NormalizedNetworkPolicyArgs, type NormalizedRuleArgs, ScriptBundle, type ScriptBundleArgs, type ScriptContainer, type ScriptDistribution, type ScriptEnvironment, type SelectorLike, Service, type ServiceArgs, StatefulSet, type StatefulSetArgs, type WorkloadVolume, createNamespace, createProvider, createScriptContainer, getChartService, getChartServiceOutput, getServiceHost, mapContainerPortToServicePort, mapMetadata, mapNamespaceLikeToNamespaceName, mapNamespaceNameToSelector, mapSelectorLikeToSelector, mapServiceToLabelSelector, resolveChartPath, useAccessPoint };
|