@highstate/k8s 0.7.2 → 0.7.4
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/{helm-wPTgVV1N.js → chunk-K4WKJ4L5.js} +89 -47
- package/dist/chunk-K4WKJ4L5.js.map +1 -0
- package/dist/{shared-Clzbl5K-.js → chunk-T5Z2M4JE.js} +21 -7
- package/dist/chunk-T5Z2M4JE.js.map +1 -0
- package/dist/highstate.manifest.json +9 -0
- package/dist/index.js +304 -154
- package/dist/index.js.map +1 -0
- package/dist/units/access-point/index.js +9 -7
- package/dist/units/access-point/index.js.map +1 -0
- package/dist/units/cert-manager/index.js +29 -29
- package/dist/units/cert-manager/index.js.map +1 -0
- package/dist/units/dns01-issuer/index.js +22 -14
- package/dist/units/dns01-issuer/index.js.map +1 -0
- package/dist/units/existing-cluster/index.js +49 -21
- package/dist/units/existing-cluster/index.js.map +1 -0
- package/package.json +15 -16
- package/src/access-point.ts +185 -0
- package/src/container.ts +271 -0
- package/src/cron-job.ts +77 -0
- package/src/deployment.ts +210 -0
- package/src/gateway/backend.ts +61 -0
- package/src/gateway/http-route.ts +139 -0
- package/src/gateway/index.ts +2 -0
- package/src/helm.ts +298 -0
- package/src/index.ts +61 -0
- package/src/job.ts +66 -0
- package/src/network-policy.ts +732 -0
- package/src/pod.ts +5 -0
- package/src/pvc.ts +178 -0
- package/src/scripting/bundle.ts +244 -0
- package/src/scripting/container.ts +44 -0
- package/src/scripting/environment.ts +79 -0
- package/src/scripting/index.ts +3 -0
- package/src/service.ts +279 -0
- package/src/shared.ts +150 -0
- package/src/stateful-set.ts +159 -0
- package/src/units/access-point/index.ts +12 -0
- package/src/units/cert-manager/index.ts +37 -0
- package/src/units/dns01-issuer/index.ts +41 -0
- package/src/units/dns01-issuer/solver.ts +23 -0
- package/src/units/existing-cluster/index.ts +107 -0
- package/src/workload.ts +150 -0
- package/assets/charts.json +0 -8
- package/dist/index.d.ts +0 -1036
package/src/index.ts
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
export {
|
2
|
+
getProvider as createProvider,
|
3
|
+
createNamespace,
|
4
|
+
getNamespace,
|
5
|
+
mapMetadata,
|
6
|
+
mapNamespaceLikeToNamespaceName,
|
7
|
+
mapNamespaceNameToSelector,
|
8
|
+
mapSelectorLikeToSelector,
|
9
|
+
getAppName,
|
10
|
+
getAppDisplayName,
|
11
|
+
type CommonArgs,
|
12
|
+
type NamespaceLike,
|
13
|
+
type SelectorLike,
|
14
|
+
} from "./shared"
|
15
|
+
export { type DeploymentArgs, Deployment } from "./deployment"
|
16
|
+
export {
|
17
|
+
type ServiceArgs as ServiceArgs,
|
18
|
+
Service,
|
19
|
+
mapContainerPortToServicePort,
|
20
|
+
mapServiceToLabelSelector,
|
21
|
+
} from "./service"
|
22
|
+
export { type StatefulSetArgs, StatefulSet } from "./stateful-set"
|
23
|
+
export {
|
24
|
+
type NetworkPolicyArgs,
|
25
|
+
type FullNetworkPolicyArgs,
|
26
|
+
type NormalizedNetworkPolicyArgs,
|
27
|
+
type NormalizedRuleArgs,
|
28
|
+
type NetworkPolicyPort,
|
29
|
+
NetworkPolicy,
|
30
|
+
} from "./network-policy"
|
31
|
+
export { useAccessPoint, useStandardAcessPoint } from "./access-point"
|
32
|
+
export {
|
33
|
+
type ScriptBundleArgs,
|
34
|
+
type ScriptContainer,
|
35
|
+
type ScriptEnvironment,
|
36
|
+
type ScriptDistribution,
|
37
|
+
ScriptBundle,
|
38
|
+
createScriptContainer,
|
39
|
+
} from "./scripting"
|
40
|
+
export { type JobArgs, Job } from "./job"
|
41
|
+
export { type CronJobArgs, CronJob } from "./cron-job"
|
42
|
+
export {
|
43
|
+
type Container,
|
44
|
+
type ContainerEnvironment,
|
45
|
+
type ContainerEnvironmentSource,
|
46
|
+
type ContainerEnvironmentVariable,
|
47
|
+
type ContainerVolumeMount,
|
48
|
+
type WorkloadVolume,
|
49
|
+
} from "./container"
|
50
|
+
export {
|
51
|
+
type ChartArgs,
|
52
|
+
type ChartManifest,
|
53
|
+
type RenderedChartArgs,
|
54
|
+
Chart,
|
55
|
+
RenderedChart,
|
56
|
+
getChartServiceOutput,
|
57
|
+
getChartService,
|
58
|
+
resolveHelmChart,
|
59
|
+
} from "./helm"
|
60
|
+
export { type HttpRouteArgs, HttpRoute } from "./gateway"
|
61
|
+
export { type PersistentVolumeClaimArgs, PersistentVolumeClaim } from "./pvc"
|
package/src/job.ts
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
import { batch, type types } from "@pulumi/kubernetes"
|
2
|
+
import {
|
3
|
+
ComponentResource,
|
4
|
+
normalize,
|
5
|
+
Output,
|
6
|
+
output,
|
7
|
+
type ComponentResourceOptions,
|
8
|
+
type Input,
|
9
|
+
type InputArray,
|
10
|
+
} from "@highstate/pulumi"
|
11
|
+
import { mergeDeep, omit } from "remeda"
|
12
|
+
import { mapContainerToRaw, mapWorkloadVolume, type Container } from "./container"
|
13
|
+
import { commonExtraArgs, mapMetadata, type CommonArgs } from "./shared"
|
14
|
+
|
15
|
+
export type JobArgs = CommonArgs & {
|
16
|
+
container?: Input<Container>
|
17
|
+
containers?: InputArray<Container>
|
18
|
+
} & Omit<Partial<types.input.batch.v1.JobSpec>, "template"> & {
|
19
|
+
template?: {
|
20
|
+
metadata?: types.input.meta.v1.ObjectMeta
|
21
|
+
spec?: Partial<types.input.core.v1.PodSpec>
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
const jobExtraArgs = [...commonExtraArgs, "container", "containers"] as const
|
26
|
+
|
27
|
+
export class Job extends ComponentResource {
|
28
|
+
/**
|
29
|
+
* The underlying Kubernetes job.
|
30
|
+
*/
|
31
|
+
public readonly job: Output<batch.v1.Job>
|
32
|
+
|
33
|
+
constructor(name: string, args: JobArgs, opts?: ComponentResourceOptions) {
|
34
|
+
super("highstate:k8s:Job", name, args, opts)
|
35
|
+
|
36
|
+
this.job = output(args).apply(args => {
|
37
|
+
const containers = normalize(args.container, args.containers)
|
38
|
+
|
39
|
+
return new batch.v1.Job(
|
40
|
+
name,
|
41
|
+
{
|
42
|
+
metadata: mapMetadata(args, name),
|
43
|
+
spec: mergeDeep(
|
44
|
+
{
|
45
|
+
template: {
|
46
|
+
spec: {
|
47
|
+
containers: containers.map(container => mapContainerToRaw(container, name)),
|
48
|
+
|
49
|
+
volumes: containers
|
50
|
+
.flatMap(container => normalize(container.volume, container.volumes))
|
51
|
+
.map(mapWorkloadVolume),
|
52
|
+
|
53
|
+
restartPolicy: "Never",
|
54
|
+
},
|
55
|
+
},
|
56
|
+
} satisfies types.input.batch.v1.JobSpec,
|
57
|
+
omit(args, jobExtraArgs) as types.input.batch.v1.JobSpec,
|
58
|
+
),
|
59
|
+
},
|
60
|
+
{ parent: this, ...opts },
|
61
|
+
)
|
62
|
+
})
|
63
|
+
|
64
|
+
this.registerOutputs({ job: this.job })
|
65
|
+
}
|
66
|
+
}
|