@highstate/talos 0.6.2 → 0.7.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.
@@ -1,9 +1,9 @@
1
- import { forUnit, readResolvedPackageFileSync, output, interpolate, all } from '@highstate/pulumi';
1
+ import { readFile } from 'node:fs/promises';
2
+ import { forUnit, output, interpolate, all } from '@highstate/pulumi';
2
3
  import { talos } from '@highstate/library';
3
4
  import { machine, cluster } from '@pulumiverse/talos';
4
5
  import { text } from '@highstate/contract';
5
- import { local } from '@pulumi/command';
6
- import { resolveChartPath } from '@highstate/k8s';
6
+ import { RenderedChart } from '@highstate/k8s';
7
7
 
8
8
  const { name, args, inputs, outputs } = forUnit(talos.cluster);
9
9
  const cni = args.cni ?? "cilium";
@@ -11,30 +11,32 @@ const csi = args.csi ?? "local-path-provisioner";
11
11
  const inlineManifests = [];
12
12
  const extraMounts = [];
13
13
  if (cni === "cilium") {
14
- const ciliumManifestCommand = new local.Command("cilium-manifest", {
15
- create: [
16
- "helm template",
17
- resolveChartPath("@highstate/cilium", "cilium", import.meta.url),
18
- "--namespace kube-system",
19
- "--set ipam.mode=kubernetes",
20
- // "--set kubeProxyReplacement=true",
21
- "--set kubeProxyReplacement=false",
22
- "--set operator.replicas=1",
23
- "--set hubble.relay.enabled=true",
24
- "--set hubble.ui.enabled=true",
25
- '--set securityContext.capabilities.ciliumAgent="{CHOWN,KILL,NET_ADMIN,NET_RAW,IPC_LOCK,SYS_ADMIN,SYS_RESOURCE,DAC_OVERRIDE,FOWNER,SETGID,SETUID}"',
26
- '--set securityContext.capabilities.cleanCiliumState="{NET_ADMIN,SYS_ADMIN,SYS_RESOURCE}"',
27
- "--set cgroup.autoMount.enabled=false",
28
- "--set cgroup.hostRoot=/sys/fs/cgroup"
29
- // "--set k8sServiceHost=localhost",
30
- // "--set k8sServicePort=7445",
31
- // "--set bpf.lbExternalClusterIP=true"
32
- ].join(" "),
33
- logging: "stderr"
14
+ const charts = await eval(
15
+ `import("@highstate/cilium/charts.json", { with: { type: "json" } })`
16
+ );
17
+ const cilium = new RenderedChart("cilium", {
18
+ charts: charts.default,
19
+ chart: "cilium",
20
+ namespace: "kube-system",
21
+ values: {
22
+ "ipam.mode": "kubernetes",
23
+ // "kubeProxyReplacement": "true",
24
+ kubeProxyReplacement: "false",
25
+ "operator.replicas": "1",
26
+ "hubble.relay.enabled": "true",
27
+ "hubble.ui.enabled": "true",
28
+ "securityContext.capabilities.ciliumAgent": "{CHOWN,KILL,NET_ADMIN,NET_RAW,IPC_LOCK,SYS_ADMIN,SYS_RESOURCE,DAC_OVERRIDE,FOWNER,SETGID,SETUID}",
29
+ "securityContext.capabilities.cleanCiliumState": "{NET_ADMIN,SYS_ADMIN,SYS_RESOURCE}",
30
+ "cgroup.autoMount.enabled": "false",
31
+ "cgroup.hostRoot": "/sys/fs/cgroup"
32
+ // "k8sServiceHost": "localhost",
33
+ // "k8sServicePort": "7445",
34
+ // "bpf.lbExternalClusterIP": "true",
35
+ }
34
36
  });
35
37
  inlineManifests.push({
36
38
  name: "cilium",
37
- contents: ciliumManifestCommand.stdout
39
+ contents: cilium.manifest
38
40
  });
39
41
  }
40
42
  if (csi === "local-path-provisioner") {
@@ -46,11 +48,7 @@ if (csi === "local-path-provisioner") {
46
48
  });
47
49
  inlineManifests.push({
48
50
  name: "local-path-provisioner",
49
- contents: readResolvedPackageFileSync(
50
- "@highstate/talos/cluster",
51
- "assets/local-path-provisioner.yaml",
52
- import.meta.url
53
- )
51
+ contents: await readFile("../../assets/local-path-provisioner.yaml", "utf-8")
54
52
  });
55
53
  }
56
54
  const clusterName = args.clusterName ?? name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/talos",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "assets",
@@ -14,14 +14,14 @@
14
14
  },
15
15
  "scripts": {
16
16
  "build": "pkgroll --tsconfig=tsconfig.build.json",
17
- "generate-local-path-provisioner": "bash ./scripts/generate-local-path-provisioner.sh"
17
+ "update-assets": "./scripts/update-assets.sh"
18
18
  },
19
19
  "dependencies": {
20
- "@highstate/cilium": "^0.6.2",
21
- "@highstate/common": "^0.6.2",
22
- "@highstate/contract": "^0.6.2",
23
- "@highstate/k8s": "^0.6.2",
24
- "@highstate/pulumi": "^0.6.2",
20
+ "@highstate/cilium": "^0.7.0",
21
+ "@highstate/common": "^0.7.0",
22
+ "@highstate/contract": "^0.7.0",
23
+ "@highstate/k8s": "^0.7.0",
24
+ "@highstate/pulumi": "^0.7.0",
25
25
  "@pulumi/command": "^1.0.2",
26
26
  "@pulumiverse/talos": "^0.4.1"
27
27
  },
@@ -31,5 +31,5 @@
31
31
  "devDependencies": {
32
32
  "pkgroll": "^2.5.1"
33
33
  },
34
- "gitHead": "dfd1d6878fc7d12954b6591d5ee1783d3c501eca"
34
+ "gitHead": "2f5227f7b88cf38946e490fc4cdb96127bd8b174"
35
35
  }