@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.
- package/dist/cluster/index.js +35 -32
- package/package.json +9 -8
package/dist/cluster/index.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
import {
|
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 {
|
6
|
-
import {
|
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
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
"
|
22
|
-
"
|
23
|
-
|
24
|
-
"
|
25
|
-
|
26
|
-
|
27
|
-
"
|
28
|
-
"
|
29
|
-
|
30
|
-
|
31
|
-
// "
|
32
|
-
|
33
|
-
|
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:
|
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:
|
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
|
-
|
167
|
-
|
168
|
-
|
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.
|
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
|
-
"
|
17
|
+
"update-assets": "./scripts/update-assets.sh"
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"@highstate/cilium": "^0.
|
21
|
-
"@highstate/common": "^0.
|
22
|
-
"@highstate/contract": "^0.
|
23
|
-
"@highstate/k8s": "^0.
|
24
|
-
"@highstate/pulumi": "^0.
|
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": "
|
35
|
+
"gitHead": "76c38ce5dbf7a710cf0e6339f52e86358537a99a"
|
35
36
|
}
|