Skip to content

Commit

Permalink
Merge pull request #12 from elegaanz/traduction
Browse files Browse the repository at this point in the history
traduction mono + multi + k3S + colmet.nix + opensearch-dashboard.nix
  • Loading branch information
elisepoupette2 committed Mar 13, 2024
2 parents bf59cd5 + b1407f4 commit 57bfa41
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
8 changes: 4 additions & 4 deletions colmet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ with lib;
{
config.environment.systemPackages = with pkgs; [ nur.repos.kapack.colmet ];

#option to enable the colmet collector
# option to enable the colmet collector
options.services.colmet-collector = {
enable = mkEnableOption (mdDoc "Enable the Colmet collector service");
};

#option to enable colmet nodes
# option to enable colmet nodes
options.services.colmet-node = {
enable = mkEnableOption (mdDoc "Enable the Colmet node service");
};

#if colmet-collector is enable
# if colmet-collector is enable
config.systemd.services.colmet-collector = mkIf cfg-collector.enable {
description = "Colmet collector";
wantedBy = [ "multi-user.target" ];
Expand All @@ -36,7 +36,7 @@ with lib;
};
};

#if colmet-node is enable
# if colmet-node is enable
config.systemd.services.colmet-node = mkIf cfg-node.enable {
description = "Colmet node";
wantedBy = [ "multi-user.target" ];
Expand Down
24 changes: 12 additions & 12 deletions opensearch-mono/composition.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,19 @@ in
settings."plugins.security.authcz.admin_dn" = [ "CN=localhost" ];
settings."plugins.security.ssl.transport.keystore_alias" = "opensearch";
settings."plugins.security.ssl.transport.keystore_filepath" = "/var/lib/opensearch/config/ssl-keystore.p12";
# Configuration des options Java supplémentaires (uniquement pour le service "opensearch")
# Les machines virtuelles créées avec `nxc build -f vm` n'ont qu'un Mo de mémoire vive
# Par défaut, la JVM demande plus de mémoire que ça et ne peut pas démarrer
# Avec ces options, on limite son utilisation de la RAM

# Additional Java options configuration (only for the "opensearch" service)
# Virtual machines created with `nxc build -f vm` only have 1MB of RAM
# By default, the JVM asks for more memory than that and cannot start
# With these options, we limit its RAM usage
extraJavaOptions = [
"-Xmx512m" # Limite maximale de la mémoire utilisée par la machine virtuelle Java à 512 Mo
"-Xms512m" # Mémoire initiale allouée par la machine virtuelle Java à 512 Mo
"-Xmx512m" # Limit Java VM memory usage to 512 MB
"-Xms512m" # Java VM initial memory allocation set to 512 MB
];
};


# Vector est système de gestion de logs
# Vector is a log management system
services.vector = {
enable = enable-vector;
journaldAccess = true;
Expand Down Expand Up @@ -158,11 +159,10 @@ in
services.colmet-node.enable = enable-colmet;

environment.variables = lib.mkIf enable-vector {
# La variable "VECTOR_CONFIG" défini le chemin de la configuration à utiliser quand on
# lance la commande `vector`. Le service Systemd génère une config à partir de `services.vector.settings`
# et s'assure que le service utilise bien ce fichier. Mais il faut aussi indiquer où ce trouve
# ce fichier de configuration à l'outil en ligne de commande disponible dans le PATH.
# On parse la configuration systemd pour récupérer le chemin du fichier.
# The variable "VECTOR_CONFIG" defines the path to the configuration to use when running the `vector` command.
# The Systemd service generates a config from `services.vector.settings` and ensures that the service uses this file.
# However, it is also necessary to specify the location of this configuration file to the command line tool available in the PATH.
# We parse the systemd configuration to retrieve the path to the file.
VECTOR_CONFIG = lib.lists.last (
builtins.split " " config.systemd.services.vector.serviceConfig.ExecStart
);
Expand Down
17 changes: 8 additions & 9 deletions opensearch-multi/composition.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ let
package = opensearch-fixed;

extraJavaOptions = [
"-Xmx512m" # Limite maximale de la mémoire utilisée par la machine virtuelle Java à 512 Mo
"-Xms512m" # Mémoire initiale allouée par la machine virtuelle Java à 512 Mo
"-Xmx512m" # Limit Java VM memory usage to 512 MB
"-Xms512m" # Java VM initial memory allocation set to 512 MB
];

settings = {
Expand All @@ -39,8 +39,8 @@ let
settings."node.roles" = [ role ];
};
};
# On ne connait pas les IP des nœuds à l'avance donc on
# génère ça dynamiquement
# We don't know the node IPs in advance
# so we generate them dynamically.
populate-hosts-script = [
"${
pkgs.writeShellScriptBin "configure-opensearch" ''
Expand Down Expand Up @@ -127,11 +127,10 @@ in {
};

environment.variables = {
# La variable "VECTOR_CONFIG" défini le chemin de la configuration à utiliser quand on
# lance la commande `vector`. Le service Systemd génère une config à partir de `services.vector.settings`
# et s'assure que le service utilise bien ce fichier. Mais il faut aussi indiquer où ce trouve
# ce fichier de configuration à l'outil en ligne de commande disponible dans le PATH.
# On parse la configuration systemd pour récupérer le chemin du fichier.
# The variable "VECTOR_CONFIG" defines the path to the configuration to use when running the `vector` command.
# The Systemd service generates a config from `services.vector.settings` and ensures that the service uses this file.
# However, it is also necessary to specify the location of this configuration file to the command line tool available in the PATH.
# We parse the systemd configuration to retrieve the path to the file.
VECTOR_CONFIG = lib.lists.last (builtins.split " "
config.systemd.services.vector.serviceConfig.ExecStart);
};
Expand Down

0 comments on commit 57bfa41

Please sign in to comment.