forked from chanwit/minifk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster_yaml.js
71 lines (65 loc) · 1.57 KB
/
cluster_yaml.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import * as param from '@jkcfg/std/param'
import * as std from '@jkcfg/std'
const config = param.all();
let output = [];
let cluster = {
apiVersion: "cluster.k8s.io/v1alpha1",
kind: "Cluster",
metadata: {
name: "example",
namespace: "weavek8sops",
},
spec: {
clusterNetwork: {
services: {
cidrBlocks: ["10.96.0.0/12"],
},
pods: {
cidrBlocks: ["192.168.0.0/16"],
},
serviceDomain: "cluster.local",
},
providerSpec: {
value: {
apiVersion: "baremetalproviderspec/v1alpha1",
kind: "BareMetalClusterProviderSpec",
user: "root",
os: {
files: [{
source: {
configmap: "repo",
key: "kubernetes.repo",
},
destination: "/etc/yum.repos.d/kubernetes.repo",
},
{
source: {
configmap: "repo",
key: "docker-ce.repo",
},
destination: "/etc/yum.repos.d/docker-ce.repo",
},
{
source: {
configmap: "docker",
key: "daemon.json",
},
destination: "/etc/docker/daemon.json",
}]
},
cri: {
kind: "docker",
package: "docker-ce",
version: "18.09.7",
},
}
}
}
}
if (config.externalLoadBalancer !== undefined) {
cluster.spec.providerSpec.value.apiServer = {
externalLoadBalancer: `${config.externalLoadBalancer}`
};
}
output.push({ path: 'cluster.yaml', value: cluster});
export default output;