Copy dnsmasq NixNG image creation to here
Create GC roots for k8s manifests
This commit is contained in:
parent
cf8d278219
commit
1ee319f179
7 changed files with 222 additions and 22 deletions
27
kubenix.nix
27
kubenix.nix
|
@ -2,6 +2,7 @@ inputs@{ self, servers, flutils, nixpkgs, kubenix, ... }: flutils.lib.eachDefaul
|
|||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
lib = pkgs.lib;
|
||||
deployScript = (pkgs.writeScriptBin "applyset-deploy.sh" (builtins.readFile ./applyset-deploy.sh)).overrideAttrs (old: {
|
||||
buildCommand = "${old.buildCommand}\npatchShebangs $out";
|
||||
});
|
||||
|
@ -11,7 +12,7 @@ inputs@{ self, servers, flutils, nixpkgs, kubenix, ... }: flutils.lib.eachDefaul
|
|||
mkKubernetes = name: module: namespace: (kubenix.evalModules.${system} {
|
||||
specialArgs = {
|
||||
inherit namespace system machines;
|
||||
inherit (inputs) nixhelm blog-pim dns;
|
||||
inherit (inputs) nixhelm blog-pim dns nixpkgs nixng;
|
||||
inherit (self) globals;
|
||||
};
|
||||
|
||||
|
@ -50,14 +51,22 @@ inputs@{ self, servers, flutils, nixpkgs, kubenix, ... }: flutils.lib.eachDefaul
|
|||
passthru.manifest = result;
|
||||
meta.mainProgram = "applyset-deploy.sh";
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/applyset-deploy.sh \
|
||||
--suffix PATH : "$out/bin" \
|
||||
--run 'export KUBECONFIG=''${KUBECONFIG:-${toString kubeconfig}}' \
|
||||
--set MANIFEST '${result}' \
|
||||
--set APPLYSET 'applyset-${name}' \
|
||||
--set NAMESPACE '${namespace}'
|
||||
'';
|
||||
postBuild =
|
||||
let
|
||||
# HACK: create normal way of checking if server runs k8s
|
||||
k8sMachines = lib.filterAttrs (n: m: m.kubernetesNodeLabels != null) machines;
|
||||
k8sServerNames = builtins.concatStringsSep " " (builtins.attrNames k8sMachines);
|
||||
in
|
||||
''
|
||||
wrapProgram $out/bin/applyset-deploy.sh \
|
||||
--suffix PATH : "$out/bin" \
|
||||
--run 'export KUBECONFIG=''${KUBECONFIG:-${toString kubeconfig}}' \
|
||||
--set MANIFEST '${result}' \
|
||||
--set NAME '${name}' \
|
||||
--set NAMESPACE '${namespace}' \
|
||||
--set SERVERS '${k8sServerNames}' \
|
||||
--set GCROOTDIR '/nix/var/nix/gcroots/kubernetes-manifests'
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue