refator: put all modules under modules directory

This commit is contained in:
Jaka Hudoklin 2019-03-05 20:57:55 +01:00
parent e3b788c5dc
commit da12e2a319
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95
32 changed files with 148 additions and 580739 deletions

View file

@ -20,15 +20,11 @@ let
buildResources = args:
(evalKubernetesModules args).config.kubernetes.generated;
modules = import ./modules;
kubenix = {
inherit evalKubernetesModules buildResources kubenix;
lib = lib';
submodules = ./submodules.nix;
k8s = ./k8s;
k8s-submodules = ./k8s/submodule.nix;
istio = ./istio;
testing = ./testing;
helm = ./helm;
};
} // modules;
in kubenix

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

8
modules/default.nix Normal file
View file

@ -0,0 +1,8 @@
{
submodules = ./submodules.nix;
k8s = ./k8s;
k8s-submodules = ./k8s/submodule.nix;
istio = ./istio;
testing = ./testing;
helm = ./helm;
}

View file

@ -11814,7 +11814,7 @@ let
};
"mountPropagation" = mkOption {
description = "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is beta in 1.10.";
description = "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.";
type = (types.nullOr types.str);
};
@ -23299,7 +23299,7 @@ let
};
"mountPropagation" = mkOption {
description = "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is beta in 1.10.";
description = "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.";
type = (types.nullOr types.str);
};

View file

@ -10756,7 +10756,7 @@ let
};
"enableServiceLinks" = mkOption {
description = "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links.";
description = "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.";
type = (types.nullOr types.bool);
};
@ -23142,7 +23142,7 @@ let
};
"enableServiceLinks" = mkOption {
description = "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links.";
description = "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.";
type = (types.nullOr types.bool);
};

View file

