@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,57 +1,97 @@
1
- import { dns01SolverMediator } from '../../chunk-HH2JJELM.js';
2
- import { getProviderAsync, Namespace } from '../../chunk-OBDQONMV.js';
3
- import '../../chunk-PZ5AY32C.js';
4
- import { cert_manager } from '@highstate/cert-manager';
5
- import { k8s } from '@highstate/library';
6
- import { forUnit } from '@highstate/pulumi';
1
+ // @bun
2
+ import {
3
+ dns01SolverMediator
4
+ } from "../../chunk-de82bbp2.js";
5
+ import {
6
+ Namespace,
7
+ Secret,
8
+ getProviderAsync
9
+ } from "../../chunk-facs31cb.js";
10
+ import"../../chunk-b05q6fm2.js";
7
11
 
8
- var { name, inputs, outputs } = forUnit(k8s.dns01TlsIssuer);
12
+ // src/units/dns01-issuer/index.ts
13
+ import { cert_manager } from "@highstate/cert-manager";
14
+ import { common, k8s } from "@highstate/library";
15
+ import { forUnit, makeEntityOutput } from "@highstate/pulumi";
16
+ var { name, args, secrets, inputs, outputs } = forUnit(k8s.dns01TlsIssuer);
9
17
  var provider = await getProviderAsync(inputs.k8sCluster);
10
18
  var certManagerNs = Namespace.get("cert-manager", {
11
19
  name: "cert-manager",
12
20
  cluster: inputs.k8sCluster
13
21
  });
