@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.
Files changed (107) hide show
  1. package/dist/chunk-23vn2rdc.js +11 -0
  2. package/dist/chunk-2pfx13ay.js +11 -0
  3. package/dist/chunk-46ntav0c.js +299 -0
  4. package/dist/chunk-556pc9e6.js +155 -0
  5. package/dist/chunk-7kgjgcft.js +170 -0
  6. package/dist/{chunk-LGHFSXNT.js → chunk-9hs97f1q.js} +23 -17
  7. package/dist/chunk-aame3x1b.js +11 -0
  8. package/dist/chunk-b05q6fm2.js +37 -0
  9. package/dist/chunk-bmvc9d2d.js +11 -0
  10. package/dist/chunk-de82bbp2.js +7 -0
  11. package/dist/chunk-facs31cb.js +624 -0
  12. package/dist/chunk-h1b79v66.js +1425 -0
  13. package/dist/chunk-k4w9zpn5.js +215 -0
  14. package/dist/chunk-pqc6w52f.js +352 -0
  15. package/dist/chunk-qyshvz32.js +176 -0
  16. package/dist/chunk-tpfyj6fe.js +199 -0
  17. package/dist/chunk-z6bmpnm7.js +180 -0
  18. package/dist/highstate.manifest.json +3 -2
  19. package/dist/impl/dynamic-endpoint-resolver.js +91 -0
  20. package/dist/impl/gateway-route.js +226 -166
  21. package/dist/impl/tls-certificate.js +31 -31
  22. package/dist/index.js +293 -166
  23. package/dist/units/cert-manager/index.js +19 -14
  24. package/dist/units/cluster-patch/index.js +14 -13
  25. package/dist/units/dns01-issuer/index.js +82 -42
  26. package/dist/units/existing-cluster/index.js +59 -26
  27. package/dist/units/gateway-api/index.js +15 -16
  28. package/dist/units/reduced-access-cluster/index.js +32 -36
  29. package/package.json +23 -21
  30. package/src/cluster.ts +12 -8
  31. package/src/config-map.ts +15 -5
  32. package/src/container.ts +4 -2
  33. package/src/cron-job.ts +51 -5
  34. package/src/deployment.ts +49 -18
  35. package/src/gateway/backend.ts +3 -3
  36. package/src/gateway/gateway.ts +12 -56
  37. package/src/helm.ts +354 -22
  38. package/src/impl/dynamic-endpoint-resolver.ts +109 -0
  39. package/src/impl/gateway-route.ts +231 -57
  40. package/src/impl/tls-certificate.ts +8 -3
  41. package/src/index.ts +1 -0
  42. package/src/job.ts +38 -6
  43. package/src/kubectl.ts +166 -0
  44. package/src/namespace.ts +47 -3
  45. package/src/network-policy.ts +1 -1
  46. package/src/pvc.ts +12 -2
  47. package/src/rbac.ts +28 -5
  48. package/src/scripting/bundle.ts +21 -98
  49. package/src/scripting/environment.ts +4 -10
  50. package/src/secret.ts +15 -5
  51. package/src/service.ts +28 -6
  52. package/src/shared.ts +31 -3
  53. package/src/stateful-set.ts +49 -18
  54. package/src/tls.ts +31 -5
  55. package/src/units/cluster-patch/index.ts +5 -5
  56. package/src/units/dns01-issuer/index.ts +56 -12
  57. package/src/units/existing-cluster/index.ts +36 -15
  58. package/src/units/reduced-access-cluster/index.ts +6 -3
  59. package/src/worker.ts +4 -2
  60. package/src/workload.ts +474 -217
  61. package/LICENSE +0 -21
  62. package/dist/chunk-4G6LLC2X.js +0 -240
  63. package/dist/chunk-4G6LLC2X.js.map +0 -1
  64. package/dist/chunk-BR2CLUUD.js +0 -230
  65. package/dist/chunk-BR2CLUUD.js.map +0 -1
  66. package/dist/chunk-DCUMJSO6.js +0 -427
  67. package/dist/chunk-DCUMJSO6.js.map +0 -1
  68. package/dist/chunk-FE4SHRAJ.js +0 -286
  69. package/dist/chunk-FE4SHRAJ.js.map +0 -1
  70. package/dist/chunk-HH2JJELM.js +0 -13
  71. package/dist/chunk-HH2JJELM.js.map +0 -1
  72. package/dist/chunk-KMLRI5UZ.js +0 -155
  73. package/dist/chunk-KMLRI5UZ.js.map +0 -1
  74. package/dist/chunk-LGHFSXNT.js.map +0 -1
  75. package/dist/chunk-MIC2BHGS.js +0 -301
  76. package/dist/chunk-MIC2BHGS.js.map +0 -1
  77. package/dist/chunk-OBDQONMV.js +0 -401
  78. package/dist/chunk-OBDQONMV.js.map +0 -1
  79. package/dist/chunk-P2VOUU7E.js +0 -1626
  80. package/dist/chunk-P2VOUU7E.js.map +0 -1
  81. package/dist/chunk-PZ5AY32C.js +0 -9
  82. package/dist/chunk-PZ5AY32C.js.map +0 -1
  83. package/dist/chunk-RVB4WWZZ.js +0 -267
  84. package/dist/chunk-RVB4WWZZ.js.map +0 -1
  85. package/dist/chunk-TWBMG6TD.js +0 -315
  86. package/dist/chunk-TWBMG6TD.js.map +0 -1
  87. package/dist/chunk-VCXWCZ43.js +0 -279
  88. package/dist/chunk-VCXWCZ43.js.map +0 -1
  89. package/dist/chunk-YIJUVPU2.js +0 -297
  90. package/dist/chunk-YIJUVPU2.js.map +0 -1
  91. package/dist/cron-job-NX4HD4FI.js +0 -8
  92. package/dist/cron-job-NX4HD4FI.js.map +0 -1
  93. package/dist/deployment-O2LJ5WR5.js +0 -8
  94. package/dist/deployment-O2LJ5WR5.js.map +0 -1
  95. package/dist/impl/gateway-route.js.map +0 -1
  96. package/dist/impl/tls-certificate.js.map +0 -1
  97. package/dist/index.js.map +0 -1
  98. package/dist/job-SYME6Y43.js +0 -8
  99. package/dist/job-SYME6Y43.js.map +0 -1
  100. package/dist/stateful-set-VJYKTQ72.js +0 -8
  101. package/dist/stateful-set-VJYKTQ72.js.map +0 -1
  102. package/dist/units/cert-manager/index.js.map +0 -1
  103. package/dist/units/cluster-patch/index.js.map +0 -1
  104. package/dist/units/dns01-issuer/index.js.map +0 -1
  105. package/dist/units/existing-cluster/index.js.map +0 -1
  106. package/dist/units/gateway-api/index.js.map +0 -1
  107. package/dist/units/reduced-access-cluster/index.js.map +0 -1
