wip: add openfga app with direct helm render

This commit is contained in:
2024-10-10 20:50:50 +02:00
parent 11b398801d
commit a5cf93c758
4 changed files with 75 additions and 4 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
_manifest.yaml
_resources.yaml
*.tgz *.tgz
_build/ _*/
.direnv/ .direnv/
.pre-commit-config.yaml .pre-commit-config.yaml
_manifest.yaml
_resources.yaml
+1
View File
@@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./atlantis.nix ./atlantis.nix
./openfga.nix
]; ];
config = { config = {
+70
View File
@@ -0,0 +1,70 @@
{ lib, config, charts, ... }:
let
cfg = config.services.openfga;
namespace = "openfga";
env = "prod";
project = "aux";
cluster = "https://kubernetes.default.svc";
values = lib.attrsets.recursiveUpdate {} cfg.values;
in
{
options.services.openfga = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable";
};
autoSync = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Auto sync";
};
prune = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Prune";
};
values = lib.mkOption {
type = lib.types.attrsOf lib.types.anything;
default = {};
};
};
config = lib.mkIf cfg.enable {
applications.openfga = {
inherit namespace;
inherit project;
name = "${env}-openfga";
destination.server = cluster;
helm.releases.openfga = {
inherit values;
chart = lib.helm.downloadHelmChart {
repo = "https://openfga.github.io/helm-charts";
chart = "openfga";
version = "0.2.12";
chartHash = "sha256-7yLcw9/oNPvCePrtTJwKAG88t0Ym5Dl/S83Gz+gQdDU=";
};
};
annotations = {
"argocd.argoproj.io/compare-options" = "ServerSideDiff=true";
};
syncPolicy = {
syncOptions = {
applyOutOfSyncOnly = true;
};
autoSync = lib.mkIf cfg.autoSync {
prune = cfg.prune;
selfHeal = false;
};
};
resources = {};
};
};
}
+1 -1
View File
@@ -7,7 +7,7 @@
target = { target = {
repository = "https://gitlab.com/oveanbox/manifests.git"; repository = "https://gitlab.com/oveanbox/manifests.git";
branch = "main"; branch = "main";
rootPath = "_build"; rootPath = "_manifests";
}; };
resourceImports = [ resourceImports = [