mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-13 08:30:05 +01:00
refactor: remove old tests
This commit is contained in:
parent
711073a6e6
commit
de5114cfc0
10 changed files with 0 additions and 321 deletions
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"data": {
|
|
||||||
"game.properties": "enemies=aliens\nlives=3\nenemies.cheat=true\nenemies.cheat.level=noGoodRotten\nsecret.code.passphrase=UUDDLRLRBABAS\nsecret.code.allowed=true\nsecret.code.lives=30\n",
|
|
||||||
"ui.properties": "color.good=purple\ncolor.bad=yellow\nallow.textmode=true\nhow.nice.to.look=fairlyNice\n"
|
|
||||||
},
|
|
||||||
"kind": "ConfigMap"
|
|
||||||
}
|
|
||||||
11
test/cr.json
11
test/cr.json
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
"apiVersion": "stable.example.com/v1",
|
|
||||||
"kind": "CronTab",
|
|
||||||
"metadata": {
|
|
||||||
"name": "my-new-cron-object"
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"cronSpec": "* * * * */5",
|
|
||||||
"image": "my-awesome-cron-image"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"apiVersion": "apiextensions.k8s.io/v1beta1",
|
|
||||||
"kind": "CustomResourceDefinition",
|
|
||||||
"metadata": {
|
|
||||||
"name": "crontabs.stable.example.com"
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"group": "stable.example.com",
|
|
||||||
"version": "v1",
|
|
||||||
"scope": "Namespaced",
|
|
||||||
"names": {
|
|
||||||
"plural": "crontabs",
|
|
||||||
"singular": "crontab",
|
|
||||||
"kind": "CronTab",
|
|
||||||
"shortNames": [
|
|
||||||
"ct"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
{
|
|
||||||
"kind": "DaemonSet",
|
|
||||||
"metadata": {
|
|
||||||
"labels": {
|
|
||||||
"k8s-app": "fluentd-logging"
|
|
||||||
},
|
|
||||||
"name": "fluentd-elasticsearch",
|
|
||||||
"namespace": "kube-system"
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"selector": {
|
|
||||||
"matchLabels": {
|
|
||||||
"name": "fluentd-elasticsearch"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"template": {
|
|
||||||
"metadata": {
|
|
||||||
"labels": {
|
|
||||||
"name": "fluentd-elasticsearch"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"containers": [
|
|
||||||
{
|
|
||||||
"image": "gcr.io/google-containers/fluentd-elasticsearch:1.20",
|
|
||||||
"name": "fluentd-elasticsearch",
|
|
||||||
"resources": {
|
|
||||||
"limits": {
|
|
||||||
"memory": "200Mi"
|
|
||||||
},
|
|
||||||
"requests": {
|
|
||||||
"cpu": "100m",
|
|
||||||
"memory": "200Mi"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"volumeMounts": [
|
|
||||||
{
|
|
||||||
"mountPath": "/var/log",
|
|
||||||
"name": "varlog"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"mountPath": "/var/lib/docker/containers",
|
|
||||||
"name": "varlibdockercontainers",
|
|
||||||
"readOnly": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"terminationGracePeriodSeconds": 30,
|
|
||||||
"volumes": [
|
|
||||||
{
|
|
||||||
"hostPath": {
|
|
||||||
"path": "/var/log"
|
|
||||||
},
|
|
||||||
"name": "varlog"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hostPath": {
|
|
||||||
"path": "/var/lib/docker/containers"
|
|
||||||
},
|
|
||||||
"name": "varlibdockercontainers"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
kubernetes.version = "1.9";
|
|
||||||
|
|
||||||
require = [./modules.nix ./deployment.nix];
|
|
||||||
}
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
"metadata": {
|
|
||||||
"name": "nginx-deployment",
|
|
||||||
"labels": {
|
|
||||||
"app": "nginx"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"selector": {
|
|
||||||
"matchLabels": {
|
|
||||||
"app": "nginx"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"template": {
|
|
||||||
"metadata": {
|
|
||||||
"labels": {
|
|
||||||
"app": "nginx"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"containers": {
|
|
||||||
"nginx": {
|
|
||||||
"name": "nginx",
|
|
||||||
"image": "nginx:1.7.9",
|
|
||||||
"ports": {
|
|
||||||
"80": {}
|
|
||||||
},
|
|
||||||
"resources": {
|
|
||||||
"requests": {
|
|
||||||
"cpu": "100m"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
{lib, k8s, ...}:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
kubernetes.resources = {
|
|
||||||
deployments.deployment = mkMerge [
|
|
||||||
(k8s.loadJSON ./deployment.json)
|
|
||||||
{
|
|
||||||
metadata.name = "abcd";
|
|
||||||
nix.dependencies = ["configMaps/configmap"];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
configMaps.configmap = k8s.loadJSON ./configMap.json;
|
|
||||||
namespaces.namespace = k8s.loadJSON ./namespace.json;
|
|
||||||
daemonSets.daemonset = k8s.loadJSON ./daemonset.json;
|
|
||||||
services.service = k8s.loadJSON ./service.json;
|
|
||||||
customResourceDefinitions.cron = k8s.loadJSON ./crd.json;
|
|
||||||
};
|
|
||||||
|
|
||||||
kubernetes.customResources.cron.my-awesome-cron-object = k8s.loadJSON ./cr.json;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
110
test/modules.nix
110
test/modules.nix
|
|
@ -1,110 +0,0 @@
|
||||||
{lib, k8s, config, ...}:
|
|
||||||
|
|
||||||
with k8s;
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
kubernetes.moduleDefinitions.nginx.module = {name, config, ...}: {
|
|
||||||
options = {
|
|
||||||
port = mkOption {
|
|
||||||
description = "Port for nginx to listen on";
|
|
||||||
type = types.int;
|
|
||||||
default = 80;
|
|
||||||
};
|
|
||||||
|
|
||||||
password = mkSecretOption {
|
|
||||||
description = "Nginx simple auth credentials";
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
|
||||||
kubernetes.resources.deployments.nginx = mkMerge [
|
|
||||||
(loadJSON ./deployment.json)
|
|
||||||
{
|
|
||||||
metadata.name = "${name}-nginx";
|
|
||||||
|
|
||||||
spec.template.spec.containers.nginx.ports."80" = {
|
|
||||||
containerPort = config.port;
|
|
||||||
};
|
|
||||||
|
|
||||||
spec.template.spec.containers.nginx.env.name =
|
|
||||||
mkIf (config.password != null) (secretToEnv config.password);
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
kubernetes.resources.configMaps.nginx = mkMerge [
|
|
||||||
(loadJSON ./configMap.json)
|
|
||||||
{
|
|
||||||
metadata.name = mkForce "${name}-nginx";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
kubernetes.modules.app-v1 = {
|
|
||||||
module = "nginx";
|
|
||||||
configuration.password.name = "test2";
|
|
||||||
configuration.password.key = "password";
|
|
||||||
|
|
||||||
configuration.kubernetes.resources.customResourceDefinitions.secret-claims = {
|
|
||||||
kind = "CustomResourceDefinition";
|
|
||||||
apiVersion = "apiextensions.k8s.io/v1beta1";
|
|
||||||
metadata.name = "secretclaims.vaultproject.io";
|
|
||||||
spec = {
|
|
||||||
group = "vaultproject.io";
|
|
||||||
version = "v1";
|
|
||||||
scope = "Namespaced";
|
|
||||||
names = {
|
|
||||||
plural = "secretclaims";
|
|
||||||
kind = "SecretClaim";
|
|
||||||
shortNames = ["scl"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
configuration.kubernetes.customResources.secret-claims.claim = {
|
|
||||||
metadata.name = "test";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
kubernetes.modules.app-v2 = {
|
|
||||||
module = "nginx";
|
|
||||||
configuration.port = 8080;
|
|
||||||
|
|
||||||
configuration.kubernetes.modules.subsubmodule = {
|
|
||||||
module = "nginx";
|
|
||||||
configuration.kubernetes.resources.customResourceDefinitions.secret-claims = {
|
|
||||||
kind = "CustomResourceDefinition";
|
|
||||||
apiVersion = "apiextensions.k8s.io/v1beta1";
|
|
||||||
metadata.name = "secretclaims.vaultproject.io";
|
|
||||||
spec = {
|
|
||||||
group = "vaultproject.io";
|
|
||||||
version = "v1";
|
|
||||||
scope = "Namespaced";
|
|
||||||
names = {
|
|
||||||
plural = "secretclaims";
|
|
||||||
kind = "SecretClaim";
|
|
||||||
shortNames = ["scl"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
configuration.kubernetes.customResources.secret-claims.claim = {
|
|
||||||
metadata.name = "test";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
kubernetes.resources.services.nginx = loadJSON ./service.json;
|
|
||||||
|
|
||||||
kubernetes.defaultModuleConfiguration.all = [{
|
|
||||||
config.kubernetes.defaults.deployments.spec.replicas = mkDefault 3;
|
|
||||||
}];
|
|
||||||
|
|
||||||
kubernetes.defaultModuleConfiguration.nginx = {config, name, ...}: {
|
|
||||||
kubernetes.defaults.deployments.spec.replicas = 4;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"kind": "Namespace",
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"metadata": {
|
|
||||||
"name": "openshift-origin",
|
|
||||||
"labels": {
|
|
||||||
"name": "openshift-origin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"kind": "Service",
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"metadata": {
|
|
||||||
"name": "nginx"
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"selector": {
|
|
||||||
"app": "nginx"
|
|
||||||
},
|
|
||||||
"ports": [
|
|
||||||
{
|
|
||||||
"name": "http",
|
|
||||||
"protocol": "TCP",
|
|
||||||
"port": 80,
|
|
||||||
"targetPort": 80
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "https",
|
|
||||||
"protocol": "TCP",
|
|
||||||
"port": 443,
|
|
||||||
"targetPort": 443
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue