k8ts 0.13.2 → 0.14.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.
- package/dist/common-world.d.ts +3 -8
- package/dist/common-world.d.ts.map +1 -1
- package/dist/common-world.js +6 -9
- package/dist/common-world.js.map +1 -1
- package/dist/env/env.d.ts +7 -7
- package/dist/env/env.d.ts.map +1 -1
- package/dist/env/env.js +21 -23
- package/dist/env/env.js.map +1 -1
- package/dist/env/error.d.ts +5 -0
- package/dist/env/error.d.ts.map +1 -0
- package/dist/env/error.js +12 -0
- package/dist/env/error.js.map +1 -0
- package/dist/env/index.d.ts +1 -1
- package/dist/env/index.d.ts.map +1 -1
- package/dist/env/types.d.ts +5 -5
- package/dist/env/types.d.ts.map +1 -1
- package/dist/gvks/apps.d.ts +29 -0
- package/dist/gvks/apps.d.ts.map +1 -0
- package/dist/gvks/apps.js.map +1 -0
- package/dist/gvks/batch.d.ts +17 -0
- package/dist/gvks/batch.d.ts.map +1 -0
- package/dist/gvks/batch.js.map +1 -0
- package/dist/gvks/default.d.ts +73 -0
- package/dist/gvks/default.d.ts.map +1 -0
- package/dist/gvks/default.js.map +1 -0
- package/dist/gvks/gateway.d.ts +29 -0
- package/dist/gvks/gateway.d.ts.map +1 -0
- package/dist/gvks/gateway.js.map +1 -0
- package/dist/gvks/index.d.ts.map +1 -0
- package/dist/gvks/index.js.map +1 -0
- package/dist/gvks/metrics.d.ts +17 -0
- package/dist/gvks/metrics.d.ts.map +1 -0
- package/dist/gvks/metrics.js.map +1 -0
- package/dist/gvks/networking.d.ts +13 -0
- package/dist/gvks/networking.d.ts.map +1 -0
- package/dist/gvks/networking.js.map +1 -0
- package/dist/gvks/rbac.d.ts +25 -0
- package/dist/gvks/rbac.d.ts.map +1 -0
- package/dist/gvks/rbac.js.map +1 -0
- package/dist/gvks/storage.d.ts +17 -0
- package/dist/gvks/storage.d.ts.map +1 -0
- package/dist/gvks/storage.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/kinds.d.ts +2 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/kinds.js +18 -0
- package/dist/kinds.js.map +1 -0
- package/dist/origins/file/file.d.ts +13 -14
- package/dist/origins/file/file.d.ts.map +1 -1
- package/dist/origins/file/file.js +14 -17
- package/dist/origins/file/file.js.map +1 -1
- package/dist/origins/file/index.d.ts +0 -1
- package/dist/origins/file/index.d.ts.map +1 -1
- package/dist/origins/file/index.js +0 -1
- package/dist/origins/file/index.js.map +1 -1
- package/dist/origins/file/section.d.ts +11 -11
- package/dist/origins/file/section.d.ts.map +1 -1
- package/dist/origins/file/section.js +15 -13
- package/dist/origins/file/section.js.map +1 -1
- package/dist/origins/world.d.ts +6 -5
- package/dist/origins/world.d.ts.map +1 -1
- package/dist/origins/world.js +9 -5
- package/dist/origins/world.js.map +1 -1
- package/dist/resources/annotations.d.ts +2 -0
- package/dist/resources/annotations.d.ts.map +1 -0
- package/dist/resources/{persistent/block-mode.js → annotations.js} +1 -1
- package/dist/resources/annotations.js.map +1 -0
- package/dist/resources/config/configmap.d.ts +7 -7
- package/dist/resources/config/configmap.d.ts.map +1 -1
- package/dist/resources/config/configmap.js +7 -6
- package/dist/resources/config/configmap.js.map +1 -1
- package/dist/resources/config/index.d.ts +0 -1
- package/dist/resources/config/index.d.ts.map +1 -1
- package/dist/resources/config/index.js +0 -1
- package/dist/resources/config/index.js.map +1 -1
- package/dist/resources/config/resolver.d.ts +2 -2
- package/dist/resources/config/resolver.d.ts.map +1 -1
- package/dist/resources/config/resolver.js +4 -3
- package/dist/resources/config/resolver.js.map +1 -1
- package/dist/resources/config/secret.d.ts +7 -14
- package/dist/resources/config/secret.d.ts.map +1 -1
- package/dist/resources/config/secret.js +6 -4
- package/dist/resources/config/secret.js.map +1 -1
- package/dist/resources/errors.d.ts +7 -0
- package/dist/resources/errors.d.ts.map +1 -0
- package/dist/resources/errors.js +12 -0
- package/dist/resources/errors.js.map +1 -0
- package/dist/resources/hostpath.d.ts +1 -1
- package/dist/resources/hostpath.d.ts.map +1 -1
- package/dist/resources/index.d.ts +2 -5
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +2 -5
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/namespace/namespace.d.ts +7 -9
- package/dist/resources/namespace/namespace.d.ts.map +1 -1
- package/dist/resources/namespace/namespace.js +7 -4
- package/dist/resources/namespace/namespace.js.map +1 -1
- package/dist/resources/network/http-route/http-route.d.ts +19 -0
- package/dist/resources/network/http-route/http-route.d.ts.map +1 -0
- package/dist/resources/network/http-route/http-route.js +51 -0
- package/dist/resources/network/http-route/http-route.js.map +1 -0
- package/dist/resources/network/http-route/index.d.ts.map +1 -0
- package/dist/resources/network/http-route/index.js.map +1 -0
- package/dist/resources/network/index.d.ts +3 -0
- package/dist/resources/network/index.d.ts.map +1 -0
- package/dist/resources/network/index.js +19 -0
- package/dist/resources/network/index.js.map +1 -0
- package/dist/resources/network/service/index.d.ts.map +1 -0
- package/dist/resources/network/service/index.js.map +1 -0
- package/dist/resources/network/service/service-port.d.ts +12 -0
- package/dist/resources/network/service/service-port.d.ts.map +1 -0
- package/dist/resources/{service → network/service}/service-port.js +5 -5
- package/dist/resources/network/service/service-port.js.map +1 -0
- package/dist/resources/network/service/service.d.ts +46 -0
- package/dist/resources/network/service/service.d.ts.map +1 -0
- package/dist/resources/{service → network/service}/service.js +34 -22
- package/dist/resources/network/service/service.js.map +1 -0
- package/dist/resources/network/service/utils.d.ts +5 -0
- package/dist/resources/network/service/utils.d.ts.map +1 -0
- package/dist/resources/network/service/utils.js +22 -0
- package/dist/resources/network/service/utils.js.map +1 -0
- package/dist/resources/persistent/access-mode.d.ts +4 -7
- package/dist/resources/persistent/access-mode.d.ts.map +1 -1
- package/dist/resources/persistent/access-mode.js +20 -24
- package/dist/resources/persistent/access-mode.js.map +1 -1
- package/dist/resources/persistent/claim/pvc.d.ts +17 -20
- package/dist/resources/persistent/claim/pvc.d.ts.map +1 -1
- package/dist/resources/persistent/claim/pvc.js +22 -28
- package/dist/resources/persistent/claim/pvc.js.map +1 -1
- package/dist/resources/persistent/index.d.ts +1 -1
- package/dist/resources/persistent/index.d.ts.map +1 -1
- package/dist/resources/persistent/index.js +1 -1
- package/dist/resources/persistent/index.js.map +1 -1
- package/dist/resources/persistent/volume/parse-backend.d.ts +1 -1
- package/dist/resources/persistent/volume/parse-backend.js +3 -3
- package/dist/resources/persistent/volume/parse-backend.js.map +1 -1
- package/dist/resources/persistent/volume/pv.d.ts +23 -25
- package/dist/resources/persistent/volume/pv.d.ts.map +1 -1
- package/dist/resources/persistent/volume/pv.js +23 -29
- package/dist/resources/persistent/volume/pv.js.map +1 -1
- package/dist/resources/persistent/volume-mode.d.ts +2 -0
- package/dist/resources/persistent/volume-mode.d.ts.map +1 -0
- package/dist/resources/persistent/volume-mode.js +3 -0
- package/dist/resources/persistent/volume-mode.js.map +1 -0
- package/dist/resources/rbac/cluster-role-binding.d.ts +12 -12
- package/dist/resources/rbac/cluster-role-binding.d.ts.map +1 -1
- package/dist/resources/rbac/cluster-role-binding.js +12 -10
- package/dist/resources/rbac/cluster-role-binding.js.map +1 -1
- package/dist/resources/rbac/cluster-role.d.ts +6 -23
- package/dist/resources/rbac/cluster-role.d.ts.map +1 -1
- package/dist/resources/rbac/cluster-role.js +9 -18
- package/dist/resources/rbac/cluster-role.js.map +1 -1
- package/dist/resources/rbac/role-props.d.ts +20 -0
- package/dist/resources/rbac/role-props.d.ts.map +1 -0
- package/dist/resources/rbac/role-props.js +17 -0
- package/dist/resources/rbac/role-props.js.map +1 -0
- package/dist/resources/rbac/service-account.d.ts +8 -8
- package/dist/resources/rbac/service-account.d.ts.map +1 -1
- package/dist/resources/rbac/service-account.js +8 -6
- package/dist/resources/rbac/service-account.js.map +1 -1
- package/dist/resources/workload/cronjob/index.d.ts +21 -0
- package/dist/resources/workload/cronjob/index.d.ts.map +1 -0
- package/dist/resources/workload/cronjob/index.js +98 -0
- package/dist/resources/workload/cronjob/index.js.map +1 -0
- package/dist/resources/workload/daemonset/daemonset.d.ts +16 -0
- package/dist/resources/workload/daemonset/daemonset.d.ts.map +1 -0
- package/dist/resources/workload/daemonset/daemonset.js +117 -0
- package/dist/resources/workload/daemonset/daemonset.js.map +1 -0
- package/dist/resources/workload/daemonset/index.d.ts +2 -0
- package/dist/resources/workload/daemonset/index.d.ts.map +1 -0
- package/dist/resources/workload/daemonset/index.js +18 -0
- package/dist/resources/workload/daemonset/index.js.map +1 -0
- package/dist/resources/workload/daemonset/props.d.ts +15 -0
- package/dist/resources/workload/daemonset/props.d.ts.map +1 -0
- package/dist/resources/{pod/container/mounts.js → workload/daemonset/props.js} +1 -1
- package/dist/resources/workload/daemonset/props.js.map +1 -0
- package/dist/resources/workload/deployment/deployment.d.ts +16 -0
- package/dist/resources/workload/deployment/deployment.d.ts.map +1 -0
- package/dist/resources/{deployment → workload/deployment}/deployment.js +39 -34
- package/dist/resources/workload/deployment/deployment.js.map +1 -0
- package/dist/resources/workload/deployment/index.d.ts.map +1 -0
- package/dist/resources/workload/deployment/index.js.map +1 -0
- package/dist/resources/workload/deployment/props.d.ts +17 -0
- package/dist/resources/workload/deployment/props.d.ts.map +1 -0
- package/dist/{_type/prefix$.js → resources/workload/deployment/props.js} +1 -1
- package/dist/resources/workload/deployment/props.js.map +1 -0
- package/dist/resources/workload/index.d.ts +7 -0
- package/dist/resources/workload/index.d.ts.map +1 -0
- package/dist/resources/{pod → workload}/index.js +6 -3
- package/dist/resources/workload/index.js.map +1 -0
- package/dist/resources/workload/pod/container/container.d.ts +47 -0
- package/dist/resources/workload/pod/container/container.d.ts.map +1 -0
- package/dist/resources/{pod → workload/pod}/container/container.js +46 -38
- package/dist/resources/workload/pod/container/container.js.map +1 -0
- package/dist/resources/workload/pod/container/index.d.ts +3 -0
- package/dist/resources/workload/pod/container/index.d.ts.map +1 -0
- package/dist/resources/{pod → workload/pod}/container/index.js +1 -0
- package/dist/resources/workload/pod/container/index.js.map +1 -0
- package/dist/resources/workload/pod/container/mounts/device.d.ts +17 -0
- package/dist/resources/workload/pod/container/mounts/device.d.ts.map +1 -0
- package/dist/resources/workload/pod/container/mounts/device.js +29 -0
- package/dist/resources/workload/pod/container/mounts/device.js.map +1 -0
- package/dist/resources/workload/pod/container/mounts/volume.d.ts +21 -0
- package/dist/resources/workload/pod/container/mounts/volume.d.ts.map +1 -0
- package/dist/resources/{pod → workload/pod}/container/mounts/volume.js +9 -7
- package/dist/resources/workload/pod/container/mounts/volume.js.map +1 -0
- package/dist/resources/workload/pod/container/ref.d.ts +6 -0
- package/dist/resources/workload/pod/container/ref.d.ts.map +1 -0
- package/dist/{runner/exporter/meta.js → resources/workload/pod/container/ref.js} +1 -1
- package/dist/resources/workload/pod/container/ref.js.map +1 -0
- package/dist/resources/workload/pod/container/scope.d.ts +25 -0
- package/dist/resources/workload/pod/container/scope.d.ts.map +1 -0
- package/dist/resources/workload/pod/container/scope.js +50 -0
- package/dist/resources/workload/pod/container/scope.js.map +1 -0
- package/dist/resources/workload/pod/container/utils.d.ts +5 -0
- package/dist/resources/workload/pod/container/utils.d.ts.map +1 -0
- package/dist/resources/workload/pod/container/utils.js +18 -0
- package/dist/resources/workload/pod/container/utils.js.map +1 -0
- package/dist/resources/workload/pod/pod.d.ts +27 -0
- package/dist/resources/workload/pod/pod.d.ts.map +1 -0
- package/dist/resources/workload/pod/pod.js +78 -0
- package/dist/resources/workload/pod/pod.js.map +1 -0
- package/dist/resources/workload/pod/volume/devices.d.ts +24 -0
- package/dist/resources/workload/pod/volume/devices.d.ts.map +1 -0
- package/dist/resources/{pod → workload/pod}/volume/devices.js +11 -9
- package/dist/resources/workload/pod/volume/devices.js.map +1 -0
- package/dist/resources/workload/pod/volume/index.d.ts +3 -0
- package/dist/resources/workload/pod/volume/index.d.ts.map +1 -0
- package/dist/resources/workload/pod/volume/index.js +8 -0
- package/dist/resources/workload/pod/volume/index.js.map +1 -0
- package/dist/resources/workload/pod/volume/volumes.d.ts +74 -0
- package/dist/resources/workload/pod/volume/volumes.d.ts.map +1 -0
- package/dist/resources/workload/pod/volume/volumes.js +111 -0
- package/dist/resources/workload/pod/volume/volumes.js.map +1 -0
- package/dist/resources/workload/statefulset/index.d.ts +2 -0
- package/dist/resources/workload/statefulset/index.d.ts.map +1 -0
- package/dist/resources/workload/statefulset/index.js +18 -0
- package/dist/resources/workload/statefulset/index.js.map +1 -0
- package/dist/resources/workload/statefulset/props.d.ts +24 -0
- package/dist/resources/workload/statefulset/props.d.ts.map +1 -0
- package/dist/{runner/proverbs.js → resources/workload/statefulset/props.js} +1 -1
- package/dist/resources/workload/statefulset/props.js.map +1 -0
- package/dist/resources/workload/statefulset/scope.d.ts +13 -0
- package/dist/resources/workload/statefulset/scope.d.ts.map +1 -0
- package/dist/resources/workload/statefulset/scope.js +26 -0
- package/dist/resources/workload/statefulset/scope.js.map +1 -0
- package/dist/resources/workload/statefulset/statefulset.d.ts +22 -0
- package/dist/resources/workload/statefulset/statefulset.d.ts.map +1 -0
- package/dist/resources/workload/statefulset/statefulset.js +110 -0
- package/dist/resources/workload/statefulset/statefulset.js.map +1 -0
- package/dist/resources/workload/util.d.ts +4 -0
- package/dist/resources/workload/util.d.ts.map +1 -0
- package/dist/resources/workload/util.js +10 -0
- package/dist/resources/workload/util.js.map +1 -0
- package/dist/resources/workload/workload-ref.d.ts +5 -0
- package/dist/resources/workload/workload-ref.d.ts.map +1 -0
- package/dist/resources/workload/workload-ref.js +3 -0
- package/dist/resources/workload/workload-ref.js.map +1 -0
- package/dist/runner/{exporter → engine}/assembler.d.ts +15 -14
- package/dist/runner/engine/assembler.d.ts.map +1 -0
- package/dist/runner/{exporter → engine}/assembler.js +63 -40
- package/dist/runner/engine/assembler.js.map +1 -0
- package/dist/runner/engine/index.d.ts +3 -0
- package/dist/runner/engine/index.d.ts.map +1 -0
- package/dist/runner/{exporter → engine}/index.js +1 -1
- package/dist/runner/engine/index.js.map +1 -0
- package/dist/runner/engine/loader.d.ts +19 -0
- package/dist/runner/engine/loader.d.ts.map +1 -0
- package/dist/runner/{exporter → engine}/loader.js +18 -19
- package/dist/runner/engine/loader.js.map +1 -0
- package/dist/runner/{exporter → engine}/manifester.d.ts +8 -8
- package/dist/runner/engine/manifester.d.ts.map +1 -0
- package/dist/runner/{exporter → engine}/manifester.js +4 -25
- package/dist/runner/engine/manifester.js.map +1 -0
- package/dist/runner/{exporter → engine}/saver.d.ts +5 -4
- package/dist/runner/engine/saver.d.ts.map +1 -0
- package/dist/runner/{exporter → engine}/saver.js +5 -10
- package/dist/runner/engine/saver.js.map +1 -0
- package/dist/runner/engine/serializer.d.ts +20 -0
- package/dist/runner/engine/serializer.d.ts.map +1 -0
- package/dist/runner/{exporter → engine}/serializer.js +8 -17
- package/dist/runner/engine/serializer.js.map +1 -0
- package/dist/runner/{exporter → engine}/stage.d.ts +2 -2
- package/dist/runner/engine/stage.d.ts.map +1 -0
- package/dist/runner/{exporter → engine}/stage.js +10 -10
- package/dist/runner/engine/stage.js.map +1 -0
- package/dist/runner/error.d.ts +7 -0
- package/dist/runner/error.d.ts.map +1 -0
- package/dist/runner/error.js +12 -0
- package/dist/runner/error.js.map +1 -0
- package/dist/runner/index.d.ts +1 -1
- package/dist/runner/index.d.ts.map +1 -1
- package/dist/runner/index.js +3 -15
- package/dist/runner/index.js.map +1 -1
- package/dist/runner/runner.d.ts +8 -6
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +27 -22
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/viz/progress-shower.d.ts +11 -0
- package/dist/runner/viz/progress-shower.d.ts.map +1 -0
- package/dist/runner/viz/progress-shower.js +63 -0
- package/dist/runner/viz/progress-shower.js.map +1 -0
- package/dist/runner/{summarizer.d.ts → viz/summarizer.d.ts} +5 -5
- package/dist/runner/viz/summarizer.d.ts.map +1 -0
- package/dist/runner/{summarizer.js → viz/summarizer.js} +9 -10
- package/dist/runner/viz/summarizer.js.map +1 -0
- package/dist/util/merge.d.ts +2 -0
- package/dist/util/merge.d.ts.map +1 -0
- package/dist/util/merge.js +3 -0
- package/dist/util/merge.js.map +1 -0
- package/package.json +12 -12
- package/src/common-world.ts +10 -11
- package/src/env/env.ts +33 -35
- package/src/env/error.ts +7 -0
- package/src/env/index.ts +1 -1
- package/src/env/types.ts +5 -5
- package/src/index.ts +2 -2
- package/src/kinds.ts +1 -0
- package/src/origins/file/file.ts +25 -33
- package/src/origins/file/index.ts +0 -1
- package/src/origins/file/section.ts +17 -16
- package/src/origins/world.ts +19 -13
- package/src/resources/config/configmap.ts +14 -13
- package/src/resources/config/index.ts +0 -1
- package/src/resources/config/resolver.ts +8 -5
- package/src/resources/config/secret.ts +11 -7
- package/src/resources/errors.ts +7 -0
- package/src/resources/hostpath.ts +1 -1
- package/src/resources/index.ts +2 -5
- package/src/resources/namespace/namespace.ts +11 -8
- package/src/resources/network/http-route/http-route.ts +62 -0
- package/src/resources/network/index.ts +2 -0
- package/src/resources/network/service/service-port.ts +17 -0
- package/src/resources/network/service/service.ts +135 -0
- package/src/resources/network/service/utils.ts +20 -0
- package/src/resources/persistent/access-mode.ts +20 -24
- package/src/resources/persistent/claim/pvc.ts +41 -43
- package/src/resources/persistent/index.ts +1 -1
- package/src/resources/persistent/volume/parse-backend.ts +3 -3
- package/src/resources/persistent/volume/pv.ts +55 -51
- package/src/resources/persistent/volume-mode.ts +1 -0
- package/src/resources/rbac/cluster-role-binding.ts +19 -17
- package/src/resources/rbac/cluster-role.ts +13 -62
- package/src/resources/rbac/role-props.ts +26 -0
- package/src/resources/rbac/service-account.ts +14 -12
- package/src/resources/workload/cronjob/index.ts +74 -0
- package/src/resources/workload/daemonset/daemonset.ts +82 -0
- package/src/resources/workload/daemonset/index.ts +1 -0
- package/src/resources/workload/daemonset/props.ts +19 -0
- package/src/resources/workload/deployment/deployment.ts +79 -0
- package/src/resources/workload/deployment/props.ts +19 -0
- package/src/resources/workload/index.ts +6 -0
- package/src/resources/workload/pod/container/container.ts +227 -0
- package/src/resources/{pod → workload/pod}/container/index.ts +1 -0
- package/src/resources/workload/pod/container/mounts/device.ts +41 -0
- package/src/resources/workload/pod/container/mounts/volume.ts +46 -0
- package/src/resources/workload/pod/container/ref.ts +6 -0
- package/src/resources/workload/pod/container/scope.ts +83 -0
- package/src/resources/workload/pod/container/utils.ts +16 -0
- package/src/resources/workload/pod/pod.ts +96 -0
- package/src/resources/workload/pod/volume/devices.ts +56 -0
- package/src/resources/workload/pod/volume/index.ts +2 -0
- package/src/resources/workload/pod/volume/volumes.ts +203 -0
- package/src/resources/workload/statefulset/index.ts +1 -0
- package/src/resources/workload/statefulset/props.ts +34 -0
- package/src/resources/workload/statefulset/scope.ts +25 -0
- package/src/resources/workload/statefulset/statefulset.ts +137 -0
- package/src/resources/workload/util.ts +8 -0
- package/src/resources/workload/workload-ref.ts +5 -0
- package/src/runner/{exporter → engine}/assembler.ts +83 -54
- package/src/runner/engine/index.ts +2 -0
- package/src/runner/{exporter → engine}/loader.ts +32 -29
- package/src/runner/{exporter → engine}/manifester.ts +20 -32
- package/src/runner/{exporter → engine}/saver.ts +8 -9
- package/src/runner/{exporter → engine}/serializer.ts +21 -20
- package/src/runner/{exporter → engine}/stage.ts +5 -5
- package/src/runner/error.ts +7 -0
- package/src/runner/index.ts +1 -1
- package/src/runner/runner.ts +44 -29
- package/src/runner/{exporter → viz}/progress-shower.ts +21 -21
- package/src/runner/{summarizer.ts → viz/summarizer.ts} +21 -21
- package/dist/_type/prefix$.d.ts +0 -4
- package/dist/_type/prefix$.d.ts.map +0 -1
- package/dist/_type/prefix$.js.map +0 -1
- package/dist/kinds/apps.d.ts +0 -29
- package/dist/kinds/apps.d.ts.map +0 -1
- package/dist/kinds/apps.js.map +0 -1
- package/dist/kinds/batch.d.ts +0 -17
- package/dist/kinds/batch.d.ts.map +0 -1
- package/dist/kinds/batch.js.map +0 -1
- package/dist/kinds/default.d.ts +0 -73
- package/dist/kinds/default.d.ts.map +0 -1
- package/dist/kinds/default.js.map +0 -1
- package/dist/kinds/gateway.d.ts +0 -29
- package/dist/kinds/gateway.d.ts.map +0 -1
- package/dist/kinds/gateway.js.map +0 -1
- package/dist/kinds/index.d.ts.map +0 -1
- package/dist/kinds/index.js.map +0 -1
- package/dist/kinds/metrics.d.ts +0 -17
- package/dist/kinds/metrics.d.ts.map +0 -1
- package/dist/kinds/metrics.js.map +0 -1
- package/dist/kinds/networking.d.ts +0 -13
- package/dist/kinds/networking.d.ts.map +0 -1
- package/dist/kinds/networking.js.map +0 -1
- package/dist/kinds/rbac.d.ts +0 -25
- package/dist/kinds/rbac.d.ts.map +0 -1
- package/dist/kinds/rbac.js.map +0 -1
- package/dist/kinds/storage.d.ts +0 -17
- package/dist/kinds/storage.d.ts.map +0 -1
- package/dist/kinds/storage.js.map +0 -1
- package/dist/origins/file/modifier.d.ts +0 -10
- package/dist/origins/file/modifier.d.ts.map +0 -1
- package/dist/origins/file/modifier.js +0 -21
- package/dist/origins/file/modifier.js.map +0 -1
- package/dist/resources/config/config-keys-of.d.ts +0 -2
- package/dist/resources/config/config-keys-of.d.ts.map +0 -1
- package/dist/resources/config/config-keys-of.js +0 -3
- package/dist/resources/config/config-keys-of.js.map +0 -1
- package/dist/resources/config/key-ref.d.ts +0 -7
- package/dist/resources/config/key-ref.d.ts.map +0 -1
- package/dist/resources/config/key-ref.js +0 -13
- package/dist/resources/config/key-ref.js.map +0 -1
- package/dist/resources/cronjob/index.d.ts +0 -20
- package/dist/resources/cronjob/index.d.ts.map +0 -1
- package/dist/resources/cronjob/index.js +0 -37
- package/dist/resources/cronjob/index.js.map +0 -1
- package/dist/resources/deployment/deployment.d.ts +0 -30
- package/dist/resources/deployment/deployment.d.ts.map +0 -1
- package/dist/resources/deployment/deployment.js.map +0 -1
- package/dist/resources/deployment/index.d.ts.map +0 -1
- package/dist/resources/deployment/index.js.map +0 -1
- package/dist/resources/http-route/http-route.d.ts +0 -21
- package/dist/resources/http-route/http-route.d.ts.map +0 -1
- package/dist/resources/http-route/http-route.js +0 -45
- package/dist/resources/http-route/http-route.js.map +0 -1
- package/dist/resources/http-route/index.d.ts.map +0 -1
- package/dist/resources/http-route/index.js.map +0 -1
- package/dist/resources/persistent/block-mode.d.ts +0 -2
- package/dist/resources/persistent/block-mode.d.ts.map +0 -1
- package/dist/resources/persistent/block-mode.js.map +0 -1
- package/dist/resources/pod/container/container.d.ts +0 -47
- package/dist/resources/pod/container/container.d.ts.map +0 -1
- package/dist/resources/pod/container/container.js.map +0 -1
- package/dist/resources/pod/container/index.d.ts +0 -2
- package/dist/resources/pod/container/index.d.ts.map +0 -1
- package/dist/resources/pod/container/index.js.map +0 -1
- package/dist/resources/pod/container/mounts/device.d.ts +0 -17
- package/dist/resources/pod/container/mounts/device.d.ts.map +0 -1
- package/dist/resources/pod/container/mounts/device.js +0 -27
- package/dist/resources/pod/container/mounts/device.js.map +0 -1
- package/dist/resources/pod/container/mounts/volume.d.ts +0 -21
- package/dist/resources/pod/container/mounts/volume.d.ts.map +0 -1
- package/dist/resources/pod/container/mounts/volume.js.map +0 -1
- package/dist/resources/pod/container/mounts.d.ts +0 -3
- package/dist/resources/pod/container/mounts.d.ts.map +0 -1
- package/dist/resources/pod/container/mounts.js.map +0 -1
- package/dist/resources/pod/index.d.ts +0 -4
- package/dist/resources/pod/index.d.ts.map +0 -1
- package/dist/resources/pod/index.js.map +0 -1
- package/dist/resources/pod/pod-template.d.ts +0 -54
- package/dist/resources/pod/pod-template.d.ts.map +0 -1
- package/dist/resources/pod/pod-template.js +0 -119
- package/dist/resources/pod/pod-template.js.map +0 -1
- package/dist/resources/pod/volume/devices.d.ts +0 -24
- package/dist/resources/pod/volume/devices.d.ts.map +0 -1
- package/dist/resources/pod/volume/devices.js.map +0 -1
- package/dist/resources/pod/volume/index.d.ts +0 -3
- package/dist/resources/pod/volume/index.d.ts.map +0 -1
- package/dist/resources/pod/volume/index.js +0 -8
- package/dist/resources/pod/volume/index.js.map +0 -1
- package/dist/resources/pod/volume/volumes.d.ts +0 -66
- package/dist/resources/pod/volume/volumes.d.ts.map +0 -1
- package/dist/resources/pod/volume/volumes.js +0 -97
- package/dist/resources/pod/volume/volumes.js.map +0 -1
- package/dist/resources/service/index.d.ts.map +0 -1
- package/dist/resources/service/index.js.map +0 -1
- package/dist/resources/service/service-port.d.ts +0 -12
- package/dist/resources/service/service-port.d.ts.map +0 -1
- package/dist/resources/service/service-port.js.map +0 -1
- package/dist/resources/service/service.d.ts +0 -39
- package/dist/resources/service/service.d.ts.map +0 -1
- package/dist/resources/service/service.js.map +0 -1
- package/dist/resources/utils/adapters.d.ts +0 -7
- package/dist/resources/utils/adapters.d.ts.map +0 -1
- package/dist/resources/utils/adapters.js +0 -32
- package/dist/resources/utils/adapters.js.map +0 -1
- package/dist/runner/exporter/assembler.d.ts.map +0 -1
- package/dist/runner/exporter/assembler.js.map +0 -1
- package/dist/runner/exporter/index.d.ts +0 -3
- package/dist/runner/exporter/index.d.ts.map +0 -1
- package/dist/runner/exporter/index.js.map +0 -1
- package/dist/runner/exporter/loader.d.ts +0 -18
- package/dist/runner/exporter/loader.d.ts.map +0 -1
- package/dist/runner/exporter/loader.js.map +0 -1
- package/dist/runner/exporter/manifester.d.ts.map +0 -1
- package/dist/runner/exporter/manifester.js.map +0 -1
- package/dist/runner/exporter/meta.d.ts +0 -2
- package/dist/runner/exporter/meta.d.ts.map +0 -1
- package/dist/runner/exporter/meta.js.map +0 -1
- package/dist/runner/exporter/progress-shower.d.ts +0 -11
- package/dist/runner/exporter/progress-shower.d.ts.map +0 -1
- package/dist/runner/exporter/progress-shower.js +0 -69
- package/dist/runner/exporter/progress-shower.js.map +0 -1
- package/dist/runner/exporter/saver.d.ts.map +0 -1
- package/dist/runner/exporter/saver.js.map +0 -1
- package/dist/runner/exporter/serializer.d.ts +0 -19
- package/dist/runner/exporter/serializer.d.ts.map +0 -1
- package/dist/runner/exporter/serializer.js.map +0 -1
- package/dist/runner/exporter/stage.d.ts.map +0 -1
- package/dist/runner/exporter/stage.js.map +0 -1
- package/dist/runner/exporter/validator.d.ts +0 -16
- package/dist/runner/exporter/validator.d.ts.map +0 -1
- package/dist/runner/exporter/validator.js +0 -12
- package/dist/runner/exporter/validator.js.map +0 -1
- package/dist/runner/paths.d.ts +0 -2
- package/dist/runner/paths.d.ts.map +0 -1
- package/dist/runner/paths.js +0 -5
- package/dist/runner/paths.js.map +0 -1
- package/dist/runner/proverbs.d.ts +0 -2
- package/dist/runner/proverbs.d.ts.map +0 -1
- package/dist/runner/proverbs.js.map +0 -1
- package/dist/runner/silly/proverbs.d.ts +0 -7
- package/dist/runner/silly/proverbs.d.ts.map +0 -1
- package/dist/runner/silly/proverbs.js +0 -21
- package/dist/runner/silly/proverbs.js.map +0 -1
- package/dist/runner/summarizer.d.ts.map +0 -1
- package/dist/runner/summarizer.js.map +0 -1
- package/proverbs.txt +0 -20
- package/src/_type/prefix$.ts +0 -3
- package/src/origins/file/modifier.ts +0 -21
- package/src/resources/config/key-ref.ts +0 -8
- package/src/resources/cronjob/index.ts +0 -50
- package/src/resources/deployment/deployment.ts +0 -95
- package/src/resources/http-route/http-route.ts +0 -60
- package/src/resources/persistent/block-mode.ts +0 -1
- package/src/resources/pod/container/container.ts +0 -215
- package/src/resources/pod/container/mounts/device.ts +0 -33
- package/src/resources/pod/container/mounts/volume.ts +0 -38
- package/src/resources/pod/container/mounts.ts +0 -2
- package/src/resources/pod/index.ts +0 -3
- package/src/resources/pod/pod-template.ts +0 -166
- package/src/resources/pod/volume/devices.ts +0 -55
- package/src/resources/pod/volume/index.ts +0 -2
- package/src/resources/pod/volume/volumes.ts +0 -170
- package/src/resources/service/service-port.ts +0 -17
- package/src/resources/service/service.ts +0 -101
- package/src/resources/utils/adapters.ts +0 -29
- package/src/runner/exporter/index.ts +0 -2
- package/src/runner/exporter/validator.ts +0 -13
- package/src/runner/paths.ts +0 -1
- package/src/runner/proverbs.ts +0 -0
- package/src/runner/silly/proverbs.ts +0 -14
- /package/dist/{kinds → gvks}/apps.js +0 -0
- /package/dist/{kinds → gvks}/batch.js +0 -0
- /package/dist/{kinds → gvks}/default.js +0 -0
- /package/dist/{kinds → gvks}/gateway.js +0 -0
- /package/dist/{kinds → gvks}/index.d.ts +0 -0
- /package/dist/{kinds → gvks}/index.js +0 -0
- /package/dist/{kinds → gvks}/metrics.js +0 -0
- /package/dist/{kinds → gvks}/networking.js +0 -0
- /package/dist/{kinds → gvks}/rbac.js +0 -0
- /package/dist/{kinds → gvks}/storage.js +0 -0
- /package/dist/resources/{http-route → network/http-route}/index.d.ts +0 -0
- /package/dist/resources/{http-route → network/http-route}/index.js +0 -0
- /package/dist/resources/{service → network/service}/index.d.ts +0 -0
- /package/dist/resources/{service → network/service}/index.js +0 -0
- /package/dist/resources/{deployment → workload/deployment}/index.d.ts +0 -0
- /package/dist/resources/{deployment → workload/deployment}/index.js +0 -0
- /package/src/{kinds → gvks}/apps.ts +0 -0
- /package/src/{kinds → gvks}/batch.ts +0 -0
- /package/src/{kinds → gvks}/default.ts +0 -0
- /package/src/{kinds → gvks}/gateway.ts +0 -0
- /package/src/{kinds → gvks}/index.ts +0 -0
- /package/src/{kinds → gvks}/metrics.ts +0 -0
- /package/src/{kinds → gvks}/networking.ts +0 -0
- /package/src/{kinds → gvks}/rbac.ts +0 -0
- /package/src/{kinds → gvks}/storage.ts +0 -0
- /package/src/resources/{config/config-keys-of.ts → annotations.ts} +0 -0
- /package/src/resources/{http-route → network/http-route}/index.ts +0 -0
- /package/src/resources/{service → network/service}/index.ts +0 -0
- /package/src/resources/{deployment → workload/deployment}/index.ts +0 -0
- /package/src/{runner/exporter/meta.ts → util/merge.ts} +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ResourcePart,
|
|
3
|
+
type Gvk_SubKind,
|
|
4
|
+
type ResourceEntity,
|
|
5
|
+
type ResourceRef,
|
|
6
|
+
type Resource_Props
|
|
7
|
+
} from "@k8ts/instruments"
|
|
8
|
+
import type { K8S } from "@k8ts/sample-interfaces"
|
|
9
|
+
import { merge } from "lodash"
|
|
10
|
+
import { v1 } from "../../../../../gvks"
|
|
11
|
+
|
|
12
|
+
export interface ContainerDeviceMount_Input extends Resource_Props<K8S.VolumeDevice> {
|
|
13
|
+
$backend: ResourceRef<v1.Pod.Device._>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ContainerMountDevice_Props extends ContainerDeviceMount_Input {
|
|
17
|
+
mountPath: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class ContainerDeviceMount extends ResourcePart<ContainerMountDevice_Props> {
|
|
21
|
+
constructor(parent: ResourceEntity, props: ContainerMountDevice_Props) {
|
|
22
|
+
super(parent, props.$backend.ident.name, props)
|
|
23
|
+
}
|
|
24
|
+
get kind() {
|
|
25
|
+
return v1.Pod.Container.DeviceMount._ satisfies Gvk_SubKind
|
|
26
|
+
}
|
|
27
|
+
get backend() {
|
|
28
|
+
return this.props.$backend
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get path() {
|
|
32
|
+
return this.props.mountPath
|
|
33
|
+
}
|
|
34
|
+
protected __submanifest__(): K8S.VolumeDevice {
|
|
35
|
+
const body = {
|
|
36
|
+
devicePath: this.props.mountPath,
|
|
37
|
+
name: this.props.$backend.ident.name
|
|
38
|
+
}
|
|
39
|
+
return merge(body, this.props.$$manifest)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ResourcePart,
|
|
3
|
+
type Resource_Props,
|
|
4
|
+
type ResourceEntity,
|
|
5
|
+
type ResourceRef
|
|
6
|
+
} from "@k8ts/instruments"
|
|
7
|
+
import type { K8S } from "@k8ts/sample-interfaces"
|
|
8
|
+
import { merge } from "lodash"
|
|
9
|
+
import { v1 } from "../../../../../kinds"
|
|
10
|
+
|
|
11
|
+
export interface ContainerVolumeMount_Input<SubPaths extends string = string>
|
|
12
|
+
extends Resource_Props<K8S.VolumeMount> {
|
|
13
|
+
subPath?: SubPaths
|
|
14
|
+
readOnly?: boolean
|
|
15
|
+
}
|
|
16
|
+
export interface ContainerVolumeMount_Unbound extends ContainerVolumeMount_Input {
|
|
17
|
+
$backend: ResourceRef<v1.Pod.Volume._>
|
|
18
|
+
}
|
|
19
|
+
export interface ContainerVolumeMount_Props extends ContainerVolumeMount_Unbound {
|
|
20
|
+
mountPath: string
|
|
21
|
+
}
|
|
22
|
+
export class ContainerVolumeMount extends ResourcePart<ContainerVolumeMount_Props> {
|
|
23
|
+
constructor(parent: ResourceEntity, props: ContainerVolumeMount_Props) {
|
|
24
|
+
super(parent, props.$backend.ident.name, props)
|
|
25
|
+
}
|
|
26
|
+
get kind() {
|
|
27
|
+
return v1.Pod.Container.VolumeMount._
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get path() {
|
|
31
|
+
return this.props.mountPath
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get backend() {
|
|
35
|
+
return this.props.$backend
|
|
36
|
+
}
|
|
37
|
+
protected __submanifest__(): K8S.VolumeMount {
|
|
38
|
+
const body = {
|
|
39
|
+
name: this.props.$backend.ident.name,
|
|
40
|
+
mountPath: this.props.mountPath,
|
|
41
|
+
readOnly: this.props.readOnly,
|
|
42
|
+
subPath: this.props.subPath
|
|
43
|
+
}
|
|
44
|
+
return merge(body, this.props.$$manifest)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { ResourceRef, ResourceRef_HasKeys } from "@k8ts/instruments"
|
|
2
|
+
import { PodContainer, PodContainer_Props } from "./container"
|
|
3
|
+
|
|
4
|
+
import { PodDevice, PodDeviceBackend, PodVolume, PodVolume_Backend } from "../volume"
|
|
5
|
+
|
|
6
|
+
import type { EnvValuePrimitive } from "../../../../env"
|
|
7
|
+
import { v1 } from "../../../../gvks"
|
|
8
|
+
import { K8tsResourceError } from "../../../errors"
|
|
9
|
+
import type { Pod } from "../pod"
|
|
10
|
+
import {
|
|
11
|
+
type PodVolume_Backend_ConfigMap,
|
|
12
|
+
type PodVolume_Backend_EmptyDir,
|
|
13
|
+
type PodVolume_Backend_HostPath,
|
|
14
|
+
type PodVolume_Backend_Pvc,
|
|
15
|
+
type PodVolume_Backend_Secret,
|
|
16
|
+
PodVolume_ConfigMap,
|
|
17
|
+
PodVolume_EmptyDir,
|
|
18
|
+
PodVolume_HostPath,
|
|
19
|
+
PodVolume_Pvc,
|
|
20
|
+
PodVolume_Secret
|
|
21
|
+
} from "../volume/volumes"
|
|
22
|
+
|
|
23
|
+
export class Pod_Scope {
|
|
24
|
+
constructor(protected readonly _parent: Pod) {}
|
|
25
|
+
Container<
|
|
26
|
+
Ports extends string,
|
|
27
|
+
Env extends {
|
|
28
|
+
[key in keyof Env]:
|
|
29
|
+
| {
|
|
30
|
+
$backend: ResourceRef
|
|
31
|
+
key: Env[key] extends object
|
|
32
|
+
? ResourceRef_HasKeys<Env[key]["$backend"], string>
|
|
33
|
+
: never
|
|
34
|
+
}
|
|
35
|
+
| EnvValuePrimitive
|
|
36
|
+
}
|
|
37
|
+
>(name: string, options: PodContainer_Props<Ports, Env>) {
|
|
38
|
+
return new PodContainer(this._parent, name, "main", options)
|
|
39
|
+
}
|
|
40
|
+
InitContainer(name: string, options: PodContainer_Props<never>) {
|
|
41
|
+
return new PodContainer(this._parent, name, "init", options)
|
|
42
|
+
}
|
|
43
|
+
Volume<const P extends PodVolume_Backend_EmptyDir>(name: string, options: P): PodVolume<P>
|
|
44
|
+
Volume<const P extends PodVolume_Backend_HostPath>(name: string, options: P): PodVolume<P>
|
|
45
|
+
Volume<const P extends PodVolume_Backend_ConfigMap<ResourceRef<v1.ConfigMap._>>>(
|
|
46
|
+
name: string,
|
|
47
|
+
options: P
|
|
48
|
+
): PodVolume<P>
|
|
49
|
+
Volume<const P extends PodVolume_Backend_Secret<ResourceRef<v1.Secret._>>>(
|
|
50
|
+
name: string,
|
|
51
|
+
options: P
|
|
52
|
+
): PodVolume<P>
|
|
53
|
+
Volume<const P extends PodVolume_Backend_Pvc<ResourceRef<v1.PersistentVolumeClaim._>>>(
|
|
54
|
+
name: string,
|
|
55
|
+
options: P
|
|
56
|
+
): PodVolume<P>
|
|
57
|
+
Volume(name: string, options: PodVolume_Backend): PodVolume {
|
|
58
|
+
{
|
|
59
|
+
const backend = options.$backend
|
|
60
|
+
if ("kind" in backend) {
|
|
61
|
+
switch (backend.kind) {
|
|
62
|
+
case "EmptyDir":
|
|
63
|
+
return new PodVolume_EmptyDir(this._parent, name, options as any)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if ("kind" in backend && backend.kind === "HostPath") {
|
|
67
|
+
return new PodVolume_HostPath(this._parent, name, options as any)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const backend = options.$backend as ResourceRef
|
|
71
|
+
if (backend.is(v1.ConfigMap._)) {
|
|
72
|
+
return new PodVolume_ConfigMap(this._parent, name, options as any)
|
|
73
|
+
} else if (backend.is(v1.Secret._)) {
|
|
74
|
+
return new PodVolume_Secret(this._parent, name, options as any)
|
|
75
|
+
} else if (backend.is(v1.PersistentVolumeClaim._)) {
|
|
76
|
+
return new PodVolume_Pvc(this._parent, name, options as any)
|
|
77
|
+
}
|
|
78
|
+
throw new K8tsResourceError(`Unsupported volume backend kind: ${backend.kind}`)
|
|
79
|
+
}
|
|
80
|
+
Device(name: string, options: PodDeviceBackend) {
|
|
81
|
+
return new PodDevice(this._parent, name, options)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Port_Full, PortExports } from "@k8ts/instruments"
|
|
2
|
+
import { K8S } from "@k8ts/sample-interfaces"
|
|
3
|
+
import { seq } from "doddle"
|
|
4
|
+
export function toContainerPort(entry: Port_Full): K8S.ContainerPort {
|
|
5
|
+
return {
|
|
6
|
+
containerPort: entry.port,
|
|
7
|
+
name: entry.name,
|
|
8
|
+
protocol: entry.protocol,
|
|
9
|
+
hostPort: entry.hostPort,
|
|
10
|
+
hostIp: entry.hostIp?.text
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function toContainerPorts(ports: PortExports<any>) {
|
|
15
|
+
return seq(ports.values).map(toContainerPort).toArray().pull()
|
|
16
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { K8sResource, ResourcePart, type Resource_Props } from "@k8ts/instruments"
|
|
2
|
+
import type { Metadata_Input } from "@k8ts/metadata"
|
|
3
|
+
import { K8S } from "@k8ts/sample-interfaces"
|
|
4
|
+
import { seq } from "doddle"
|
|
5
|
+
import { merge } from "lodash"
|
|
6
|
+
import type { Workload_Ref } from "../../.."
|
|
7
|
+
import { v1 } from "../../../gvks"
|
|
8
|
+
import { K8tsResourceError } from "../../errors"
|
|
9
|
+
import { createSelectionMetadata } from "../util"
|
|
10
|
+
import type { PodContainer } from "./container"
|
|
11
|
+
import type { ContainerRef } from "./container/ref"
|
|
12
|
+
import { Pod_Scope } from "./container/scope"
|
|
13
|
+
export type Pod_Producer<Ports extends string> = ($pod: Pod_Scope) => Iterable<ContainerRef<Ports>>
|
|
14
|
+
|
|
15
|
+
export interface Pod_Props<Ports extends string> extends Resource_Props<Partial<K8S.PodSpec>> {
|
|
16
|
+
metadata?: Metadata_Input
|
|
17
|
+
containers$: Pod_Producer<Ports>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class Pod<Name extends string = string, Ports extends string = string>
|
|
21
|
+
extends K8sResource<Name, Pod_Props<Ports>>
|
|
22
|
+
implements Workload_Ref<Ports>
|
|
23
|
+
{
|
|
24
|
+
get kind() {
|
|
25
|
+
return v1.Pod._
|
|
26
|
+
}
|
|
27
|
+
private readonly _containers = seq(() => {
|
|
28
|
+
return this.__scope__(this.props.containers$)(new Pod_Scope(this))
|
|
29
|
+
})
|
|
30
|
+
.as<PodContainer<Ports>>()
|
|
31
|
+
.cache()
|
|
32
|
+
|
|
33
|
+
private readonly _mounts = seq(() => this._containers.concatMap(x => x.mounts))
|
|
34
|
+
.uniq()
|
|
35
|
+
.cache()
|
|
36
|
+
private readonly _volumes = seq(() => this._containers.concatMap(x => x.volumes))
|
|
37
|
+
.uniq()
|
|
38
|
+
.cache()
|
|
39
|
+
private readonly _ports = this._containers.map(x => x.ports).reduce((a, b) => a.union(b))
|
|
40
|
+
|
|
41
|
+
get containers() {
|
|
42
|
+
return this._containers.toIterable()
|
|
43
|
+
}
|
|
44
|
+
get mounts() {
|
|
45
|
+
return this._mounts.toIterable()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get volumes() {
|
|
49
|
+
return this._volumes.toIterable()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get ports() {
|
|
53
|
+
return this._ports.pull()
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
protected __kids__() {
|
|
57
|
+
this._containers.toArray().pull()
|
|
58
|
+
return super.__kids__()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
protected __body__(): K8S.PodTemplateSpec {
|
|
62
|
+
const self = this
|
|
63
|
+
const { props } = self
|
|
64
|
+
const containers = self._containers
|
|
65
|
+
const initContainers = containers
|
|
66
|
+
.filter(c => c.subtype === "init")
|
|
67
|
+
.map(x => x["__submanifest__"]())
|
|
68
|
+
.toArray()
|
|
69
|
+
const mainContainers = containers
|
|
70
|
+
.filter(c => c.subtype === "main")
|
|
71
|
+
.map(x => x["__submanifest__"]())
|
|
72
|
+
.toArray()
|
|
73
|
+
|
|
74
|
+
const volumes = self._volumes
|
|
75
|
+
.map(x => {
|
|
76
|
+
if (x.is(ResourcePart)) {
|
|
77
|
+
return x["__submanifest__"]() as K8S.Volume
|
|
78
|
+
}
|
|
79
|
+
throw new K8tsResourceError(`Unsupported volume type: ${x}`)
|
|
80
|
+
})
|
|
81
|
+
.toArray()
|
|
82
|
+
const spec = {
|
|
83
|
+
containers: mainContainers.pull(),
|
|
84
|
+
initContainers: initContainers.pull(),
|
|
85
|
+
volumes: volumes.pull()
|
|
86
|
+
} satisfies K8S.PodSpec
|
|
87
|
+
const spec2 = merge(spec, props.$$manifest)
|
|
88
|
+
return {
|
|
89
|
+
spec: spec2
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get selectorLabels() {
|
|
94
|
+
return createSelectionMetadata(this)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Resource_Props, ResourceEntity, ResourceRef } from "@k8ts/instruments"
|
|
2
|
+
import { ResourcePart } from "@k8ts/instruments"
|
|
3
|
+
import type { K8S } from "@k8ts/sample-interfaces"
|
|
4
|
+
import { merge } from "lodash"
|
|
5
|
+
import { v1 } from "../../../../gvks/default"
|
|
6
|
+
import type { ContainerDeviceMount_Input } from "../container/mounts/device"
|
|
7
|
+
interface PodDeviceBackendPvc extends Resource_Props<K8S.Volume> {
|
|
8
|
+
$backend: ResourceRef<v1.PersistentVolumeClaim._>
|
|
9
|
+
readOnly?: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type PodDeviceBackend = PodDeviceBackendPvc
|
|
13
|
+
|
|
14
|
+
export class PodDevice extends ResourcePart<PodDeviceBackendPvc> {
|
|
15
|
+
get kind() {
|
|
16
|
+
return v1.Pod.Device._
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
constructor(
|
|
20
|
+
parent: ResourceEntity,
|
|
21
|
+
name: string,
|
|
22
|
+
readonly backend: PodDeviceBackendPvc
|
|
23
|
+
) {
|
|
24
|
+
super(parent, name, backend)
|
|
25
|
+
}
|
|
26
|
+
get sourceNamespace() {
|
|
27
|
+
const backend = this.props.$backend as any as ResourceEntity
|
|
28
|
+
return backend.ident.namespace
|
|
29
|
+
}
|
|
30
|
+
protected __needs__() {
|
|
31
|
+
return {
|
|
32
|
+
backend: this.backend.$backend
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
protected __submanifest__(): K8S.Volume {
|
|
37
|
+
const body = {
|
|
38
|
+
name: this.ident.name,
|
|
39
|
+
persistentVolumeClaim: {
|
|
40
|
+
claimName: this.backend.$backend.ident.name,
|
|
41
|
+
readOnly: this.backend.readOnly
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return merge(body, this.props.$$manifest)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Mount(): ContainerDeviceMount_Input {
|
|
48
|
+
return {
|
|
49
|
+
$backend: this
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function make(parent: ResourceEntity, name: string, input: PodDeviceBackend) {
|
|
55
|
+
return new PodDevice(parent, name, input)
|
|
56
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { K8S } from "@k8ts/sample-interfaces"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ResourceEntity,
|
|
5
|
+
ResourcePart,
|
|
6
|
+
toCdkQuantity,
|
|
7
|
+
Units,
|
|
8
|
+
type Resource_Props,
|
|
9
|
+
type ResourceRef,
|
|
10
|
+
type ResourceRef_HasKeys
|
|
11
|
+
} from "@k8ts/instruments"
|
|
12
|
+
import { merge } from "lodash"
|
|
13
|
+
import { v1 } from "../../../../gvks/default"
|
|
14
|
+
import type { HostPath_Type } from "../../../hostpath"
|
|
15
|
+
import {
|
|
16
|
+
type ContainerVolumeMount_Input,
|
|
17
|
+
type ContainerVolumeMount_Unbound
|
|
18
|
+
} from "../container/mounts/volume"
|
|
19
|
+
|
|
20
|
+
export interface PodVolume_Backend_Pvc<
|
|
21
|
+
A extends ResourceRef<v1.PersistentVolumeClaim._> = ResourceRef<v1.PersistentVolumeClaim._>
|
|
22
|
+
> extends Resource_Props<K8S.Volume> {
|
|
23
|
+
$backend: A
|
|
24
|
+
readOnly?: boolean
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface PodVolume_Backend_HostPath extends Resource_Props<K8S.Volume> {
|
|
28
|
+
$backend: {
|
|
29
|
+
kind: "HostPath"
|
|
30
|
+
$noEmit?: boolean
|
|
31
|
+
type?: HostPath_Type
|
|
32
|
+
path: string
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export interface PodVolume_Backend_EmptyDir extends Resource_Props<K8S.Volume> {
|
|
36
|
+
$backend: {
|
|
37
|
+
kind: "EmptyDir"
|
|
38
|
+
medium?: "" | "Memory"
|
|
39
|
+
sizeLimit?: Units.Data
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export interface PodVolume_Backend_ConfigMap<
|
|
43
|
+
A extends ResourceRef<v1.ConfigMap._> = ResourceRef<v1.ConfigMap._>
|
|
44
|
+
> extends Resource_Props<K8S.Volume> {
|
|
45
|
+
$backend: A
|
|
46
|
+
optional?: boolean
|
|
47
|
+
mappings?: {
|
|
48
|
+
[K in ResourceRef_HasKeys<A>]?: string
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface PodVolume_Backend_Secret<
|
|
53
|
+
A extends ResourceRef<v1.Secret._> = ResourceRef<v1.Secret._>
|
|
54
|
+
> extends Resource_Props<K8S.Volume> {
|
|
55
|
+
$backend: A
|
|
56
|
+
optional?: boolean
|
|
57
|
+
mappings?: {
|
|
58
|
+
[K in ResourceRef_HasKeys<A>]?: string
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type PodVolume_Backend = (
|
|
63
|
+
| PodVolume_Backend_Pvc
|
|
64
|
+
| PodVolume_Backend_ConfigMap
|
|
65
|
+
| PodVolume_Backend_Secret
|
|
66
|
+
| PodVolume_Backend_HostPath
|
|
67
|
+
| PodVolume_Backend_EmptyDir
|
|
68
|
+
) &
|
|
69
|
+
Resource_Props<K8S.Volume>
|
|
70
|
+
|
|
71
|
+
type _KeysOf<T> = T extends {
|
|
72
|
+
$backend: {
|
|
73
|
+
keys: infer Ks extends string[]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
? Ks[number]
|
|
77
|
+
: string
|
|
78
|
+
|
|
79
|
+
type _Mapped<T> = T extends {
|
|
80
|
+
mappings: infer M
|
|
81
|
+
}
|
|
82
|
+
? {
|
|
83
|
+
[K in _KeysOf<T>]: K extends keyof M ? M[K] : K
|
|
84
|
+
}[_KeysOf<T>]
|
|
85
|
+
: _KeysOf<T>
|
|
86
|
+
export type PodVolumeBackendKnownPaths<T extends PodVolume_Backend> = string & _Mapped<T>
|
|
87
|
+
|
|
88
|
+
export abstract class PodVolume<
|
|
89
|
+
P extends PodVolume_Backend = PodVolume_Backend
|
|
90
|
+
> extends ResourcePart<P> {
|
|
91
|
+
get kind() {
|
|
92
|
+
return v1.Pod.Volume._
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get namespace() {
|
|
96
|
+
const backend = this.props.$backend
|
|
97
|
+
if (backend instanceof ResourceEntity) {
|
|
98
|
+
const x = backend.ident.namespace
|
|
99
|
+
return x
|
|
100
|
+
}
|
|
101
|
+
return this.__parent__.ident.namespace
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
protected __needs__(): Record<string, ResourceEntity | ResourceEntity[] | undefined> {
|
|
105
|
+
return {
|
|
106
|
+
backend: this.props.$backend instanceof ResourceEntity ? this.props.$backend : undefined
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
mount(
|
|
110
|
+
options?: ContainerVolumeMount_Input<PodVolumeBackendKnownPaths<P>>
|
|
111
|
+
): ContainerVolumeMount_Unbound {
|
|
112
|
+
return {
|
|
113
|
+
...options,
|
|
114
|
+
$backend: this
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
protected abstract __submanifest__(): K8S.Volume
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export class PodVolume_Pvc extends PodVolume<PodVolume_Backend_Pvc> {
|
|
122
|
+
protected __submanifest__(): K8S.Volume {
|
|
123
|
+
const body = {
|
|
124
|
+
name: this.ident.name,
|
|
125
|
+
persistentVolumeClaim: {
|
|
126
|
+
claimName: this.props.$backend.ident.name,
|
|
127
|
+
readOnly: this.props.readOnly
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return merge(body, this.props.$$manifest)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function mappingsToKeyPaths(input: Record<string, string>) {
|
|
135
|
+
const mappings = input
|
|
136
|
+
const arr = Object.entries(mappings).map(([key, value]) => {
|
|
137
|
+
return {
|
|
138
|
+
key: key,
|
|
139
|
+
path: value
|
|
140
|
+
} satisfies K8S.KeyToPath
|
|
141
|
+
})
|
|
142
|
+
if (arr.length === 0) {
|
|
143
|
+
return undefined
|
|
144
|
+
}
|
|
145
|
+
return arr
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export class PodVolume_ConfigMap extends PodVolume<PodVolume_Backend_ConfigMap> {
|
|
149
|
+
protected __submanifest__(): K8S.Volume {
|
|
150
|
+
const mappings = mappingsToKeyPaths(this.props.mappings ?? {})
|
|
151
|
+
|
|
152
|
+
const body = {
|
|
153
|
+
name: this.ident.name,
|
|
154
|
+
configMap: {
|
|
155
|
+
name: this.props.$backend.ident.name,
|
|
156
|
+
optional: this.props.optional,
|
|
157
|
+
items: mappings
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return merge(body, this.props.$$manifest)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export class PodVolume_Secret<
|
|
165
|
+
Source extends ResourceRef<v1.Secret._>
|
|
166
|
+
> extends PodVolume<PodVolume_Backend_Secret> {
|
|
167
|
+
protected __submanifest__(): K8S.Volume {
|
|
168
|
+
const mappings = mappingsToKeyPaths(this.props.mappings ?? {})
|
|
169
|
+
|
|
170
|
+
const body = {
|
|
171
|
+
name: this.ident.name,
|
|
172
|
+
secret: {
|
|
173
|
+
secretName: this.props.$backend.ident.name,
|
|
174
|
+
optional: this.props.optional,
|
|
175
|
+
items: mappings
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return merge(body, this.props.$$manifest)
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export class PodVolume_HostPath extends PodVolume<PodVolume_Backend_HostPath> {
|
|
183
|
+
protected __submanifest__(): K8S.Volume {
|
|
184
|
+
const body = {
|
|
185
|
+
name: this.ident.name,
|
|
186
|
+
hostPath: {
|
|
187
|
+
path: this.props.$backend.path,
|
|
188
|
+
type: this.props.$backend.kind
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return merge(body, this.props.$$manifest)
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export class PodVolume_EmptyDir extends PodVolume<PodVolume_Backend_EmptyDir> {
|
|
196
|
+
protected __submanifest__(): K8S.Volume {
|
|
197
|
+
const body = {
|
|
198
|
+
medium: this.props.$backend.medium,
|
|
199
|
+
sizeLimit: toCdkQuantity(this.props.$backend.sizeLimit)
|
|
200
|
+
} satisfies K8S.EmptyDirVolumeSource
|
|
201
|
+
return merge(body, this.props.$$manifest)
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./statefulset"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Resource_Props_Top } from "@k8ts/instruments"
|
|
2
|
+
import type { K8S } from "@k8ts/sample-interfaces"
|
|
3
|
+
import type { Pod_Props, Service_Props } from "../../.."
|
|
4
|
+
import type { ContainerRef } from "../pod/container"
|
|
5
|
+
import type { StatefulSet_Scope } from "./scope"
|
|
6
|
+
|
|
7
|
+
export interface StatefulSet_UpdateStrategy_RollingUpdate
|
|
8
|
+
extends K8S.RollingUpdateStatefulSetStrategy {
|
|
9
|
+
type: "RollingUpdate"
|
|
10
|
+
}
|
|
11
|
+
export interface StatefulSet_UpdateStrategy_OnDelete {
|
|
12
|
+
type: "OnDelete"
|
|
13
|
+
}
|
|
14
|
+
export type StatefulSet_UpdateStrategy =
|
|
15
|
+
| StatefulSet_UpdateStrategy_RollingUpdate
|
|
16
|
+
| StatefulSet_UpdateStrategy_OnDelete
|
|
17
|
+
|
|
18
|
+
export type StatefulSet_Producer<Ports extends string> = (
|
|
19
|
+
scope: StatefulSet_Scope
|
|
20
|
+
) => Iterable<ContainerRef<Ports>>
|
|
21
|
+
export interface StatefulSet_Props<
|
|
22
|
+
Ports extends string,
|
|
23
|
+
SvcPorts extends NoInfer<Ports>,
|
|
24
|
+
SvcName extends string
|
|
25
|
+
> extends Resource_Props_Top<K8S.StatefulSetSpec> {
|
|
26
|
+
$replicas?: number
|
|
27
|
+
$template: Omit<Pod_Props<Ports>, "containers$"> & {
|
|
28
|
+
containers$: StatefulSet_Producer<Ports>
|
|
29
|
+
}
|
|
30
|
+
$service: {
|
|
31
|
+
name: SvcName
|
|
32
|
+
} & Omit<Service_Props<Ports, SvcPorts>, "$backend" | "$frontend">
|
|
33
|
+
$updateStrategy?: StatefulSet_UpdateStrategy
|
|
34
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TemplateOrigin } from "@k8ts/instruments"
|
|
2
|
+
import type { Pvc_Props, PvVolumeMode } from "../../persistent"
|
|
3
|
+
import { Pvc } from "../../persistent"
|
|
4
|
+
import { Pod_Scope } from "../pod/container/scope"
|
|
5
|
+
export class StatefulSet_Scope extends Pod_Scope {
|
|
6
|
+
constructor(
|
|
7
|
+
podScope: Pod_Scope,
|
|
8
|
+
private readonly _template: TemplateOrigin
|
|
9
|
+
) {
|
|
10
|
+
super(podScope["_parent"])
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
PvcTemplate<Mode extends PvVolumeMode>(name: string, props: Pvc_Props<Mode>) {
|
|
14
|
+
const pvc = new Pvc(name, props, {
|
|
15
|
+
origins: {
|
|
16
|
+
own: this._template,
|
|
17
|
+
subscope: this["_parent"]["__origin__"]
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
return this.Volume(pvc.ident.name, {
|
|
21
|
+
$backend: pvc,
|
|
22
|
+
$noEmit: true
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|