@highstate/talos 0.6.2 → 0.7.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.
@@ -1,9 +1,10 @@
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
+ import { Provider, core } from '@pulumi/kubernetes';
7
8
 
8
9
  const { name, args, inputs, outputs } = forUnit(talos.cluster);
9
10
  const cni = args.cni ?? "cilium";
@@ -11,30 +12,31 @@ const csi = args.csi ?? "local-path-provisioner";
11
12
  const inlineManifests = [];
12
13
  const extraMounts = [];
13
14
  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"
15
+ const charts = await eval(
16
+ `import("@highstate/cilium/charts.json", { with: { type: "json" } })`
17
+ );
18
+ const cilium = new RenderedChart("cilium", {
19
+ namespace: "kube-system",
20
+ chart: charts.default.cilium,
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;
@@ -161,11 +159,16 @@ function getConfigurationApplyArgs(node, machineConfiguration) {
161
159
  ]
162
160
  };
163
161
  }
162
+ const provider = new Provider(name, { kubeconfig });
163
+ const kubeSystem = core.v1.Namespace.get("kube-system", "kube-system", { provider });
164
164
  var index = outputs({
165
165
  k8sCluster: {
166
- name: clusterName,
167
- kubeconfig,
168
- cni: cni === "none" ? "unknown" : cni
166
+ info: {
167
+ id: kubeSystem.metadata.uid,
168
+ name: clusterName,
169
+ cni: cni === "none" ? void 0 : cni
170
+ },
171
+ kubeconfig
169
172
  },
170
173
  talosCluster: {
171
174
  clientConfiguration,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/talos",
3
- "version": "0.6.2",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "assets",
@@ -14,15 +14,16 @@
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.1",
21
+ "@highstate/common": "^0.7.1",
22
+ "@highstate/contract": "^0.7.1",
23
+ "@highstate/k8s": "^0.7.1",
24
+ "@highstate/pulumi": "^0.7.1",
25
25
  "@pulumi/command": "^1.0.2",
26
+ "@pulumi/kubernetes": "^4.18.0",
26
27
  "@pulumiverse/talos": "^0.4.1"
27
28
  },
28
29
  "peerDependencies": {
@@ -31,5 +32,5 @@
31
32
  "devDependencies": {
32
33
  "pkgroll": "^2.5.1"
33
34
  },
34
- "gitHead": "dfd1d6878fc7d12954b6591d5ee1783d3c501eca"
35
+ "gitHead": "76c38ce5dbf7a710cf0e6339f52e86358537a99a"
35
36
  }