@@ -1,9 +1,13 @@
1
- import { images_exports } from './chunk-OBDQONMV.js';
2
- import { parseAddress, isPrivateAddress } from '@highstate/common';
3
- import { text } from '@highstate/contract';
4
- import { output, fileFromString } from '@highstate/pulumi';
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) : void 0;
15
- const internalAddress = internalIp ? parseAddress(internalIp.address) : void 0;
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: images_exports["terminal-kubectl"].image,
42
+ image: images_default["terminal-kubectl"].image,
39
43
  command: ["bash", "/welcome.sh"],
40
44
  files: {
41
- "/kubeconfig": fileFromString("kubeconfig", kubeconfig, { isSecret: true }),
42
- "/welcome.sh": fileFromString(
43
- "welcome.sh",
44
- text`
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' and 'helm' to manage the cluster."
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 { createK8sTerminal, detectExternalIps };
63
- //# sourceMappingURL=chunk-LGHFSXNT.js.map
64
- //# sourceMappingURL=chunk-LGHFSXNT.js.map
70
+ export { detectExternalIps, createK8sTerminal };
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import {
3
+ Deployment
4
+ } from "./chunk-7kgjgcft.js";
5
+ import"./chunk-h1b79v66.js";
6
+ import"./chunk-k4w9zpn5.js";
7
+ import"./chunk-facs31cb.js";
8
+ import"./chunk-b05q6fm2.js";
9
+ export {
10
+ Deployment
11
+ };
@@ -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,11 @@
1
+ // @bun
2
+ import {
3
+ CronJob
4
+ } from "./chunk-tpfyj6fe.js";
5
+ import"./chunk-h1b79v66.js";
6
+ import"./chunk-k4w9zpn5.js";
7
+ import"./chunk-facs31cb.js";
8
+ import"./chunk-b05q6fm2.js";
9
+ export {
10
+ CronJob
11
+ };
@@ -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 };