nixos: move kubernetes & fleet to services/cluster
This commit is contained in:
parent
1465d9321d
commit
4be1089781
@ -102,6 +102,8 @@
|
||||
./services/backup/rsnapshot.nix
|
||||
./services/backup/sitecopy-backup.nix
|
||||
./services/backup/tarsnap.nix
|
||||
./services/cluster/fleet.nix
|
||||
./services/cluster/kubernetes.nix
|
||||
./services/computing/torque/server.nix
|
||||
./services/computing/torque/mom.nix
|
||||
./services/continuous-integration/jenkins/default.nix
|
||||
@ -400,8 +402,6 @@
|
||||
./virtualisation/container-config.nix
|
||||
./virtualisation/containers.nix
|
||||
./virtualisation/docker.nix
|
||||
./virtualisation/fleet.nix
|
||||
./virtualisation/kubernetes.nix
|
||||
./virtualisation/libvirtd.nix
|
||||
./virtualisation/lxc.nix
|
||||
#./virtualisation/nova.nix
|
||||
|
@ -3,12 +3,12 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.virtualisation.fleet;
|
||||
cfg = config.services.fleet;
|
||||
|
||||
in {
|
||||
|
||||
##### Interface
|
||||
options.virtualisation.fleet = {
|
||||
options.services.fleet = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
@ -3,13 +3,13 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.virtualisation.kubernetes;
|
||||
cfg = config.services.kubernetes;
|
||||
|
||||
in {
|
||||
|
||||
###### interface
|
||||
|
||||
options.virtualisation.kubernetes = {
|
||||
options.services.kubernetes = {
|
||||
package = mkOption {
|
||||
description = "Kubernetes package to use.";
|
||||
type = types.package;
|
||||
@ -420,15 +420,15 @@ in {
|
||||
})
|
||||
|
||||
(mkIf (any (el: el == "master") cfg.roles) {
|
||||
virtualisation.kubernetes.apiserver.enable = mkDefault true;
|
||||
virtualisation.kubernetes.scheduler.enable = mkDefault true;
|
||||
virtualisation.kubernetes.controllerManager.enable = mkDefault true;
|
||||
services.kubernetes.apiserver.enable = mkDefault true;
|
||||
services.kubernetes.scheduler.enable = mkDefault true;
|
||||
services.kubernetes.controllerManager.enable = mkDefault true;
|
||||
})
|
||||
|
||||
(mkIf (any (el: el == "node") cfg.roles) {
|
||||
virtualisation.docker.enable = mkDefault true;
|
||||
virtualisation.kubernetes.kubelet.enable = mkDefault true;
|
||||
virtualisation.kubernetes.proxy.enable = mkDefault true;
|
||||
services.kubernetes.kubelet.enable = mkDefault true;
|
||||
services.kubernetes.proxy.enable = mkDefault true;
|
||||
})
|
||||
|
||||
(mkIf (any (el: el == "node" || el == "master") cfg.roles) {
|
||||
@ -442,7 +442,7 @@ in {
|
||||
cfg.kubelet.enable ||
|
||||
cfg.proxy.enable
|
||||
) {
|
||||
virtualisation.kubernetes.package = mkDefault pkgs.kubernetes;
|
||||
services.kubernetes.package = mkDefault pkgs.kubernetes;
|
||||
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
@ -14,7 +14,7 @@ import ./make-test.nix rec {
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.fleet = {
|
||||
services.fleet = {
|
||||
enable = true;
|
||||
metadata.name = "node1";
|
||||
};
|
||||
@ -34,7 +34,7 @@ import ./make-test.nix rec {
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.fleet = {
|
||||
services.fleet = {
|
||||
enable = true;
|
||||
metadata.name = "node2";
|
||||
};
|
||||
|
@ -48,7 +48,7 @@ import ./make-test.nix rec {
|
||||
{ config, pkgs, lib, nodes, ... }:
|
||||
{
|
||||
virtualisation.memorySize = 512;
|
||||
virtualisation.kubernetes = {
|
||||
services.kubernetes = {
|
||||
roles = ["master" "node"];
|
||||
controllerManager.machines = ["master" "node"];
|
||||
kubelet.extraOpts = "-network_container_image=master:5000/pause";
|
||||
@ -92,7 +92,7 @@ import ./make-test.nix rec {
|
||||
node =
|
||||
{ config, pkgs, lib, nodes, ... }:
|
||||
{
|
||||
virtualisation.kubernetes = {
|
||||
services.kubernetes = {
|
||||
roles = ["node"];
|
||||
kubelet.extraOpts = "-network_container_image=master:5000/pause";
|
||||
verbose = true;
|
||||
|
25
nixos/tests/mesos.nix
Normal file
25
nixos/tests/mesos.nix
Normal file
@ -0,0 +1,25 @@
|
||||
import ./make-test.nix {
|
||||
name = "simple";
|
||||
|
||||
machine = { config, pkgs, ... }: {
|
||||
services.zookeeper.enable = true;
|
||||
virtualistaion.docker.enable = true;
|
||||
services.mesos = {
|
||||
slave = {
|
||||
enable = true;
|
||||
master = "zk://localhost:2181/mesos";
|
||||
};
|
||||
master = {
|
||||
enable = true;
|
||||
zk = "zk://localhost:2181/mesos";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
''
|
||||
startAll;
|
||||
$machine->waitForUnit("mesos-master.service");
|
||||
$machine->waitForUnit("mesos-slave.service");
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user