14
- new cert_manager.v1.ClusterIssuer(
15
- name,
16
- {
17
- metadata: {
18
- name
19
- },
20
- spec: {
21
- acme: {
22
- server: "https://acme-v02.api.letsencrypt.org/directory",
23
- solvers: [
24
- {
25
- dns01: dns01SolverMediator.callOutput(inputs.dnsProvider.implRef, {
26
- namespace: certManagerNs
27
- }),
28
- selector: { dnsZones: inputs.dnsProvider.zones }
29
- }
30
- ],
31
- privateKeySecretRef: {
32
- name
33
- }
34
- }
22
+ var eabSecret;
23
+ if (args.acmeServer.type === "zerossl") {
24
+ if (!secrets.eabKeyId || !secrets.eabKeySecret) {
25
+ throw new Error("EAB key ID and secret are required for ZeroSSL ACME server");
26
+ }
27
+ eabSecret = Secret.create(`${name}-eab`, {
28
+ namespace: certManagerNs,
29
+ stringData: {
30
+ keyId: secrets.eabKeyId,
31
+ keySecret: secrets.eabKeySecret
35
32
  }
33
+ });
34
+ }
35
+ var getAcmeServer = () => {
36
+ switch (args.acmeServer.type) {
37
+ case "zerossl":
38
+ return "https://acme.zerossl.com/v2/DV90";
39
+ case "letsencrypt":
40
+ return "https://acme-v02.api.letsencrypt.org/directory";
41
+ case "custom":
42
+ return args.acmeServer.url;
43
+ }
44
+ };
45
+ new cert_manager.v1.ClusterIssuer(name, {
46
+ metadata: {
47
+ name
36
48
  },
37
- { provider }
38
- );
49
+ spec: {
50
+ acme: {
51
+ server: getAcmeServer(),
52
+ solvers: [
53
+ {
54
+ dns01: dns01SolverMediator.callOutput(inputs.dnsProvider.implRef, {
55
+ namespace: certManagerNs
56
+ }),
57
+ selector: { dnsZones: inputs.dnsProvider.zones }
58
+ }
59
+ ],
60
+ privateKeySecretRef: {
61
+ name
62
+ },
63
+ externalAccountBinding: eabSecret ? {
64
+ keyID: eabSecret.stringData.keyId,
65
+ keySecretRef: {
66
+ name: eabSecret.metadata.name,
67
+ key: "keySecret"
68
+ }
69
+ } : undefined
70
+ }
71
+ }
72
+ }, { provider });
39
73
  var dns01_issuer_default = outputs({
40
- tlsIssuer: {
41
- zones: inputs.dnsProvider.zones,
42
- implRef: {
43
- package: "@highstate/k8s",
44
- data: {
45
- clusterIssuerName: name,
46
- cluster: inputs.k8sCluster
74
+ tlsIssuer: makeEntityOutput({
75
+ entity: common.tlsIssuerEntity,
76
+ identity: `${name}:tls-issuer`,
77
+ meta: {
78
+ title: name
79
+ },
80
+ value: {
81
+ zones: inputs.dnsProvider.zones,
82
+ implRef: {
83
+ package: "@highstate/k8s",
84
+ data: {
85
+ clusterIssuerName: name,
86
+ cluster: inputs.k8sCluster
87
+ }
47
88
  }
48
89
  }
49
- },
90
+ }),
50
91
  $statusFields: {
51
92
  zones: inputs.dnsProvider.zones
52
93
  }
53
94
  });
54
-
55
- export { dns01_issuer_default as default };
56
- //# sourceMappingURL=index.js.map
57
- //# sourceMappingURL=index.js.map
95
+ export {
96
+ dns01_issuer_default as default
97
+ };
@@ -1,17 +1,30 @@
1
- import { detectExternalIps, createK8sTerminal } from '../../chunk-LGHFSXNT.js';
2
- import '../../chunk-OBDQONMV.js';
3
- import '../../chunk-PZ5AY32C.js';
4
- import { parseAddress, mergeAddresses, parseEndpoints, parseEndpoint, mergeEndpoints, l4EndpointToString, l3EndpointToString } from '@highstate/common';
5
- import { k8s } from '@highstate/library';
6
- import { forUnit, toPromise, secret } from '@highstate/pulumi';
7
- import { KubeConfig, AppsV1Api } from '@kubernetes/client-node';
8
- import { Provider, core } from '@pulumi/kubernetes';
1
+ // @bun
2
+ import {
3
+ createK8sTerminal,
4
+ detectExternalIps
5
+ } from "../../chunk-9hs97f1q.js";
6
+ import"../../chunk-facs31cb.js";
7
+ import"../../chunk-b05q6fm2.js";
9
8
 
9
+ // src/units/existing-cluster/index.ts
10
+ import {
11
+ l3EndpointToString,
12
+ l4EndpointToString,
13
+ mergeAddresses,
14
+ mergeEndpoints,
15
+ parseAddress,
16
+ parseEndpoint,
17
+ parseEndpoints
18
+ } from "@highstate/common";
19
+ import { common, k8s } from "@highstate/library";
20
+ import { forUnit, makeEntityOutput, toPromise } from "@highstate/pulumi";
21
+ import { AppsV1Api, KubeConfig } from "@kubernetes/client-node";
22
+ import { core, Provider } from "@pulumi/kubernetes";
10
23
  var { name, args, inputs, secrets, outputs } = forUnit(k8s.existingCluster);
11
24
  var kubeconfigContent = await toPromise(secrets.kubeconfig.apply(JSON.stringify));
12
25
  var provider = new Provider(name, { kubeconfig: kubeconfigContent });
13
26
  var networkPolicyImplRef;
14
- var kubeConfig = new KubeConfig();
27
+ var kubeConfig = new KubeConfig;
15
28
  kubeConfig.loadFromString(kubeconfigContent);
16
29
  var appsApi = kubeConfig.makeApiClient(AppsV1Api);
17
30
  var hasCilium = await appsApi.readNamespacedDaemonSet({ name: "cilium", namespace: "kube-system" }).then(() => true).catch(() => false);
@@ -26,29 +39,50 @@ if (args.autoDetectExternalIps) {
26
39
  const detectedIps = await detectExternalIps(kubeConfig, args.internalIpsPolicy);
27
40
  externalIps = mergeAddresses([...externalIps, ...detectedIps]);
28
41
  }
29
- var endpoints = await parseEndpoints(args.endpoints, inputs.endpoints);
42
+ var endpoints = parseEndpoints([...args.endpoints, ...inputs.endpoints]);
30
43
  if (args.useExternalIpsAsEndpoints) {
31
44
  const ipEndpoints = externalIps.map((ip) => parseEndpoint(ip));
32
45
  endpoints = mergeEndpoints([...endpoints, ...ipEndpoints]);
33
46
  }
34
- var apiEndpoints = await parseEndpoints(args.apiEndpoints, inputs.endpoints, 4);
47
+ var apiEndpoints = parseEndpoints([...args.apiEndpoints, ...inputs.endpoints], 4);
35
48
  if (args.useKubeconfigApiEndpoint) {
36
49
  const configEndpoint = parseEndpoint(kubeConfig.clusters[0].server.replace("https://", ""), 4);
37
50
  apiEndpoints = mergeEndpoints([configEndpoint, ...apiEndpoints]);
38
51
  }
39
52
  var kubeSystem = core.v1.Namespace.get("kube-system", "kube-system", { provider });
40
53
  var existing_cluster_default = outputs({
41
- k8sCluster: {
42
- id: kubeSystem.metadata.uid,
43
- connectionId: kubeSystem.metadata.uid,
44
- name,
45
- networkPolicyImplRef,
46
- externalIps,
47
- endpoints,
48
- apiEndpoints,
49
- quirks: args.quirks,
50
- kubeconfig: secret(kubeconfigContent)
51
- },
54
+ k8sCluster: makeEntityOutput({
55
+ entity: k8s.clusterEntity,
56
+ identity: kubeSystem.metadata.uid,
57
+ value: {
58
+ id: kubeSystem.metadata.uid,
59
+ connectionId: kubeSystem.metadata.uid,
60
+ name,
61
+ networkPolicyImplRef,
62
+ externalIps,
63
+ endpoints,
64
+ apiEndpoints,
65
+ quirks: args.quirks,
66
+ kubeconfig: makeEntityOutput({
67
+ entity: common.fileEntity,
68
+ identity: `${name}:kubeconfig`,
69
+ meta: {
70
+ title: "Kubeconfig"
71
+ },
72
+ value: {
73
+ content: {
74
+ type: "embedded-secret",
75
+ value: kubeconfigContent
76
+ },
77
+ meta: {
78
+ name: "kubeconfig",
79
+ contentType: "text/yaml",
80
+ mode: 384
81
+ }
82
+ }
83
+ })
84
+ }
85
+ }),
52
86
  $terminals: [createK8sTerminal(kubeconfigContent)],
53
87
  $statusFields: {
54
88
  clusterId: kubeSystem.metadata.uid,
@@ -56,7 +90,6 @@ var existing_cluster_default = outputs({
56
90
  apiEndpoints: apiEndpoints.map(l4EndpointToString)
57
91
  }
58
92
  });
59
-
60
- export { existing_cluster_default as default };
61
- //# sourceMappingURL=index.js.map
62
- //# sourceMappingURL=index.js.map
93
+ export {
94
+ existing_cluster_default as default
95
+ };
@@ -1,22 +1,21 @@
1
- import { getProviderAsync } from '../../chunk-OBDQONMV.js';
2
- import '../../chunk-PZ5AY32C.js';
3
- import { k8s } from '@highstate/library';
4
- import { forUnit } from '@highstate/pulumi';
5
- import { yaml } from '@pulumi/kubernetes';
1
+ // @bun
2
+ import {
3
+ getProviderAsync
4
+ } from "../../chunk-facs31cb.js";
5
+ import"../../chunk-b05q6fm2.js";
6
6
 
7
+ // src/units/gateway-api/index.ts
8
+ import { k8s } from "@highstate/library";
9
+ import { forUnit } from "@highstate/pulumi";
10
+ import { yaml } from "@pulumi/kubernetes";
7
11
  var { inputs, outputs } = forUnit(k8s.gatewayApi);
8
12
  var provider = await getProviderAsync(inputs.k8sCluster);
9
- new yaml.v2.ConfigFile(
10
- "gateway-api",
11
- {
12
- file: "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/experimental-install.yaml"
13
- },
14
- { provider }
15
- );
13
+ new yaml.v2.ConfigFile("gateway-api", {
14
+ file: "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.0/experimental-install.yaml"
15
+ }, { provider });
16
16
  var gateway_api_default = outputs({
17
17
  k8sCluster: inputs.k8sCluster
18
18
  });
19
-
20
- export { gateway_api_default as default };
21
- //# sourceMappingURL=index.js.map
22
- //# sourceMappingURL=index.js.map
19
+ export {
20
+ gateway_api_default as default
21
+ };
@@ -1,35 +1,32 @@
1
- import { ClusterAccessScope } from '../../chunk-KMLRI5UZ.js';
2
- import { createK8sTerminal } from '../../chunk-LGHFSXNT.js';
3
- import '../../chunk-4G6LLC2X.js';
4
- import { Namespace } from '../../chunk-OBDQONMV.js';
5
- import '../../chunk-PZ5AY32C.js';
6
- import { text, trimIndentation } from '@highstate/contract';
7
- import { k8s } from '@highstate/library';
8
- import { forUnit, toPromise, output, interpolate, fileFromString, secret } from '@highstate/pulumi';
9
- import { join } from 'remeda';
1
+ // @bun
2
+ import {
3
+ createK8sTerminal
4
+ } from "../../chunk-9hs97f1q.js";
5
+ import {
6
+ ClusterAccessScope,
7
+ Namespace,
8
+ getClusterKubeconfigContent
9
+ } from "../../chunk-facs31cb.js";
10
+ import"../../chunk-b05q6fm2.js";
10
11
 
12
+ // src/units/reduced-access-cluster/index.ts
13
+ import { text, trimIndentation } from "@highstate/contract";
14
+ import { k8s } from "@highstate/library";
15
+ import { forUnit, interpolate, makeFileOutput, output, secret, toPromise } from "@highstate/pulumi";
16
+ import { join } from "remeda";
11
17
  var { args, inputs, outputs } = forUnit(k8s.reducedAccessCluster);
12
18
  var resolvedInputs = await toPromise(inputs);
13
- var accessScope = new ClusterAccessScope(
14
- "scope",
15
- {
16
- namespace: Namespace.for(resolvedInputs.namespace, inputs.k8sCluster),
17
- extraNamespaces: resolvedInputs.extraNamespaces.map((ns) => Namespace.for(ns, inputs.k8sCluster)),
18
- rules: args.rules,
19
- resources: resolvedInputs.resources
20
- },
21
- {}
22
- );
23
- var resourceLines = await toPromise(
24
- output(
25
- resolvedInputs.resources.map(
26
- (r) => r.isNamespaced ? interpolate`- ${r.kind} "${r.metadata.namespace}/${r.metadata.name}"` : interpolate`- ${r.kind} "${r.metadata.name}"`
27
- )
28
- ).apply(join("\n"))
29
- );
19
+ var accessScope = new ClusterAccessScope("scope", {
20
+ namespace: Namespace.for(resolvedInputs.namespace, inputs.k8sCluster),
21
+ extraNamespaces: resolvedInputs.extraNamespaces.map((ns) => Namespace.for(ns, inputs.k8sCluster)),
22
+ rules: args.rules,
23
+ resources: resolvedInputs.resources
24
+ }, {});
25
+ var resourceLines = await toPromise(output(resolvedInputs.resources.map((r) => r.isNamespaced ? interpolate`- ${r.kind} "${r.metadata.namespace}/${r.metadata.name}"` : interpolate`- ${r.kind} "${r.metadata.name}"`)).apply(join(`
26
+ `)));
30
27
  var reduced_access_cluster_default = outputs({
31
28
  k8sCluster: accessScope.cluster,
32
- $terminals: [createK8sTerminal(accessScope.cluster.kubeconfig)],
29
+ $terminals: [createK8sTerminal(secret(getClusterKubeconfigContent(accessScope.cluster)))],
33
30
  $pages: {
34
31
  index: {
35
32
  meta: {
@@ -52,22 +49,22 @@ var reduced_access_cluster_default = outputs({
52
49
  },
53
50
  {
54
51
  type: "file",
55
- file: fileFromString("kubeconfig", accessScope.cluster.kubeconfig, {
52
+ file: makeFileOutput({
53
+ name: "kubeconfig",
54
+ content: secret(getClusterKubeconfigContent(accessScope.cluster)),
56
55
  contentType: "text/yaml",
57
56
  isSecret: true
58
57
  })
59
58
  },
60
59
  {
61
60
  type: "markdown",
62
- content: secret(
63
- interpolate`
61
+ content: secret(interpolate`
64
62
  You can also copy the following content of the kubeconfig file:
65
63
 
66
64
  \`\`\`yaml
67
65
  ${accessScope.cluster.kubeconfig}
68
66
  \`\`\`
69
- `.apply(trimIndentation)
70
- )
67
+ `.apply(trimIndentation))
71
68
  },
72
69
  {
73
70
  type: "markdown",
@@ -77,7 +74,6 @@ var reduced_access_cluster_default = outputs({
77
74
  }
78
75
  }
79
76
  });
80
-
81
- export { reduced_access_cluster_default as default };
82
- //# sourceMappingURL=index.js.map
83
- //# sourceMappingURL=index.js.map
77
+ export {
78
+ reduced_access_cluster_default as default
79
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/k8s",
3
- "version": "0.19.1",
3
+ "version": "0.21.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -49,6 +49,7 @@
49
49
  "./units/existing-cluster": "./dist/units/existing-cluster/index.js",
50
50
  "./units/gateway-api": "./dist/units/gateway-api/index.js",
51
51
  "./units/reduced-access-cluster": "./dist/units/reduced-access-cluster/index.js",
52
+ "./impl/dynamic-endpoint-resolver": "./dist/impl/dynamic-endpoint-resolver.js",
52
53
  "./impl/gateway-route": "./dist/impl/gateway-route.js",
53
54
  "./impl/tls-certificate": "./dist/impl/tls-certificate.js"
54
55
  },
@@ -60,41 +61,42 @@
60
61
  "stdlib"
61
62
  ]
62
63
  },
64
+ "scripts": {
65
+ "build": "highstate build",
66
+ "update-charts": "../../../scripts/update-charts.sh ./assets/charts.json",
67
+ "update-images": "../../../scripts/update-images.sh ./assets/images.json",
68
+ "generate-crds": "./scripts/generate-crds.sh",
69
+ "typecheck": "tsgo --noEmit --skipLibCheck",
70
+ "biome": "biome check --write --unsafe --error-on-warnings",
71
+ "biome:check": "biome check --error-on-warnings"
72
+ },
63
73
  "dependencies": {
74
+ "@highstate/cert-manager": "0.20.0",
75
+ "@highstate/common": "0.20.0",
76
+ "@highstate/contract": "0.20.0",
77
+ "@highstate/gateway-api": "0.20.0",
78
+ "@highstate/library": "0.20.0",
79
+ "@highstate/pulumi": "0.20.0",
64
80
  "@kubernetes/client-node": "^1.1.0",
65
81
  "@pulumi/command": "^1.0.2",
66
82
  "@pulumi/kubernetes": "^4.18.0",
67
- "@pulumi/pulumi": "3.198.0",
83
+ "@pulumi/pulumi": "3.232.0",
68
84
  "crypto-hash": "^3.1.0",
69
85
  "deepmerge-ts": "^7.1.5",
70
86
  "glob": "^11.0.1",
71
87
  "nano-spawn": "^0.2.0",
88
+ "get-port-please": "^3.1.2",
72
89
  "pkg-types": "^2.1.0",
73
90
  "remeda": "^2.21.0",
74
- "yaml": "^2.8.1",
75
- "@highstate/cert-manager": "0.14.0",
76
- "@highstate/gateway-api": "0.14.0",
77
- "@highstate/contract": "0.19.1",
78
- "@highstate/pulumi": "0.19.1",
79
- "@highstate/common": "0.19.1",
80
- "@highstate/library": "0.19.1"
91
+ "yaml": "^2.8.1"
81
92
  },
82
93
  "devDependencies": {
83
94
  "@biomejs/biome": "2.2.0",
95
+ "@highstate/cli": "0.20.0",
84
96
  "@typescript/native-preview": "^7.0.0-dev.20250920.1",
85
- "type-fest": "^4.41.0",
86
- "@highstate/cli": "0.19.1"
97
+ "type-fest": "^4.41.0"
87
98
  },
88
99
  "repository": {
89
100
  "url": "https://github.com/highstate-io/highstate"
90
- },
91
- "scripts": {
92
- "build": "highstate build",
93
- "update-charts": "../../../scripts/update-charts.sh ./assets/charts.json",
94
- "update-images": "../../../scripts/update-images.sh ./assets/images.json",
95
- "generate-crds": "./scripts/generate-crds.sh",
96
- "typecheck": "tsgo --noEmit --skipLibCheck",
97
- "biome": "biome check --write --unsafe --error-on-warnings",
98
- "biome:check": "biome check --error-on-warnings"
99
101
  }
100
- }
102
+ }
package/src/cluster.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { k8s, network } from "@highstate/library"
2
2
  import { isPrivateAddress, parseAddress } from "@highstate/common"
3
3
  import { text, type UnitTerminal } from "@highstate/contract"
4
- import { fileFromString, type Input, type Output, output } from "@highstate/pulumi"
4
+ import { type Input, makeFileOutput, type Output, output } from "@highstate/pulumi"
5
5
  import { CoreV1Api, type KubeConfig } from "@kubernetes/client-node"
6
6
  import { images } from "./shared"
7
7
 
@@ -54,20 +54,24 @@ export function createK8sTerminal(kubeconfig: Input<string>): Output<UnitTermina
54
54
  command: ["bash", "/welcome.sh"],
55
55
 
56
56
  files: {
57
- "/kubeconfig": fileFromString("kubeconfig", kubeconfig, { isSecret: true }),
58
-
59
- "/welcome.sh": fileFromString(
60
- "welcome.sh",
61
- text`
57
+ "/kubeconfig": makeFileOutput({
58
+ name: "kubeconfig",
59
+ content: kubeconfig,
60
+ isSecret: true,
61
+ }),
62
+
63
+ "/welcome.sh": makeFileOutput({
64
+ name: "welcome.sh",
65
+ content: text`
62
66
  echo "Connecting to the cluster..."
63
67
  kubectl cluster-info
64
68
 
65
- echo "Use 'kubectl' and 'helm' to manage the cluster."
69
+ echo "Use 'kubectl', 'helm' or 'k9s' to manage the cluster."
66
70
  echo
67
71
 
68
72
  exec bash
69
73
  `,
70
- ),
74
+ }),
71
75
  },
72
76
 
73
77
  env: {
package/src/config-map.ts CHANGED
@@ -1,15 +1,16 @@
1
- import type { k8s } from "@highstate/library"
2
1
  import { getOrCreate } from "@highstate/contract"
3
- import { toPromise } from "@highstate/pulumi"
4
- import { core, type types } from "@pulumi/kubernetes"
2
+ import { k8s } from "@highstate/library"
5
3
  import {
6
4
  type ComponentResourceOptions,
7
5
  type Input,
8
6
  type Inputs,
9
7
  interpolate,
8
+ makeEntityOutput,
10
9
  type Output,
11
10
  output,
12
- } from "@pulumi/pulumi"
11
+ toPromise,
12
+ } from "@highstate/pulumi"
13
+ import { core, type types } from "@pulumi/kubernetes"
13
14
  import { Namespace } from "./namespace"
14
15
  import { getProvider, mapMetadata, NamespacedResource, type ScopedResourceArgs } from "./shared"
15
16
 
@@ -51,7 +52,16 @@ export abstract class ConfigMap extends NamespacedResource {
51
52
  * The Highstate config map entity.
52
53
  */
53
54
  get entity(): Output<k8s.ConfigMap> {
54
- return output(this.entityBase)
55
+ return makeEntityOutput({
56
+ entity: k8s.configMapEntity,
57
+ identity: this.metadata.uid,
58
+ meta: {
59
+ title: this.metadata.name,
60
+ },
61
+ value: {
62
+ ...this.entityBase,
63
+ },
64
+ })
55
65
  }
56
66
 
57
67
  /**
package/src/container.ts CHANGED
@@ -120,6 +120,8 @@ export type ContainerEnvironmentSource =
120
120
  | types.input.core.v1.EnvFromSource
121
121
  | core.v1.ConfigMap
122
122
  | core.v1.Secret
123
+ | ConfigMap
124
+ | Secret
123
125
 
124
126
  export type ContainerVolumeMount =
125
127
  | types.input.core.v1.VolumeMount
@@ -268,7 +270,7 @@ export function mapVolumeMount(volumeMount: ContainerVolumeMount): types.input.c
268
270
  export function mapEnvironmentSource(
269
271
  envFrom: ContainerEnvironmentSource,
270
272
  ): types.input.core.v1.EnvFromSource {
271
- if (envFrom instanceof core.v1.ConfigMap) {
273
+ if (envFrom instanceof core.v1.ConfigMap || envFrom instanceof ConfigMap) {
272
274
  return {
273
275
  configMapRef: {
274
276
  name: envFrom.metadata.name,
@@ -276,7 +278,7 @@ export function mapEnvironmentSource(
276
278
  }
277
279
  }
278
280
 
279
- if (envFrom instanceof core.v1.Secret) {
281
+ if (envFrom instanceof core.v1.Secret || envFrom instanceof Secret) {
280
282
  return {
281
283
  secretRef: {
282
284
  name: envFrom.metadata.name,