2024-10-28 15:05:06 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
globals,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
2024-09-07 10:35:02 +00:00
|
|
|
options.kms.enable = lib.mkEnableOption "kms";
|
|
|
|
|
|
|
|
config = lib.mkIf config.kms.enable {
|
|
|
|
kubernetes.resources = {
|
|
|
|
deployments.server.spec = {
|
|
|
|
selector.matchLabels.app = "kms";
|
|
|
|
|
|
|
|
template = {
|
|
|
|
metadata.labels.app = "kms";
|
|
|
|
|
|
|
|
spec.containers.kms = {
|
|
|
|
image = globals.images.kms;
|
|
|
|
ports.kms.containerPort = 1688;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.server.spec = {
|
|
|
|
type = "LoadBalancer";
|
|
|
|
loadBalancerIP = globals.kmsIPv4;
|
|
|
|
selector.app = "kms";
|
|
|
|
|
|
|
|
ports.kms = {
|
|
|
|
port = 1688;
|
|
|
|
targetPort = "kms";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|