2024-04-07 13:24:08 +02:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
paths,
|
2024-04-13 19:38:44 +02:00
|
|
|
elib,
|
|
|
|
lib,
|
2024-04-07 13:24:08 +02:00
|
|
|
...
|
2024-04-13 19:38:44 +02:00
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
|
|
|
mkMerge
|
|
|
|
filterAttrs
|
|
|
|
mapAttrs
|
|
|
|
recursiveUpdate
|
|
|
|
;
|
|
|
|
in {
|
2024-04-07 14:02:29 +02:00
|
|
|
resource."kubernetes_namespace"."metallb-system" = {
|
2024-04-07 13:24:08 +02:00
|
|
|
metadata = {
|
|
|
|
name = "metallb-system";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-07 14:02:29 +02:00
|
|
|
resource."kubernetes_namespace"."istio-system" = {
|
|
|
|
metadata = {
|
|
|
|
name = "istio-system";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-13 19:38:44 +02:00
|
|
|
imports = [
|
|
|
|
(elib.terraformModule {
|
|
|
|
name = "kubernetes";
|
|
|
|
source = {config, ...}: {
|
|
|
|
imports = [
|
|
|
|
(inputs.uk3s-nix.legacyPackages.${pkgs.stdenv.system}.helm2nix2terraform {
|
|
|
|
path = "${paths.root}/terranix/prepare/kubernetes";
|
|
|
|
predicate = chart: name: manifest:
|
|
|
|
manifest.kind == "CustomResourceDefinition";
|
|
|
|
mapper = resource:
|
|
|
|
if resource.manifest.kind == "CustomResourceDefinition"
|
|
|
|
then
|
|
|
|
(resource
|
|
|
|
// {
|
|
|
|
manifest =
|
|
|
|
resource.manifest
|
|
|
|
// {
|
|
|
|
metadata = filterAttrs (n: _: n != "creationTimestamp") resource.manifest.metadata;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
else resource;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
resource."kubernetes_manifest" = {
|
|
|
|
"default_CustomResourceDefinition_bgppeers_metallb_io" = {
|
|
|
|
computed_fields = [
|
|
|
|
"spec.conversion.webhook.clientConfig.caBundle"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2024-04-07 13:24:08 +02:00
|
|
|
};
|
2024-04-13 19:38:44 +02:00
|
|
|
})
|
|
|
|
];
|
2024-04-07 13:24:08 +02:00
|
|
|
}
|