mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
feat(istio): fixes and add simple test
This commit is contained in:
parent
33a344119b
commit
e1e6173a2c
6 changed files with 1112 additions and 1040 deletions
|
|
@ -4697,7 +4697,7 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
};
|
||||
} // (import ./overrides.nix {inherit definitions lib;});
|
||||
in {
|
||||
kubernetes.customResources = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ let
|
|||
") value.config)}};
|
||||
"}};
|
||||
") definitions)}
|
||||
};
|
||||
} // (import ./overrides.nix {inheirt definitions lib;}));
|
||||
in {
|
||||
kubernetes.customResources = [
|
||||
${concatMapStrings (resource: ''{
|
||||
|
|
|
|||
15
istio/overrides.nix
Normal file
15
istio/overrides.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ lib, definitions }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
"istio_networking_v1alpha3_StringMatch" = recursiveUpdate (recursiveUpdate
|
||||
definitions."istio_networking_v1alpha3_StringMatch_Exact"
|
||||
definitions."istio_networking_v1alpha3_StringMatch_Prefix"
|
||||
)
|
||||
definitions."istio_networking_v1alpha3_StringMatch_Regex";
|
||||
|
||||
"istio_networking_v1alpha3_PortSelector" = recursiveUpdate
|
||||
definitions."istio_networking_v1alpha3_PortSelector_Name"
|
||||
definitions."istio_networking_v1alpha3_PortSelector_Number";
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ let
|
|||
|
||||
getDefaults = resource: group: version: kind:
|
||||
catAttrs "default" (filter (default:
|
||||
(default.resource == null || default.resource == resource) &&
|
||||
(resource == null || default.resource == null || default.resource == resource) &&
|
||||
(default.group == null || default.group == group) &&
|
||||
(default.version == null || default.version == version) &&
|
||||
(default.kind == null || default.kind == kind)
|
||||
|
|
@ -185,7 +185,8 @@ in {
|
|||
|
||||
resource = mkOption {
|
||||
description = "Custom resource definition resource name";
|
||||
type = types.str;
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
description = mkOption {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ let
|
|||
./k8s/1.13/crd.nix
|
||||
./k8s/submodule.nix
|
||||
./k8s/defaults.nix
|
||||
./istio/bookinfo.nix
|
||||
./submodules/simple.nix
|
||||
./submodules/defaults.nix
|
||||
];
|
||||
|
|
|
|||
55
tests/istio/bookinfo.nix
Normal file
55
tests/istio/bookinfo.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ config, test, kubenix, k8s, ... }:
|
||||
|
||||
with k8s;
|
||||
|
||||
{
|
||||
imports = [
|
||||
kubenix.k8s
|
||||
kubenix.istio
|
||||
];
|
||||
|
||||
test = {
|
||||
name = "istio-bookinfo";
|
||||
description = "Simple istio bookinfo application (WIP)";
|
||||
};
|
||||
|
||||
kubernetes.api."networking.istio.io"."v1alpha3" = {
|
||||
Gateway."bookinfo-gateway" = {
|
||||
spec = {
|
||||
selector.istio = "ingressgateway";
|
||||
servers = [{
|
||||
port = {
|
||||
number = 80;
|
||||
name = "http";
|
||||
protocol = "HTTP";
|
||||
};
|
||||
hosts = ["*"];
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
VirtualService.bookinfo = {
|
||||
spec = {
|
||||
hosts = ["*"];
|
||||
gateways = ["bookinfo-gateway"];
|
||||
http = [{
|
||||
match = [{
|
||||
uri.exact = "/productpage";
|
||||
} {
|
||||
uri.exact = "/login";
|
||||
} {
|
||||
uri.exact = "/logout";
|
||||
} {
|
||||
uri.prefix = "/api/v1/products";
|
||||
}];
|
||||
route = [{
|
||||
destination = {
|
||||
host = "productpage";
|
||||
port.number = 9080;
|
||||
};
|
||||
}];
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue