@highstate/k8s 0.19.1 → 0.21.1
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/chunk-23vn2rdc.js +11 -0
- package/dist/chunk-2pfx13ay.js +11 -0
- package/dist/chunk-46ntav0c.js +299 -0
- package/dist/chunk-556pc9e6.js +155 -0
- package/dist/chunk-7kgjgcft.js +170 -0
- package/dist/{chunk-LGHFSXNT.js → chunk-9hs97f1q.js} +23 -17
- package/dist/chunk-aame3x1b.js +11 -0
- package/dist/chunk-b05q6fm2.js +37 -0
- package/dist/chunk-bmvc9d2d.js +11 -0
- package/dist/chunk-de82bbp2.js +7 -0
- package/dist/chunk-facs31cb.js +624 -0
- package/dist/chunk-h1b79v66.js +1425 -0
- package/dist/chunk-k4w9zpn5.js +215 -0
- package/dist/chunk-pqc6w52f.js +352 -0
- package/dist/chunk-qyshvz32.js +176 -0
- package/dist/chunk-tpfyj6fe.js +199 -0
- package/dist/chunk-z6bmpnm7.js +180 -0
- package/dist/highstate.manifest.json +3 -2
- package/dist/impl/dynamic-endpoint-resolver.js +91 -0
- package/dist/impl/gateway-route.js +226 -166
- package/dist/impl/tls-certificate.js +31 -31
- package/dist/index.js +293 -166
- package/dist/units/cert-manager/index.js +19 -14
- package/dist/units/cluster-patch/index.js +14 -13
- package/dist/units/dns01-issuer/index.js +82 -42
- package/dist/units/existing-cluster/index.js +59 -26
- package/dist/units/gateway-api/index.js +15 -16
- package/dist/units/reduced-access-cluster/index.js +32 -36
- package/package.json +23 -21
- package/src/cluster.ts +12 -8
- package/src/config-map.ts +15 -5
- package/src/container.ts +4 -2
- package/src/cron-job.ts +51 -5
- package/src/deployment.ts +49 -18
- package/src/gateway/backend.ts +3 -3
- package/src/gateway/gateway.ts +12 -56
- package/src/helm.ts +354 -22
- package/src/impl/dynamic-endpoint-resolver.ts +109 -0
- package/src/impl/gateway-route.ts +231 -57
- package/src/impl/tls-certificate.ts +8 -3
- package/src/index.ts +1 -0
- package/src/job.ts +38 -6
- package/src/kubectl.ts +166 -0
- package/src/namespace.ts +47 -3
- package/src/network-policy.ts +1 -1
- package/src/pvc.ts +12 -2
- package/src/rbac.ts +28 -5
- package/src/scripting/bundle.ts +21 -98
- package/src/scripting/environment.ts +4 -10
- package/src/secret.ts +15 -5
- package/src/service.ts +28 -6
- package/src/shared.ts +31 -3
- package/src/stateful-set.ts +49 -18
- package/src/tls.ts +31 -5
- package/src/units/cluster-patch/index.ts +5 -5
- package/src/units/dns01-issuer/index.ts +56 -12
- package/src/units/existing-cluster/index.ts +36 -15
- package/src/units/reduced-access-cluster/index.ts +6 -3
- package/src/worker.ts +4 -2
- package/src/workload.ts +474 -217
- package/LICENSE +0 -21
- package/dist/chunk-4G6LLC2X.js +0 -240
- package/dist/chunk-4G6LLC2X.js.map +0 -1
- package/dist/chunk-BR2CLUUD.js +0 -230
- package/dist/chunk-BR2CLUUD.js.map +0 -1
- package/dist/chunk-DCUMJSO6.js +0 -427
- package/dist/chunk-DCUMJSO6.js.map +0 -1
- package/dist/chunk-FE4SHRAJ.js +0 -286
- package/dist/chunk-FE4SHRAJ.js.map +0 -1
- package/dist/chunk-HH2JJELM.js +0 -13
- package/dist/chunk-HH2JJELM.js.map +0 -1
- package/dist/chunk-KMLRI5UZ.js +0 -155
- package/dist/chunk-KMLRI5UZ.js.map +0 -1
- package/dist/chunk-LGHFSXNT.js.map +0 -1
- package/dist/chunk-MIC2BHGS.js +0 -301
- package/dist/chunk-MIC2BHGS.js.map +0 -1
- package/dist/chunk-OBDQONMV.js +0 -401
- package/dist/chunk-OBDQONMV.js.map +0 -1
- package/dist/chunk-P2VOUU7E.js +0 -1626
- package/dist/chunk-P2VOUU7E.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -9
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-RVB4WWZZ.js +0 -267
- package/dist/chunk-RVB4WWZZ.js.map +0 -1
- package/dist/chunk-TWBMG6TD.js +0 -315
- package/dist/chunk-TWBMG6TD.js.map +0 -1
- package/dist/chunk-VCXWCZ43.js +0 -279
- package/dist/chunk-VCXWCZ43.js.map +0 -1
- package/dist/chunk-YIJUVPU2.js +0 -297
- package/dist/chunk-YIJUVPU2.js.map +0 -1
- package/dist/cron-job-NX4HD4FI.js +0 -8
- package/dist/cron-job-NX4HD4FI.js.map +0 -1
- package/dist/deployment-O2LJ5WR5.js +0 -8
- package/dist/deployment-O2LJ5WR5.js.map +0 -1
- package/dist/impl/gateway-route.js.map +0 -1
- package/dist/impl/tls-certificate.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/job-SYME6Y43.js +0 -8
- package/dist/job-SYME6Y43.js.map +0 -1
- package/dist/stateful-set-VJYKTQ72.js +0 -8
- package/dist/stateful-set-VJYKTQ72.js.map +0 -1
- package/dist/units/cert-manager/index.js.map +0 -1
- package/dist/units/cluster-patch/index.js.map +0 -1
- package/dist/units/dns01-issuer/index.js.map +0 -1
- package/dist/units/existing-cluster/index.js.map +0 -1
- package/dist/units/gateway-api/index.js.map +0 -1
- package/dist/units/reduced-access-cluster/index.js.map +0 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { CoreV1Api } from '@kubernetes/client-node';
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
images_default
|
|
4
|
+
} from "./chunk-facs31cb.js";
|
|
6
5
|
|
|
6
|
+
// src/cluster.ts
|
|
7
|
+
import { isPrivateAddress, parseAddress } from "@highstate/common";
|
|
8
|
+
import { text } from "@highstate/contract";
|
|
9
|
+
import { makeFileOutput, output } from "@highstate/pulumi";
|
|
10
|
+
import { CoreV1Api } from "@kubernetes/client-node";
|
|
7
11
|
async function detectExternalIps(kubeConfig, internalIpsPolicy) {
|
|
8
12
|
const nodeApi = kubeConfig.makeApiClient(CoreV1Api);
|
|
9
13
|
const nodes = await nodeApi.listNode();
|
|
@@ -11,8 +15,8 @@ async function detectExternalIps(kubeConfig, internalIpsPolicy) {
|
|
|
11
15
|
const addresses = node.status?.addresses ?? [];
|
|
12
16
|
const externalIp = addresses.find((address) => address.type === "ExternalIP");
|
|
13
17
|
const internalIp = addresses.find((address) => address.type === "InternalIP");
|
|
14
|
-
const externalAddress = externalIp ? parseAddress(externalIp.address) :
|
|
15
|
-
const internalAddress = internalIp ? parseAddress(internalIp.address) :
|
|
18
|
+
const externalAddress = externalIp ? parseAddress(externalIp.address) : undefined;
|
|
19
|
+
const internalAddress = internalIp ? parseAddress(internalIp.address) : undefined;
|
|
16
20
|
const result = [];
|
|
17
21
|
if (externalAddress) {
|
|
18
22
|
result.push(externalAddress);
|
|
@@ -35,22 +39,26 @@ function createK8sTerminal(kubeconfig) {
|
|
|
35
39
|
icon: "devicon:kubernetes"
|
|
36
40
|
},
|
|
37
41
|
spec: {
|
|
38
|
-
image:
|
|
42
|
+
image: images_default["terminal-kubectl"].image,
|
|
39
43
|
command: ["bash", "/welcome.sh"],
|
|
40
44
|
files: {
|
|
41
|
-
"/kubeconfig":
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
"/kubeconfig": makeFileOutput({
|
|
46
|
+
name: "kubeconfig",
|
|
47
|
+
content: kubeconfig,
|
|
48
|
+
isSecret: true
|
|
49
|
+
}),
|
|
50
|
+
"/welcome.sh": makeFileOutput({
|
|
51
|
+
name: "welcome.sh",
|
|
52
|
+
content: text`
|
|
45
53
|
echo "Connecting to the cluster..."
|
|
46
54
|
kubectl cluster-info
|
|
47
55
|
|
|
48
|
-
echo "Use 'kubectl'
|
|
56
|
+
echo "Use 'kubectl', 'helm' or 'k9s' to manage the cluster."
|
|
49
57
|
echo
|
|
50
58
|
|
|
51
59
|
exec bash
|
|
52
60
|
`
|
|
53
|
-
)
|
|
61
|
+
})
|
|
54
62
|
},
|
|
55
63
|
env: {
|
|
56
64
|
KUBECONFIG: "/kubeconfig"
|
|
@@ -59,6 +67,4 @@ function createK8sTerminal(kubeconfig) {
|
|
|
59
67
|
});
|
|
60
68
|
}
|
|
61
69
|
|
|
62
|
-
export {
|
|
63
|
-
//# sourceMappingURL=chunk-LGHFSXNT.js.map
|
|
64
|
-
//# sourceMappingURL=chunk-LGHFSXNT.js.map
|
|
70
|
+
export { detectExternalIps, createK8sTerminal };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __require = import.meta.require;
|
|
3
|
+
var __using = (stack, value, async) => {
|
|
4
|
+
if (value != null) {
|
|
5
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
6
|
+
throw TypeError('Object expected to be assigned to "using" declaration');
|
|
7
|
+
let dispose;
|
|
8
|
+
if (async)
|
|
9
|
+
dispose = value[Symbol.asyncDispose];
|
|
10
|
+
if (dispose === undefined)
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (typeof dispose !== "function")
|
|
13
|
+
throw TypeError("Object not disposable");
|
|
14
|
+
stack.push([async, dispose, value]);
|
|
15
|
+
} else if (async) {
|
|
16
|
+
stack.push([async]);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
};
|
|
20
|
+
var __callDispose = (stack, error, hasError) => {
|
|
21
|
+
let fail = (e) => error = hasError ? new SuppressedError(e, error, "An error was suppressed during disposal") : (hasError = true, e), next = (it) => {
|
|
22
|
+
while (it = stack.pop()) {
|
|
23
|
+
try {
|
|
24
|
+
var result = it[1] && it[1].call(it[2]);
|
|
25
|
+
if (it[0])
|
|
26
|
+
return Promise.resolve(result).then(next, (e) => (fail(e), next()));
|
|
27
|
+
} catch (e) {
|
|
28
|
+
fail(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (hasError)
|
|
32
|
+
throw error;
|
|
33
|
+
};
|
|
34
|
+
return next();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { __require, __using, __callDispose };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/dns01-solver.ts
|
|
3
|
+
import { ImplementationMediator } from "@highstate/common";
|
|
4
|
+
import { z } from "@highstate/contract";
|
|
5
|
+
var dns01SolverMediator = new ImplementationMediator("dns01-solver", z.object({ namespace: z.custom() }), z.custom());
|
|
6
|
+
|
|
7
|
+
export { dns01SolverMediator };
|