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
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Port_Exports,
|
|
3
|
-
ResourcesSpec,
|
|
4
|
-
Unit,
|
|
5
|
-
type CmdBuilder,
|
|
6
|
-
type Port_Exports_Input,
|
|
7
|
-
type Rsc_Ref,
|
|
8
|
-
type TaggedImage
|
|
9
|
-
} from "@k8ts/instruments"
|
|
10
|
-
import type { CDK } from "@k8ts/sample-interfaces"
|
|
11
|
-
import { toContainerPorts } from "../../utils/adapters"
|
|
12
|
-
|
|
13
|
-
import { Rsc_Entity, Rsc_Part, Rsc_Top } from "@k8ts/instruments"
|
|
14
|
-
import { seq } from "doddle"
|
|
15
|
-
import { mapKeys, mapValues, omitBy } from "lodash"
|
|
16
|
-
import { Env } from "../../../env"
|
|
17
|
-
import type { Env_Leaf } from "../../../env/types"
|
|
18
|
-
import { v1 } from "../../../kinds/default"
|
|
19
|
-
import { Pod_Device, Pod_Volume } from "../volume"
|
|
20
|
-
import { Container_Device_Mount, type Container_Device_Mount_Source } from "./mounts/device"
|
|
21
|
-
import { Container_Volume_Mount, type Container_Volume_Mount_Source } from "./mounts/volume"
|
|
22
|
-
const container_ResourcesSpec = ResourcesSpec.make({
|
|
23
|
-
cpu: Unit.Cpu,
|
|
24
|
-
memory: Unit.Data
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
type Pod_Container_Resources = (typeof container_ResourcesSpec)["__INPUT__"]
|
|
28
|
-
type Pod_Container_Mount_Any = Container_Volume_Mount_Source | Container_Device_Mount_Source
|
|
29
|
-
export type Pod_Container_Mounts = {
|
|
30
|
-
[key: string]: Pod_Container_Mount_Any
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface Pod_Container_Env_From {
|
|
34
|
-
source: Rsc_Ref<v1.ConfigMap._> | Rsc_Ref<v1.Secret._>
|
|
35
|
-
prefix?: string
|
|
36
|
-
optional?: boolean
|
|
37
|
-
}
|
|
38
|
-
export interface Pod_Container_Props<
|
|
39
|
-
Ports extends string = never,
|
|
40
|
-
_Env extends Record<string, Env_Leaf> = Record<string, Env_Leaf>
|
|
41
|
-
> extends Omit<CDK.Container, "name"> {
|
|
42
|
-
$image: TaggedImage
|
|
43
|
-
$ports?: Port_Exports_Input<Ports>
|
|
44
|
-
$command?: CmdBuilder
|
|
45
|
-
$mounts?: Pod_Container_Mounts
|
|
46
|
-
$env?: _Env
|
|
47
|
-
$envFrom?: Pod_Container_Env_From[]
|
|
48
|
-
$resources?: Pod_Container_Resources
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class Pod_Container<Ports extends string = string> extends Rsc_Part<
|
|
52
|
-
Pod_Container_Props<Ports>
|
|
53
|
-
> {
|
|
54
|
-
__PORTS__!: Ports
|
|
55
|
-
get kind() {
|
|
56
|
-
return v1.Pod.Container._
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
protected __needs__(): Record<string, Rsc_Ref | Rsc_Ref[]> {
|
|
60
|
-
const a = this.mounts
|
|
61
|
-
return mapValues(
|
|
62
|
-
mapKeys(a, x => x.path),
|
|
63
|
-
x => x.backend
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
get mounts() {
|
|
67
|
-
return seq(Object.entries(this.props.$mounts ?? {}))
|
|
68
|
-
.map(([path, mount]: [string, Pod_Container_Mount_Any]) => {
|
|
69
|
-
if (mount.$backend.is(Pod_Device)) {
|
|
70
|
-
return new Container_Device_Mount(this, {
|
|
71
|
-
$backend: mount.$backend,
|
|
72
|
-
mountPath: path
|
|
73
|
-
})
|
|
74
|
-
} else if (mount.$backend.is(Pod_Volume)) {
|
|
75
|
-
const x = mount as any
|
|
76
|
-
return new Container_Volume_Mount(this, {
|
|
77
|
-
$backend: mount.$backend,
|
|
78
|
-
mountPath: path,
|
|
79
|
-
readOnly: x.readOnly,
|
|
80
|
-
subPath: x.subPath
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
throw new Error(`Unsupported mount backend type: ${mount.$backend}`)
|
|
84
|
-
})
|
|
85
|
-
.toArray()
|
|
86
|
-
.pull()
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
get volumes() {
|
|
90
|
-
return seq(this.mounts.map(x => x.backend))
|
|
91
|
-
.uniq()
|
|
92
|
-
.toArray()
|
|
93
|
-
.pull()
|
|
94
|
-
}
|
|
95
|
-
get ports() {
|
|
96
|
-
return Port_Exports.make(this.props.$ports)
|
|
97
|
-
}
|
|
98
|
-
protected __submanifest__(): CDK.Container {
|
|
99
|
-
const self = this
|
|
100
|
-
const { $image, $ports, $command, $env } = self.props
|
|
101
|
-
const untaggedProps = omitBy(self.props, (_, k) => k.startsWith("$"))
|
|
102
|
-
let resourcesObject = self._resources()?.toObject()
|
|
103
|
-
const containerPorts =
|
|
104
|
-
$ports &&
|
|
105
|
-
seq(toContainerPorts(Port_Exports.make($ports)).values())
|
|
106
|
-
.toArray()
|
|
107
|
-
.pull()
|
|
108
|
-
|
|
109
|
-
const env = Env($env)
|
|
110
|
-
for (const [key, value] of env.entries) {
|
|
111
|
-
if (typeof value !== "object") {
|
|
112
|
-
continue
|
|
113
|
-
}
|
|
114
|
-
if (!value) {
|
|
115
|
-
continue
|
|
116
|
-
}
|
|
117
|
-
const backend = value.$backend
|
|
118
|
-
if (backend instanceof Rsc_Entity) {
|
|
119
|
-
if (backend.namespace !== self.namespace) {
|
|
120
|
-
throw new Error(
|
|
121
|
-
`Environment variable reference "${key}" must be in the same namespace as the container "${self}", but was ${backend}"`
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
for (const vol of self.volumes) {
|
|
127
|
-
if (vol.namespace !== self.namespace) {
|
|
128
|
-
throw new Error(
|
|
129
|
-
`Volume reference "${vol}" had an inherited namespace ${vol.namespace}, which is different from the container "${self}"`
|
|
130
|
-
)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
const envFroms = (self.props.$envFrom ?? []).map(ef => {
|
|
134
|
-
const source = ef.source as any as Rsc_Entity
|
|
135
|
-
if (source.namespace !== self.namespace) {
|
|
136
|
-
throw new Error(
|
|
137
|
-
`EnvFrom source reference "${source}" must be in the same namespace as the container "${self}"`
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
if (source.is(v1.Secret._)) {
|
|
141
|
-
return {
|
|
142
|
-
secretRef: {
|
|
143
|
-
optional: ef.optional,
|
|
144
|
-
name: source.name
|
|
145
|
-
}
|
|
146
|
-
} as CDK.EnvFromSource
|
|
147
|
-
} else if (source.is(v1.ConfigMap._)) {
|
|
148
|
-
return {
|
|
149
|
-
configMapRef: {
|
|
150
|
-
optional: ef.optional,
|
|
151
|
-
name: source.name
|
|
152
|
-
}
|
|
153
|
-
} as CDK.EnvFromSource
|
|
154
|
-
} else {
|
|
155
|
-
throw new Error(
|
|
156
|
-
`EnvFrom source reference "${source}" must be a ConfigMap or Secret, but was ${source.kind}`
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
const container: CDK.Container = {
|
|
161
|
-
...untaggedProps,
|
|
162
|
-
name: self.name,
|
|
163
|
-
image: $image.toString(),
|
|
164
|
-
ports: containerPorts,
|
|
165
|
-
resources: resourcesObject,
|
|
166
|
-
command: $command?.toArray(),
|
|
167
|
-
env: Env($env).toEnvVars(),
|
|
168
|
-
envFrom: envFroms,
|
|
169
|
-
...self._groupedMounts()
|
|
170
|
-
}
|
|
171
|
-
return container
|
|
172
|
-
}
|
|
173
|
-
constructor(
|
|
174
|
-
parent: Rsc_Entity,
|
|
175
|
-
name: string,
|
|
176
|
-
readonly subtype: "init" | "main",
|
|
177
|
-
override readonly props: Pod_Container_Props<Ports>
|
|
178
|
-
) {
|
|
179
|
-
super(parent, name, props)
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
private _groupedMounts() {
|
|
183
|
-
const volumeMounts = [] as CDK.VolumeMount[]
|
|
184
|
-
const volumeDevices = [] as CDK.VolumeDevice[]
|
|
185
|
-
for (const mnt of this.mounts) {
|
|
186
|
-
if (mnt.backend.is(Pod_Device)) {
|
|
187
|
-
const deviceMount = mnt as Container_Device_Mount
|
|
188
|
-
volumeDevices!.push(deviceMount["__submanifest__"]())
|
|
189
|
-
} else if (mnt.backend.is(Pod_Volume)) {
|
|
190
|
-
const volumeMount = mnt as Container_Volume_Mount
|
|
191
|
-
volumeMounts!.push(volumeMount["__submanifest__"]())
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
return {
|
|
195
|
-
volumeMounts: volumeMounts.length > 0 ? volumeMounts : undefined,
|
|
196
|
-
volumeDevices: volumeDevices.length > 0 ? volumeDevices : undefined
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
private _resources() {
|
|
200
|
-
if (!this.props.$resources) {
|
|
201
|
-
return undefined
|
|
202
|
-
}
|
|
203
|
-
const result = container_ResourcesSpec.parse(this.props.$resources)
|
|
204
|
-
return result
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export function make<Ports extends string>(
|
|
209
|
-
parent: Rsc_Top,
|
|
210
|
-
name: string,
|
|
211
|
-
subtype: "init" | "main",
|
|
212
|
-
props: Pod_Container_Props<Ports>
|
|
213
|
-
) {
|
|
214
|
-
return new Pod_Container(parent, name, subtype, props)
|
|
215
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Rsc_Part, type Ident_Rsc_Part, type Rsc_Entity, type Rsc_Ref } from "@k8ts/instruments"
|
|
2
|
-
import type { CDK } from "@k8ts/sample-interfaces"
|
|
3
|
-
import { v1 } from "../../../../kinds"
|
|
4
|
-
|
|
5
|
-
export interface Container_Device_Mount_Source {
|
|
6
|
-
$backend: Rsc_Ref<v1.Pod.Device._>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface Container_Mount_Device_Props extends Container_Device_Mount_Source {
|
|
10
|
-
mountPath: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class Container_Device_Mount extends Rsc_Part<Container_Mount_Device_Props> {
|
|
14
|
-
constructor(parent: Rsc_Entity, props: Container_Mount_Device_Props) {
|
|
15
|
-
super(parent, props.$backend.name, props)
|
|
16
|
-
}
|
|
17
|
-
get kind() {
|
|
18
|
-
return v1.Pod.Container.DeviceMount._ satisfies Ident_Rsc_Part
|
|
19
|
-
}
|
|
20
|
-
get backend() {
|
|
21
|
-
return this.props.$backend
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
get path() {
|
|
25
|
-
return this.props.mountPath
|
|
26
|
-
}
|
|
27
|
-
protected __submanifest__(): CDK.VolumeDevice {
|
|
28
|
-
return {
|
|
29
|
-
devicePath: this.props.mountPath,
|
|
30
|
-
name: this.props.$backend.name
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Rsc_Part, type Rsc_Entity, type Rsc_Ref } from "@k8ts/instruments"
|
|
2
|
-
import type { CDK } from "@k8ts/sample-interfaces"
|
|
3
|
-
import { v1 } from "../../../../kinds"
|
|
4
|
-
|
|
5
|
-
export interface Container_Volume_Mount_Attrs<SubPaths extends string = string> {
|
|
6
|
-
subPath?: SubPaths
|
|
7
|
-
readOnly?: boolean
|
|
8
|
-
}
|
|
9
|
-
export interface Container_Volume_Mount_Source extends Container_Volume_Mount_Attrs {
|
|
10
|
-
$backend: Rsc_Ref<v1.Pod.Volume._>
|
|
11
|
-
}
|
|
12
|
-
export interface Container_Volume_Mount_Props extends Container_Volume_Mount_Source {
|
|
13
|
-
mountPath: string
|
|
14
|
-
}
|
|
15
|
-
export class Container_Volume_Mount extends Rsc_Part<Container_Volume_Mount_Props> {
|
|
16
|
-
constructor(parent: Rsc_Entity, props: Container_Volume_Mount_Props) {
|
|
17
|
-
super(parent, props.$backend.name, props)
|
|
18
|
-
}
|
|
19
|
-
get kind() {
|
|
20
|
-
return v1.Pod.Container.VolumeMount._
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
get path() {
|
|
24
|
-
return this.props.mountPath
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get backend() {
|
|
28
|
-
return this.props.$backend
|
|
29
|
-
}
|
|
30
|
-
protected __submanifest__(): CDK.VolumeMount {
|
|
31
|
-
return {
|
|
32
|
-
name: this.props.$backend.name,
|
|
33
|
-
mountPath: this.props.mountPath,
|
|
34
|
-
readOnly: this.props.readOnly,
|
|
35
|
-
subPath: this.props.subPath
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { Rsc_Part, Rsc_Ref, type Rsc_Ref_Keys_Of } from "@k8ts/instruments"
|
|
2
|
-
import { Meta } from "@k8ts/metadata"
|
|
3
|
-
import { CDK } from "@k8ts/sample-interfaces"
|
|
4
|
-
import { seq } from "doddle"
|
|
5
|
-
import { omitBy } from "lodash"
|
|
6
|
-
import type { Env_Value } from "../../env/types"
|
|
7
|
-
import { v1 } from "../../kinds/default"
|
|
8
|
-
import { Pod_Container, type Pod_Container_Props } from "./container"
|
|
9
|
-
import { Pod_Device, type Pod_Device_Backend } from "./volume/devices"
|
|
10
|
-
import {
|
|
11
|
-
Pod_Volume,
|
|
12
|
-
Pod_Volume_ConfigMap,
|
|
13
|
-
Pod_Volume_HostPath,
|
|
14
|
-
Pod_Volume_Pvc,
|
|
15
|
-
Pod_Volume_Secret,
|
|
16
|
-
type Pod_Volume_Backend,
|
|
17
|
-
type Pod_Volume_Backend_ConfigMap,
|
|
18
|
-
type Pod_Volume_Backend_HostPath,
|
|
19
|
-
type Pod_Volume_Backend_Pvc,
|
|
20
|
-
type Pod_Volume_Backend_Secret
|
|
21
|
-
} from "./volume/volumes"
|
|
22
|
-
export type Pod_Props_Original = Omit<CDK.PodSpec, "containers" | "initContainers" | "volumes">
|
|
23
|
-
type Container_Ref<Ports extends string> = Rsc_Ref<v1.Pod.Container._> & {
|
|
24
|
-
__PORTS__: Ports
|
|
25
|
-
}
|
|
26
|
-
export type Pod_Container_Producer<Ports extends string> = (
|
|
27
|
-
scope: Pod_Scope
|
|
28
|
-
) => Iterable<Container_Ref<Ports>>
|
|
29
|
-
|
|
30
|
-
export interface Pod_Props<Ports extends string> extends Pod_Props_Original {
|
|
31
|
-
meta?: Meta.Input
|
|
32
|
-
$POD: Pod_Container_Producer<Ports>
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export class Pod_Template<Ports extends string = string> extends Rsc_Part<Pod_Props<Ports>> {
|
|
36
|
-
get kind() {
|
|
37
|
-
return v1.PodTemplate._
|
|
38
|
-
}
|
|
39
|
-
private readonly _containers = seq(() => this.props.$POD(new Pod_Scope(this)))
|
|
40
|
-
.as<Pod_Container<Ports>>()
|
|
41
|
-
.cache()
|
|
42
|
-
|
|
43
|
-
private readonly _mounts = seq(() => this._containers.concatMap(x => x.mounts))
|
|
44
|
-
.uniq()
|
|
45
|
-
.cache()
|
|
46
|
-
private readonly _volumes = seq(() => this._containers.concatMap(x => x.volumes))
|
|
47
|
-
.uniq()
|
|
48
|
-
.cache()
|
|
49
|
-
private readonly _ports = this._containers.map(x => x.ports).reduce((a, b) => a.union(b))
|
|
50
|
-
|
|
51
|
-
get containers() {
|
|
52
|
-
return this._containers.toIterable()
|
|
53
|
-
}
|
|
54
|
-
get mounts() {
|
|
55
|
-
return this._mounts.toIterable()
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get volumes() {
|
|
59
|
-
return this._volumes.toIterable()
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
get ports() {
|
|
63
|
-
return this._ports.pull()
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
protected __kids__() {
|
|
67
|
-
return [...this._containers, ...this.volumes]
|
|
68
|
-
}
|
|
69
|
-
protected __metadata__() {
|
|
70
|
-
return {
|
|
71
|
-
name: this.name,
|
|
72
|
-
labels: this.meta.labels,
|
|
73
|
-
annotations: this.meta.annotations
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
readonly meta = Meta.make(this.props.meta ?? {}).add("name", this.name)
|
|
77
|
-
|
|
78
|
-
protected __submanifest__(): CDK.PodTemplateSpec {
|
|
79
|
-
const self = this
|
|
80
|
-
const { props } = self
|
|
81
|
-
const containers = self._containers
|
|
82
|
-
const initContainers = containers
|
|
83
|
-
.filter(c => c.subtype === "init")
|
|
84
|
-
.map(x => x["__submanifest__"]())
|
|
85
|
-
.toArray()
|
|
86
|
-
const mainContainers = containers
|
|
87
|
-
.filter(c => c.subtype === "main")
|
|
88
|
-
.map(x => x["__submanifest__"]())
|
|
89
|
-
.toArray()
|
|
90
|
-
|
|
91
|
-
const volumes = self._volumes
|
|
92
|
-
.map(x => {
|
|
93
|
-
if (x.is(Pod_Volume)) {
|
|
94
|
-
return x["__submanifest__"]()
|
|
95
|
-
} else if (x.is(Pod_Device)) {
|
|
96
|
-
return x["__submanifest__"]()
|
|
97
|
-
}
|
|
98
|
-
throw new Error(`Unsupported volume type: ${x}`)
|
|
99
|
-
})
|
|
100
|
-
.toArray()
|
|
101
|
-
return {
|
|
102
|
-
metadata: self.__metadata__(),
|
|
103
|
-
spec: {
|
|
104
|
-
...omitBy(props, (x, k) => k.startsWith("$")),
|
|
105
|
-
containers: mainContainers.pull(),
|
|
106
|
-
initContainers: initContainers.pull(),
|
|
107
|
-
volumes: volumes.pull()
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export class Pod_Scope {
|
|
114
|
-
constructor(private readonly _parent: Pod_Template) {}
|
|
115
|
-
Container<
|
|
116
|
-
Ports extends string,
|
|
117
|
-
Env extends {
|
|
118
|
-
[key in keyof Env]:
|
|
119
|
-
| {
|
|
120
|
-
$backend: Rsc_Ref
|
|
121
|
-
key: Env[key] extends object
|
|
122
|
-
? Rsc_Ref_Keys_Of<Env[key]["$backend"], string>
|
|
123
|
-
: never
|
|
124
|
-
}
|
|
125
|
-
| Env_Value
|
|
126
|
-
}
|
|
127
|
-
>(name: string, options: Pod_Container_Props<Ports, Env>) {
|
|
128
|
-
return new Pod_Container(this._parent, name, "main", options)
|
|
129
|
-
}
|
|
130
|
-
InitContainer(name: string, options: Pod_Container_Props<never>) {
|
|
131
|
-
return new Pod_Container(this._parent, name, "init", options)
|
|
132
|
-
}
|
|
133
|
-
Volume<const P extends Pod_Volume_Backend_HostPath>(name: string, options: P): Pod_Volume<P>
|
|
134
|
-
Volume<const P extends Pod_Volume_Backend_ConfigMap<Rsc_Ref<v1.ConfigMap._>>>(
|
|
135
|
-
name: string,
|
|
136
|
-
options: P
|
|
137
|
-
): Pod_Volume<P>
|
|
138
|
-
Volume<const P extends Pod_Volume_Backend_Secret<Rsc_Ref<v1.Secret._>>>(
|
|
139
|
-
name: string,
|
|
140
|
-
options: P
|
|
141
|
-
): Pod_Volume<P>
|
|
142
|
-
Volume<const P extends Pod_Volume_Backend_Pvc<Rsc_Ref<v1.PersistentVolumeClaim._>>>(
|
|
143
|
-
name: string,
|
|
144
|
-
options: P
|
|
145
|
-
): Pod_Volume<P>
|
|
146
|
-
Volume(name: string, options: Pod_Volume_Backend): Pod_Volume {
|
|
147
|
-
{
|
|
148
|
-
const backend = options.$backend
|
|
149
|
-
if (backend.kind === "HostPath") {
|
|
150
|
-
return new Pod_Volume_HostPath(this._parent, name, options as any)
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
const backend = options.$backend as Rsc_Ref
|
|
154
|
-
if (backend.is(v1.ConfigMap._)) {
|
|
155
|
-
return new Pod_Volume_ConfigMap(this._parent, name, options as any)
|
|
156
|
-
} else if (backend.is(v1.Secret._)) {
|
|
157
|
-
return new Pod_Volume_Secret(this._parent, name, options as any)
|
|
158
|
-
} else if (backend.is(v1.PersistentVolumeClaim._)) {
|
|
159
|
-
return new Pod_Volume_Pvc(this._parent, name, options as any)
|
|
160
|
-
}
|
|
161
|
-
throw new Error(`Unsupported volume backend kind: ${backend.kind}`)
|
|
162
|
-
}
|
|
163
|
-
Device(name: string, options: Pod_Device_Backend) {
|
|
164
|
-
return new Pod_Device(this._parent, name, options)
|
|
165
|
-
}
|
|
166
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Rsc_Entity } from "@k8ts/instruments"
|
|
2
|
-
import { Rsc_Part } from "@k8ts/instruments"
|
|
3
|
-
import type { CDK } from "@k8ts/sample-interfaces"
|
|
4
|
-
import { v1 } from "../../../kinds/default"
|
|
5
|
-
import { Pvc } from "../../persistent"
|
|
6
|
-
import type { Container_Device_Mount_Source } from "../container/mounts/device"
|
|
7
|
-
interface Pod_Device_Backend_Pvc {
|
|
8
|
-
$backend: Pvc<"Block">
|
|
9
|
-
readOnly?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type Pod_Device_Backend = Pod_Device_Backend_Pvc
|
|
13
|
-
|
|
14
|
-
export class Pod_Device extends Rsc_Part<Pod_Device_Backend_Pvc> {
|
|
15
|
-
get kind() {
|
|
16
|
-
return v1.Pod.Device._
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
constructor(
|
|
20
|
-
parent: Rsc_Entity,
|
|
21
|
-
name: string,
|
|
22
|
-
readonly backend: Pod_Device_Backend_Pvc
|
|
23
|
-
) {
|
|
24
|
-
super(parent, name, backend)
|
|
25
|
-
}
|
|
26
|
-
get sourceNamespace() {
|
|
27
|
-
const backend = this.props.$backend as any as Rsc_Entity
|
|
28
|
-
return backend.namespace
|
|
29
|
-
}
|
|
30
|
-
protected __needs__() {
|
|
31
|
-
return {
|
|
32
|
-
backend: this.backend.$backend
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
protected __submanifest__(): CDK.Volume {
|
|
37
|
-
return {
|
|
38
|
-
name: this.name,
|
|
39
|
-
persistentVolumeClaim: {
|
|
40
|
-
claimName: this.backend.$backend.name,
|
|
41
|
-
readOnly: this.backend.readOnly
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
Mount(): Container_Device_Mount_Source {
|
|
47
|
-
return {
|
|
48
|
-
$backend: this
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function make(parent: Rsc_Entity, name: string, input: Pod_Device_Backend) {
|
|
54
|
-
return new Pod_Device(parent, name, input)
|
|
55
|
-
}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import type { CDK } from "@k8ts/sample-interfaces"
|
|
2
|
-
|
|
3
|
-
import { Rsc_Entity, Rsc_Part, type Rsc_Ref, type Rsc_Ref_Keys_Of } from "@k8ts/instruments"
|
|
4
|
-
import { v1 } from "../../../kinds/default"
|
|
5
|
-
import type { HostPathType } from "../../hostpath"
|
|
6
|
-
import {
|
|
7
|
-
type Container_Volume_Mount_Attrs,
|
|
8
|
-
type Container_Volume_Mount_Source
|
|
9
|
-
} from "../container/mounts/volume"
|
|
10
|
-
|
|
11
|
-
export interface Pod_Volume_Backend_Pvc<
|
|
12
|
-
A extends Rsc_Ref<v1.PersistentVolumeClaim._> = Rsc_Ref<v1.PersistentVolumeClaim._>
|
|
13
|
-
> {
|
|
14
|
-
$backend: A
|
|
15
|
-
readOnly?: boolean
|
|
16
|
-
}
|
|
17
|
-
const allowedVolumeResourceKinds = [v1.ConfigMap._, v1.Secret._] as const
|
|
18
|
-
type VolumeResourceKind = (typeof allowedVolumeResourceKinds)[number]
|
|
19
|
-
export type AllowedResources = Rsc_Ref<VolumeResourceKind>
|
|
20
|
-
|
|
21
|
-
export interface Pod_Volume_Backend_HostPath {
|
|
22
|
-
$backend: {
|
|
23
|
-
kind: "HostPath"
|
|
24
|
-
type?: HostPathType
|
|
25
|
-
path: string
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export interface Pod_Volume_Backend_ConfigMap<
|
|
29
|
-
A extends Rsc_Ref<v1.ConfigMap._> = Rsc_Ref<v1.ConfigMap._>
|
|
30
|
-
> {
|
|
31
|
-
$backend: A
|
|
32
|
-
optional?: boolean
|
|
33
|
-
mappings?: {
|
|
34
|
-
[K in Rsc_Ref_Keys_Of<A>]?: string
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface Pod_Volume_Backend_Secret<A extends Rsc_Ref<v1.Secret._> = Rsc_Ref<v1.Secret._>> {
|
|
39
|
-
$backend: A
|
|
40
|
-
optional?: boolean
|
|
41
|
-
mappings?: {
|
|
42
|
-
[K in Rsc_Ref_Keys_Of<A>]?: string
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export type Pod_Volume_Backend =
|
|
47
|
-
| Pod_Volume_Backend_Pvc
|
|
48
|
-
| Pod_Volume_Backend_ConfigMap
|
|
49
|
-
| Pod_Volume_Backend_Secret
|
|
50
|
-
| Pod_Volume_Backend_HostPath
|
|
51
|
-
|
|
52
|
-
type _KeysOf<T> = T extends {
|
|
53
|
-
$backend: {
|
|
54
|
-
keys: infer Ks extends string[]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
? Ks[number]
|
|
58
|
-
: never
|
|
59
|
-
|
|
60
|
-
type _Mapped<T> = T extends {
|
|
61
|
-
mappings: infer M
|
|
62
|
-
}
|
|
63
|
-
? {
|
|
64
|
-
[K in _KeysOf<T>]: K extends keyof M ? M[K] : K
|
|
65
|
-
}[_KeysOf<T>]
|
|
66
|
-
: _KeysOf<T>
|
|
67
|
-
export type Pod_Volume_Backend_Known_Paths<T extends Pod_Volume_Backend> = string & _Mapped<T>
|
|
68
|
-
|
|
69
|
-
export abstract class Pod_Volume<
|
|
70
|
-
P extends Pod_Volume_Backend = Pod_Volume_Backend
|
|
71
|
-
> extends Rsc_Part<P> {
|
|
72
|
-
get kind() {
|
|
73
|
-
return v1.Pod.Volume._
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
get namespace() {
|
|
77
|
-
const backend = this.props.$backend
|
|
78
|
-
if (backend instanceof Rsc_Entity) {
|
|
79
|
-
const x = backend.namespace
|
|
80
|
-
return x
|
|
81
|
-
}
|
|
82
|
-
return undefined
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
protected __needs__(): Record<string, Rsc_Entity | Rsc_Entity[] | undefined> {
|
|
86
|
-
return {
|
|
87
|
-
backend: this.props.$backend instanceof Rsc_Entity ? this.props.$backend : undefined
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
Mount(
|
|
91
|
-
options?: Container_Volume_Mount_Attrs<Pod_Volume_Backend_Known_Paths<P>>
|
|
92
|
-
): Container_Volume_Mount_Source {
|
|
93
|
-
return {
|
|
94
|
-
...options,
|
|
95
|
-
$backend: this
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
protected abstract __submanifest__(): CDK.Volume
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export class Pod_Volume_Pvc extends Pod_Volume<Pod_Volume_Backend_Pvc> {
|
|
103
|
-
protected __submanifest__(): CDK.Volume {
|
|
104
|
-
return {
|
|
105
|
-
name: this.name,
|
|
106
|
-
persistentVolumeClaim: {
|
|
107
|
-
claimName: this.props.$backend.name,
|
|
108
|
-
readOnly: this.props.readOnly
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function mappingsToKeyPaths(input: Record<string, string>) {
|
|
115
|
-
const mappings = input
|
|
116
|
-
const arr = Object.entries(mappings).map(([key, value]) => {
|
|
117
|
-
return {
|
|
118
|
-
key: key,
|
|
119
|
-
path: value
|
|
120
|
-
} satisfies CDK.KeyToPath
|
|
121
|
-
})
|
|
122
|
-
if (arr.length === 0) {
|
|
123
|
-
return undefined
|
|
124
|
-
}
|
|
125
|
-
return arr
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export class Pod_Volume_ConfigMap extends Pod_Volume<Pod_Volume_Backend_ConfigMap> {
|
|
129
|
-
protected __submanifest__(): CDK.Volume {
|
|
130
|
-
const mappings = mappingsToKeyPaths(this.props.mappings ?? {})
|
|
131
|
-
|
|
132
|
-
return {
|
|
133
|
-
name: this.name,
|
|
134
|
-
configMap: {
|
|
135
|
-
name: this.props.$backend.name,
|
|
136
|
-
optional: this.props.optional,
|
|
137
|
-
items: mappings
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export class Pod_Volume_Secret<
|
|
144
|
-
Source extends Rsc_Ref<v1.Secret._>
|
|
145
|
-
> extends Pod_Volume<Pod_Volume_Backend_Secret> {
|
|
146
|
-
protected __submanifest__(): CDK.Volume {
|
|
147
|
-
const mappings = mappingsToKeyPaths(this.props.mappings ?? {})
|
|
148
|
-
|
|
149
|
-
return {
|
|
150
|
-
name: this.name,
|
|
151
|
-
secret: {
|
|
152
|
-
secretName: this.props.$backend.name,
|
|
153
|
-
optional: this.props.optional,
|
|
154
|
-
items: mappings
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export class Pod_Volume_HostPath extends Pod_Volume<Pod_Volume_Backend_HostPath> {
|
|
161
|
-
protected __submanifest__(): CDK.Volume {
|
|
162
|
-
return {
|
|
163
|
-
name: this.name,
|
|
164
|
-
hostPath: {
|
|
165
|
-
path: this.props.$backend.path,
|
|
166
|
-
type: this.props.$backend.type
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|