mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 11:11:03 +02:00
Azure AKS, experimenting with config
This commit is contained in:
parent
1db6dd5dfd
commit
a0a41299ef
3 changed files with 62 additions and 1 deletions
16
templates/config-to-aks-k8s.jsonnet
Normal file
16
templates/config-to-aks-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
local engine = import "engine/aks-k8s.jsonnet";
|
||||||
|
local decode = import "util/decode-config.jsonnet";
|
||||||
|
local components = import "components.jsonnet";
|
||||||
|
|
||||||
|
// Import config
|
||||||
|
local config = import "config.json";
|
||||||
|
|
||||||
|
// Produce patterns from config
|
||||||
|
local patterns = decode(config);
|
||||||
|
|
||||||
|
// Extract resources usnig the engine
|
||||||
|
local resourceList = engine.package(patterns);
|
||||||
|
|
||||||
|
resourceList
|
||||||
|
|
||||||
45
templates/engine/aks-k8s.jsonnet
Normal file
45
templates/engine/aks-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
|
||||||
|
local k8s = import "k8s.jsonnet";
|
||||||
|
|
||||||
|
local ns = {
|
||||||
|
apiVersion: "v1",
|
||||||
|
kind: "Namespace",
|
||||||
|
metadata: {
|
||||||
|
name: "trustgraph",
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
local sc = {
|
||||||
|
apiVersion: "storage.k8s.io/v1",
|
||||||
|
kind: "StorageClass",
|
||||||
|
metadata: {
|
||||||
|
name: "tg",
|
||||||
|
},
|
||||||
|
provisioner: "disk.csi.azure.com",
|
||||||
|
parameters: {
|
||||||
|
// Standard disks (spinning magnetic), Locally Redundant Storage
|
||||||
|
// Cheapest, basically
|
||||||
|
skuName: "Standard_LRS",
|
||||||
|
},
|
||||||
|
reclaimPolicy: "Delete",
|
||||||
|
volumeBindingMode: "WaitForFirstConsumer",
|
||||||
|
};
|
||||||
|
|
||||||
|
k8s + {
|
||||||
|
|
||||||
|
// Extract resources usnig the engine
|
||||||
|
package:: function(patterns)
|
||||||
|
local resources = [sc, ns] + std.flattenArrays([
|
||||||
|
p.create(self) for p in std.objectValues(patterns)
|
||||||
|
]);
|
||||||
|
local resourceList = {
|
||||||
|
apiVersion: "v1",
|
||||||
|
kind: "List",
|
||||||
|
items: [ns, sc] + resources,
|
||||||
|
};
|
||||||
|
resourceList
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -121,7 +121,7 @@ class Packager:
|
||||||
return self.generate_docker_compose(
|
return self.generate_docker_compose(
|
||||||
"docker-compose", version, config
|
"docker-compose", version, config
|
||||||
)
|
)
|
||||||
elif platform in set(["minikube-k8s", "gcp-k8s"]):
|
elif platform in set(["minikube-k8s", "gcp-k8s", "aks-k8s"]):
|
||||||
return self.generate_k8s(
|
return self.generate_k8s(
|
||||||
platform, version, config
|
platform, version, config
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue