mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-29 10:26:21 +02:00
K8s (#58)
Added templates which produce K8s resources. With the provided GCP wrapper, it works on GCP K8s cluster. This isn't stable enough for other folks to use so will need more piloting before it can be documented and released.
This commit is contained in:
parent
7af32b0eef
commit
f661791bbf
50 changed files with 1037 additions and 345 deletions
52
templates/config-to-gcp-k8s.jsonnet
Normal file
52
templates/config-to-gcp-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
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);
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
local sc = {
|
||||
apiVersion: "storage.k8s.io/v1",
|
||||
kind: "StorageClass",
|
||||
metadata: {
|
||||
name: "tg",
|
||||
},
|
||||
provisioner: "pd.csi.storage.gke.io",
|
||||
parameters: {
|
||||
type: "pd-balanced",
|
||||
"csi.storage.k8s.io/fstype": "ext4",
|
||||
},
|
||||
reclaimPolicy: "Delete",
|
||||
volumeBindingMode: "WaitForFirstConsumer",
|
||||
};
|
||||
|
||||
//patterns["pulsar"].create(engine)
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resources = std.flattenArrays([
|
||||
p.create(engine) for p in std.objectValues(patterns)
|
||||
]);
|
||||
|
||||
local resourceList = {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
items: [ns, sc] + resources,
|
||||
};
|
||||
|
||||
|
||||
resourceList
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue