mirror of
https://github.com/Noratrieb/config-language.git
synced 2026-01-14 08:35:08 +01:00
stuff
This commit is contained in:
commit
bce268cceb
13 changed files with 672 additions and 0 deletions
45
example-configs/kubernetes/deployment-dry.nix
Normal file
45
example-configs/kubernetes/deployment-dry.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
let
|
||||
trivialWebService = { name, selectorLabel, port, extraPodLabels ? { } }:
|
||||
[
|
||||
{
|
||||
apiVersion = "apps/v1";
|
||||
kind = "Deployment";
|
||||
metadata = {
|
||||
inherit name;
|
||||
};
|
||||
spec = {
|
||||
selector.matchLabels = selectorLabel;
|
||||
replicas = 2;
|
||||
template = {
|
||||
metadata.labels = selectorLabel // extraPodLabels;
|
||||
spec.containters = [
|
||||
{
|
||||
inherit name;
|
||||
image = "nginx";
|
||||
ports = [{ containerPort = port; }];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
apiVersion = "apps/v1";
|
||||
kind = "Service";
|
||||
metadata = {
|
||||
inherit name;
|
||||
labels = selectorLabel;
|
||||
};
|
||||
spec = {
|
||||
ports = { port = 80; protocol = "TCP"; };
|
||||
selector = selectorLabel;
|
||||
};
|
||||
}
|
||||
]
|
||||
;
|
||||
in
|
||||
trivialWebService {
|
||||
name = "my-nginx";
|
||||
selectorLabel = { run = "my-nginx"; };
|
||||
port = 80;
|
||||
extraPodLabels = { someOther = "label"; };
|
||||
}
|
||||
33
example-configs/kubernetes/deployment-raw.nix
Normal file
33
example-configs/kubernetes/deployment-raw.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
[
|
||||
{
|
||||
apiVersion = "apps/v1";
|
||||
kind = "Deployment";
|
||||
metadata.name = "my-nginx";
|
||||
spec = {
|
||||
selector.matchLabels.run = "my-nginx";
|
||||
replicas = 2;
|
||||
template = {
|
||||
metadata.labels.run = "my-nginx";
|
||||
spec.containters = [
|
||||
{
|
||||
name = "my-nginx";
|
||||
image = "nginx";
|
||||
ports = [{ containerPort = 80; }];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
apiVersion = "apps/v1";
|
||||
kind = "Service";
|
||||
metadata = {
|
||||
name = "my-nginx";
|
||||
labels.run = "my-nginx";
|
||||
};
|
||||
spec = {
|
||||
ports = { port = 80; protocol = "TCP"; };
|
||||
selector = { run = "my-nginx"; };
|
||||
};
|
||||
}
|
||||
]
|
||||
33
example-configs/kubernetes/deployment.yml
Normal file
33
example-configs/kubernetes/deployment.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# real k8s configs use --- and not a top-level array
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-nginx
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
run: my-nginx
|
||||
replicas: 2
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
run: my-nginx
|
||||
someOther: label
|
||||
spec:
|
||||
containers:
|
||||
- name: my-nginx
|
||||
image: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: my-nginx
|
||||
labels:
|
||||
run: my-nginx
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
selector:
|
||||
run: my-nginx
|
||||
34
example-configs/rust-cargo/Cargo.json
Normal file
34
example-configs/rust-cargo/Cargo.json
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"cargo-features": ["public-dependency"],
|
||||
"package": {
|
||||
"name": "std",
|
||||
"version": "0.0.0",
|
||||
"metadata": { "fortanix-sgx": { "threads": 125, "heap_size": 134217728 } }
|
||||
},
|
||||
"lib": { "crate-type": ["dylib", "rlib"] },
|
||||
"dependencies": {
|
||||
"alloc": { "path": "../alloc", "public": true },
|
||||
"something": "1.2.0",
|
||||
"std_detect": {
|
||||
"path": "../stdarch/crates/std_detect",
|
||||
"default-features": false,
|
||||
"features": ["rustc-dep-of-std"]
|
||||
},
|
||||
"target": {
|
||||
"cfg(not(all(windows, target_env = \"msvc\", not(target_vendor = \"uwp\"))))": {
|
||||
"dependencies": {
|
||||
"miniz_oxide": {
|
||||
"version": "0.7.0",
|
||||
"optional": true,
|
||||
"default-features": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"backtrace": ["gimli-symbolize", "miniz_oxide/rustc-dep-of-std"],
|
||||
"gimli-symbolize": []
|
||||
},
|
||||
"bench": [{ "name": "stdbenches", "path": "benches/lib.rs", "test": true }]
|
||||
}
|
||||
37
example-configs/rust-cargo/Cargo.toml
Normal file
37
example-configs/rust-cargo/Cargo.toml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# github.com/rust-lang/rust:library/std/Cargo.toml
|
||||
|
||||
cargo-features = ["public-dependency"]
|
||||
|
||||
[package]
|
||||
name = "std"
|
||||
version = "0.0.0"
|
||||
|
||||
[lib]
|
||||
crate-type = ["dylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
alloc = { path = "../alloc", public = true }
|
||||
something = "1.2.0"
|
||||
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
|
||||
|
||||
[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
|
||||
miniz_oxide = { version = "0.7.0", optional = true, default-features = false }
|
||||
|
||||
|
||||
[features]
|
||||
backtrace = [
|
||||
"gimli-symbolize",
|
||||
'miniz_oxide/rustc-dep-of-std',
|
||||
]
|
||||
gimli-symbolize = []
|
||||
|
||||
[package.metadata.fortanix-sgx]
|
||||
# Maximum possible number of threads when testing
|
||||
threads = 125
|
||||
# Maximum heap size
|
||||
heap_size = 0x8000000
|
||||
|
||||
[[bench]]
|
||||
name = "stdbenches"
|
||||
path = "benches/lib.rs"
|
||||
test = true
|
||||
38
example-configs/rust-cargo/Cargo.yml
Normal file
38
example-configs/rust-cargo/Cargo.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
cargo-features: [public-dependency]
|
||||
|
||||
package:
|
||||
name: std
|
||||
version: "0.0.0"
|
||||
metadata:
|
||||
fortanix-sgx:
|
||||
threads: 125
|
||||
heap_size: 0x8000000
|
||||
lib:
|
||||
crate-type:
|
||||
- dylib
|
||||
- rlib
|
||||
dependencies:
|
||||
alloc:
|
||||
path: ../alloc
|
||||
public: true
|
||||
something: "1.2.0"
|
||||
std_detect:
|
||||
path: ../stdarch/crates/std_detect
|
||||
default-features: false
|
||||
features: [rustc-dep-of-std]
|
||||
target:
|
||||
'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))':
|
||||
dependencies:
|
||||
miniz_oxide:
|
||||
version: "0.7.0"
|
||||
optional: true
|
||||
default-features: false
|
||||
features:
|
||||
backtrace:
|
||||
- gimli-symbolize
|
||||
- miniz_oxide/rustc-dep-of-std
|
||||
gimli-symbolize: []
|
||||
bench:
|
||||
- name: stdbenches
|
||||
path: benches/lib.rs
|
||||
test: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue