spacepaste

  1.  
  2. let
  3. hosts = [ "demete" "hades" "hera" "hestia" "poseidon" "zeus" ];
  4. etcdClusterMembers = (builtins.map (h: h + "=http://" + h + ":2380") hosts);
  5. etcd = import ./services/etcd.nix // { services.etcd.initialCluster = (builtins.foldl' (x: y: x + "," + y) (builtins.head etcdClusterMembers) (builtins.tail etcdClusterMembers)); };
  6. kubernetesNode =
  7. { config, pkgs, ... }:
  8. { networking.bridges.cbr0.interfaces = [];
  9. networking.interfaces.cbr0 =
  10. { ipAddress = "10.10.0.1";
  11. prefixLength = 24;
  12. };
  13. services.kubernetes.roles = [ "master" "node" ];
  14. virtualisation.docker.extraOptions = ''--iptables=false --ip-masq=false =b cbr0'';
  15. };
  16. in
  17. { network.description = "Kubernetes Cluster";
  18. demeter = etcd;
  19. hades = etcd;
  20. hera = etcd;
  21. hestia = etcd;
  22. poseidon = etcd;
  23. zeus = etcd;
  24. }
  25.