2024-09-05 22:31:36 +01:00
|
|
|
|
|
|
|
|
local engine = import "k8s.jsonnet";
|
|
|
|
|
local decode = import "decode-config.jsonnet";
|
|
|
|
|
local components = import "components.jsonnet";
|
|
|
|
|
|
|
|
|
|
// Import config
|
|
|
|
|
local config = import "config.json";
|
|
|
|
|
|
|
|
|
|
// Produce patterns from config
|
|
|
|
|
local patterns = decode(config);
|
|
|
|
|
|
2024-09-06 23:04:07 +01:00
|
|
|
local ns = {
|
|
|
|
|
apiVersion: "v1",
|
|
|
|
|
kind: "Namespace",
|
|
|
|
|
metadata: {
|
|
|
|
|
name: "trustgraph",
|
|
|
|
|
},
|
|
|
|
|
"spec": {
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-07 11:06:20 +01:00
|
|
|
local sc = {
|
|
|
|
|
apiVersion: "storage.k8s.io/v1",
|
|
|
|
|
kind: "StorageClass",
|
|
|
|
|
metadata: {
|
|
|
|
|
name: "tg",
|
|
|
|
|
},
|
2024-09-07 17:12:29 +01:00
|
|
|
provisioner: "pd.csi.storage.gke.io",
|
|
|
|
|
parameters: {
|
|
|
|
|
type: "pd-balanced",
|
|
|
|
|
"csi.storage.k8s.io/fstype": "ext4",
|
|
|
|
|
},
|
2024-09-07 11:06:20 +01:00
|
|
|
reclaimPolicy: "Delete",
|
2024-09-07 17:12:29 +01:00
|
|
|
volumeBindingMode: "WaitForFirstConsumer",
|
2024-09-07 11:06:20 +01:00
|
|
|
};
|
|
|
|
|
|
2024-09-07 12:47:56 +01:00
|
|
|
//patterns["pulsar"].create(engine)
|
|
|
|
|
|
2024-09-05 22:31:36 +01:00
|
|
|
// Extract resources usnig the engine
|
2024-09-07 12:47:56 +01:00
|
|
|
local resources = std.flattenArrays([
|
|
|
|
|
p.create(engine) for p in std.objectValues(patterns)
|
|
|
|
|
]);
|
2024-09-05 22:31:36 +01:00
|
|
|
|
2024-09-06 23:04:07 +01:00
|
|
|
local resourceList = {
|
|
|
|
|
apiVersion: "v1",
|
|
|
|
|
kind: "List",
|
2024-09-07 12:47:56 +01:00
|
|
|
items: [ns, sc] + resources,
|
2024-09-06 23:04:07 +01:00
|
|
|
};
|
|
|
|
|
|
2024-09-07 12:47:56 +01:00
|
|
|
|
|
|
|
|
resourceList
|
|
|
|
|
|