Add configs for a new kubernetes cluster on NixOS.
This commit is contained in:
50
nix/kubernetes/roles/ssh/default.nix
Normal file
50
nix/kubernetes/roles/ssh/default.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
ssh.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install ssh.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.me.ssh.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
sshfs
|
||||
];
|
||||
|
||||
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
|
||||
hideMounts = true;
|
||||
users.talexander = {
|
||||
files = [
|
||||
".ssh/known_hosts"
|
||||
];
|
||||
};
|
||||
users.root = {
|
||||
files = [
|
||||
".ssh/known_hosts"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
me.install.user.root.file = {
|
||||
".ssh/config" = {
|
||||
source = ./files/ssh_config_root;
|
||||
};
|
||||
};
|
||||
me.install.user.talexander.file = {
|
||||
".ssh/config" = {
|
||||
source = ./files/ssh_config;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
42
nix/kubernetes/roles/ssh/files/ssh_config
Normal file
42
nix/kubernetes/roles/ssh/files/ssh_config
Normal file
@@ -0,0 +1,42 @@
|
||||
Host poudriere
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.203
|
||||
|
||||
Host controller0
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.204
|
||||
|
||||
Host controller1
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.205
|
||||
|
||||
Host controller2
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.206
|
||||
|
||||
Host worker0
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.207
|
||||
|
||||
Host worker1
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.208
|
||||
|
||||
Host worker2
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.209
|
||||
|
||||
Host brianai
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.215
|
||||
|
||||
Host hydra
|
||||
ProxyJump talexander@mrmanager
|
||||
HostName 10.215.1.219
|
||||
|
||||
Host i_only_boot_zfs
|
||||
HostName 127.0.0.1
|
||||
Port 60022
|
||||
|
||||
Host *
|
||||
Compression yes
|
||||
9
nix/kubernetes/roles/ssh/files/ssh_config_root
Normal file
9
nix/kubernetes/roles/ssh/files/ssh_config_root
Normal file
@@ -0,0 +1,9 @@
|
||||
Host hydra
|
||||
HostName ns1.fizz.buzz
|
||||
Port 65122
|
||||
User nixworker
|
||||
IdentitiesOnly yes
|
||||
IdentityFile /persist/manual/ssh/root/keys/id_ed25519
|
||||
|
||||
Host *
|
||||
Compression yes
|
||||
Reference in New Issue
Block a user