@ -1244,8 +1244,8 @@ let
};
"selector" = mkOption {
description = "A label query over pods that are managed by the daemon set. Must match in order to be controlled. If empty, defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors";
type = (types.nullOr (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"));
description = "A label query over pods that are managed by the daemon set. Must match in order to be controlled. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors";
type = (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector");
};
"template" = mkOption {
@ -1264,8 +1264,6 @@ let
"revisionHistoryLimit" = mkOverride 1002 null;
"selector" = mkOverride 1002 null;
"updateStrategy" = mkOverride 1002 null;
};
};
@ -1496,8 +1494,8 @@ let
};
"selector" = mkOption {
description = "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.";
type = (types.nullOr (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"));
description = "Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.";
type = (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector");
};
"strategy" = mkOption {
@ -1522,8 +1520,6 @@ let
"revisionHistoryLimit" = mkOverride 1002 null;
"selector" = mkOverride 1002 null;
"strategy" = mkOverride 1002 null;
};
};
@ -1734,8 +1730,8 @@ let
};
"selector" = mkOption {
description = "Selector is a label query over pods that should match the replica count. If the selector is empty, it is defaulted to the labels present on the pod template. Label keys and values that must match in order to be controlled by this replica set. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors";
type = (types.nullOr (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"));
description = "Selector is a label query over pods that should match the replica count. Label keys and values that must match in order to be controlled by this replica set. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors";
type = (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector");
};
"template" = mkOption {
@ -1749,8 +1745,6 @@ let
"replicas" = mkOverride 1002 null;
"selector" = mkOverride 1002 null;
"template" = mkOverride 1002 null;
};
};
@ -2018,8 +2012,8 @@ let
};
"selector" = mkOption {
description = "selector is a label query over pods that should match the replica count. If empty, defaulted to labels on the pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors";
type = (types.nullOr (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"));
description = "selector is a label query over pods that should match the replica count. It must match the pod template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors";
type = (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector");
};
"serviceName" = mkOption {
@ -2050,8 +2044,6 @@ let
"revisionHistoryLimit" = mkOverride 1002 null;
"selector" = mkOverride 1002 null;
"updateStrategy" = mkOverride 1002 null;
"volumeClaimTemplates" = mkOverride 1002 null;
@ -7622,7 +7614,7 @@ let
"scaleIO" = mkOption {
description = "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.";
type = (types.nullOr (submoduleOf "io.k8s.api.core.v1.ScaleIOVolumeSource"));
type = (types.nullOr (submoduleOf "io.k8s.api.core.v1.ScaleIOPersistentVolumeSource"));
};
"storageClassName" = mkOption {
@ -8914,6 +8906,76 @@ let
};
};
"io.k8s.api.core.v1.ScaleIOPersistentVolumeSource" = {
options = {
"fsType" = mkOption {
description = "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.";
type = (types.nullOr types.str);
};
"gateway" = mkOption {
description = "The host address of the ScaleIO API Gateway.";
type = types.str;
};
"protectionDomain" = mkOption {
description = "The name of the ScaleIO Protection Domain for the configured storage.";
type = (types.nullOr types.str);
};
"readOnly" = mkOption {
description = "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.";
type = (types.nullOr types.bool);
};
"secretRef" = mkOption {
description = "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.";
type = (submoduleOf "io.k8s.api.core.v1.SecretReference");
};
"sslEnabled" = mkOption {
description = "Flag to enable/disable SSL communication with Gateway, default false";
type = (types.nullOr types.bool);
};
"storageMode" = mkOption {
description = "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.";
type = (types.nullOr types.str);
};
"storagePool" = mkOption {
description = "The ScaleIO Storage Pool associated with the protection domain.";
type = (types.nullOr types.str);
};
"system" = mkOption {
description = "The name of the storage system as configured in ScaleIO.";
type = types.str;
};
"volumeName" = mkOption {
description = "The name of a volume already created in the ScaleIO system that is associated with this volume source.";
type = (types.nullOr types.str);
};
};
config = {
"fsType" = mkOverride 1002 null;
"protectionDomain" = mkOverride 1002 null;
"readOnly" = mkOverride 1002 null;
"sslEnabled" = mkOverride 1002 null;
"storageMode" = mkOverride 1002 null;
"storagePool" = mkOverride 1002 null;
"volumeName" = mkOverride 1002 null;
};
};
"io.k8s.api.core.v1.ScaleIOVolumeSource" = {
options = {
"fsType" = mkOption {
@ -8927,7 +8989,7 @@ let
};
"protectionDomain" = mkOption {
description = "The name of the Protection Domain for the configured storage (defaults to \"default\").";
description = "The name of the ScaleIO Protection Domain for the configured storage.";
type = (types.nullOr types.str);
};
@ -8947,12 +9009,12 @@ let
};
"storageMode" = mkOption {
description = "Indicates whether the storage for a volume should be thick or thin (defaults to \"thin\").";
description = "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.";
type = (types.nullOr types.str);
};
"storagePool" = mkOption {
description = "The Storage Pool associated with the protection domain (defaults to \"default\").";
description = "The ScaleIO Storage Pool associated with the protection domain.";
type = (types.nullOr types.str);
};
@ -17806,7 +17868,7 @@ let
"scaleIO" = mkOption {
description = "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.";
type = (types.nullOr (submoduleOf "io.k8s.api.core.v1.ScaleIOVolumeSource"));
type = (types.nullOr (submoduleOf "io.k8s.api.core.v1.ScaleIOPersistentVolumeSource"));
};
"storageClassName" = mkOption {
@ -19111,7 +19173,7 @@ let
};
"protectionDomain" = mkOption {
description = "The name of the Protection Domain for the configured storage (defaults to \"default\").";
description = "The name of the ScaleIO Protection Domain for the configured storage.";
type = (types.nullOr types.str);
};
@ -19131,12 +19193,12 @@ let
};
"storageMode" = mkOption {
description = "Indicates whether the storage for a volume should be thick or thin (defaults to \"thin\").";
description = "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.";
type = (types.nullOr types.str);
};
"storagePool" = mkOption {
description = "The Storage Pool associated with the protection domain (defaults to \"default\").";
description = "The ScaleIO Storage Pool associated with the protection domain.";
type = (types.nullOr types.str);
};

View file

@ -422,7 +422,7 @@ let
};
"namespaceSelector" = mkOption {
description = "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is other cluster scoped resource, it is not subjected to the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.";
description = "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.";
type = (types.nullOr (submoduleOf "io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"));
};

View file

@ -29,7 +29,7 @@ let
config = mkMerge [{
boot.postBootCommands = "rm -fr /var/lib/kubernetes/secrets /tmp/shared/*";
virtualisation.memorySize = mkDefault 2048;
virtualisation.cores = mkDefault "all";
virtualisation.cores = mkDefault 16;
virtualisation.diskSize = mkDefault 4096;
networking = {
inherit extraHosts;

View file

@ -5,44 +5,78 @@ let
lib = kubenix.lib;
generateK8S = spec: import ./k8s/generator.nix {
generateK8S = spec: import ./generators/k8s {
inherit pkgs;
inherit (pkgs) lib;
inherit spec;
};
generateIstio = spec: import ./istio/generator.nix {
generateIstio = import ./generators/istio {
inherit pkgs;
inherit (pkgs) lib;
inherit spec;
};
in {
generate.k8s = pkgs.linkFarm "k8s-generated.nix" [{
name = "v1.7.nix";
path = generateK8S ./k8s/specs/1.7/swagger.json;
path = generateK8S "${pkgs.fetchFromGitHub {
owner = "kubernetes";
repo = "kubernetes";
rev = "v1.7.16";
sha256 = "1ksalw3hzbcca89n9h3pas9nqj2n5gq3rbpdx633ycqb8g46h1iw";
}}/api/openapi-spec/swagger.json";
} {
name = "v1.8.nix";
path = generateK8S ./k8s/specs/1.8/swagger.json;
path = generateK8S "${pkgs.fetchFromGitHub {
owner = "kubernetes";
repo = "kubernetes";
rev = "v1.8.15";
sha256 = "1mwaafnkimr4kwqws4qli11wbavpmf27i6pjq77sfsapw9sz54j4";
}}/api/openapi-spec/swagger.json";
} {
name = "v1.9.nix";
path = generateK8S ./k8s/specs/1.9/swagger.json;
path = generateK8S "${pkgs.fetchFromGitHub {
owner = "kubernetes";
repo = "kubernetes";
rev = "v1.9.11";
sha256 = "1wl944ci7k8knrkdrc328agyq4c953j9dm0sn314s42j18lfd7rv";
}}/api/openapi-spec/swagger.json";
} {
name = "v1.10.nix";
path = generateK8S ./k8s/specs/1.10/swagger.json;
path = generateK8S "${pkgs.fetchFromGitHub {
owner = "kubernetes";
repo = "kubernetes";
rev = "v1.10.13";
sha256 = "07hwcamlc1kh5flwv4ahfkcg2lyhnbs8q2xczaws6v3sjxaycrrn";
}}/api/openapi-spec/swagger.json";
} {
name = "v1.11.nix";
path = generateK8S ./k8s/specs/1.11/swagger.json;
path = generateK8S "${pkgs.fetchFromGitHub {
owner = "kubernetes";
repo = "kubernetes";
rev = "v1.11.8";
sha256 = "1q6x38zdycd4ai31gn666hg41bs4q32dyz2d07x76hj33fkzqs1f";
}}/api/openapi-spec/swagger.json";
} {
name = "v1.12.nix";
path = generateK8S ./k8s/specs/1.12/swagger.json;
path = generateK8S "${pkgs.fetchFromGitHub {
owner = "kubernetes";
repo = "kubernetes";
rev = "v1.12.6";
sha256 = "0p9wh264xfm4c0inz99jclf603c414807vn19gfn62bfls3jcmgf";
}}/api/openapi-spec/swagger.json";
} {
name = "v1.13.nix";
path = generateK8S ./k8s/specs/1.13/swagger.json;
path = generateK8S "${pkgs.fetchFromGitHub {
owner = "kubernetes";
repo = "kubernetes";
rev = "v1.13.4";
sha256 = "1q3dc416fr9nzy64pl7rydahygnird0vpk9yflssw7v9gx84m6x9";
}}/api/openapi-spec/swagger.json";
}];
generate.istio = pkgs.linkFarm "istio-generated.nix" [{
name = "latest.nix";
path = generateIstio ./istio/istio-schema.json;
path = generateIstio;
}];
tests = import ./tests {