Move hardware configs.
This commit is contained in:
75
kube0.nix
Normal file
75
kube0.nix
Normal file
@@ -0,0 +1,75 @@
|
||||
with import <nixpkgs> {};
|
||||
let
|
||||
pki = pkgs.callPackage ./lib/pki.nix {};
|
||||
certs = {
|
||||
ca = pki.ca;
|
||||
apiserver = pki.apiserver ''
|
||||
"10.253.18.100",
|
||||
"10.0.0.1",
|
||||
"127.0.0.1",
|
||||
"kubernetes",
|
||||
"etcd0",
|
||||
"k0-0"
|
||||
'';
|
||||
kube-proxy = pki.kube-proxy;
|
||||
admin = pki.admin;
|
||||
etcd = pki.etcd ''
|
||||
"etcd0",
|
||||
"etcd1",
|
||||
"etcd2",
|
||||
"10.253.18.100",
|
||||
"10.253.18.101",
|
||||
"10.253.18.102",
|
||||
"127.0.0.1"
|
||||
'';
|
||||
k0-0 = pki.worker { name = "k0-0"; ip = "10.253.18.100"; };
|
||||
k0-1 = pki.worker { name = "k0-1"; ip = "10.253.18.101"; };
|
||||
k0-2 = pki.worker { name = "k0-2"; ip = "10.253.18.102"; };
|
||||
k0-3 = pki.worker { name = "k0-3"; ip = "10.253.18.103"; };
|
||||
k0-4 = pki.worker { name = "k0-4"; ip = "10.253.18.107"; };
|
||||
k0-5 = pki.worker { name = "k0-5"; ip = "10.253.18.108"; };
|
||||
};
|
||||
cluster = callPackage ./lib/k8s.nix {
|
||||
masterNode = "10.253.18.100";
|
||||
etcdNodes = [
|
||||
"10.253.18.100"
|
||||
"10.253.18.101"
|
||||
"10.253.18.102"
|
||||
];
|
||||
clusterHosts = ''
|
||||
10.253.18.100 k0-0 etcd0 kubernetes
|
||||
10.253.18.101 k0-1 etcd1
|
||||
10.253.18.102 k0-2 etcd2
|
||||
10.253.18.103 k0-3
|
||||
10.253.18.107 k0-4
|
||||
10.253.18.108 k0-5
|
||||
10.253.18.106 fs0-0
|
||||
10.1.2.164 fs0-1
|
||||
'';
|
||||
inherit certs;
|
||||
};
|
||||
in
|
||||
{
|
||||
# k0-0 = { ... }: {
|
||||
# require = [ (cluster.apiserver "10.253.18.100" "k0-0" "etcd0") ];
|
||||
# services.glusterfs = {
|
||||
# enable = true;
|
||||
# tlsSettings = {
|
||||
# caCert = certs.ca.cert;
|
||||
# tlsKeyPath = certs.fs0.key;
|
||||
# tlsPem = certs.fs0.cert;
|
||||
# };
|
||||
# };
|
||||
# networking.firewall.extraCommands = ''
|
||||
# iptables -I INPUT -p all -s 10.253.18.100 -j ACCEPT
|
||||
# iptables -I INPUT -p all -s 10.253.18.106 -j ACCEPT
|
||||
# iptables -I INPUT -p all -s 10.1.2.164 -j ACCEPT
|
||||
# '';
|
||||
# };
|
||||
k0-0 = cluster.apiserver "10.253.18.100" "k0-0" "etcd0";
|
||||
k0-1 = cluster.server "10.253.18.101" "k0-1" "etcd1";
|
||||
k0-2 = cluster.server "10.253.18.102" "k0-2" "etcd2";
|
||||
k0-3 = cluster.worker "10.253.18.103" "k0-3";
|
||||
k0-4 = cluster.worker "10.253.18.107" "k0-4";
|
||||
k0-5 = cluster.worker "10.253.18.108" "k0-5";
|
||||
}
|
||||
Reference in New Issue
Block a user