add vaultwarden to k3s
This commit is contained in:
parent
ee0e2c0737
commit
3961ca707a
3 changed files with 85 additions and 9 deletions
|
|
@ -53,10 +53,16 @@ let
|
||||||
in {
|
in {
|
||||||
networking.firewall.allowedTCPPorts = tcpPorts;
|
networking.firewall.allowedTCPPorts = tcpPorts;
|
||||||
networking.firewall.allowedUDPPorts = udpPorts;
|
networking.firewall.allowedUDPPorts = udpPorts;
|
||||||
fileSystems."/export/containers" = {
|
fileSystems ={
|
||||||
|
"/export/containers" = {
|
||||||
device = "/Velaris/Containers";
|
device = "/Velaris/Containers";
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
|
"/export/velaris" = {
|
||||||
|
device = "/Velaris";
|
||||||
|
options = ["bind"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.iscsi-target = {
|
systemd.services.iscsi-target = {
|
||||||
restartTriggers = [
|
restartTriggers = [
|
||||||
|
|
@ -75,6 +81,7 @@ in {
|
||||||
exports = ''
|
exports = ''
|
||||||
/export 10.5.0.0/24(rw,fsid=0,no_subtree_check,no_root_squash)
|
/export 10.5.0.0/24(rw,fsid=0,no_subtree_check,no_root_squash)
|
||||||
/export/containers 10.5.0.0/24(rw,nohide,insecure,no_subtree_check,no_root_squash)
|
/export/containers 10.5.0.0/24(rw,nohide,insecure,no_subtree_check,no_root_squash)
|
||||||
|
/export/velaris 10.5.0.0/24(rw,nohide,insecure,no_subtree_check,no_root_squash)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
target = {
|
target = {
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,6 @@ in
|
||||||
periodSeconds = 30;
|
periodSeconds = 30;
|
||||||
timeoutSeconds = 5;
|
timeoutSeconds = 5;
|
||||||
};
|
};
|
||||||
ports = [
|
|
||||||
{
|
|
||||||
name = "test-port";
|
|
||||||
containerPort = 80;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
volumeMounts = [
|
volumeMounts = [
|
||||||
{
|
{
|
||||||
mountPath = "/var/lib/postgresql/data";
|
mountPath = "/var/lib/postgresql/data";
|
||||||
|
|
|
||||||
75
modules/k3s/deployments/vaultwarden.nix
Normal file
75
modules/k3s/deployments/vaultwarden.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
vaultwarden.content = [
|
||||||
|
{
|
||||||
|
apiVersion = "apps/v1";
|
||||||
|
kind = "Deployment";
|
||||||
|
metadata = {
|
||||||
|
name = "vaultwarden";
|
||||||
|
labels.app = "vaultwarden";
|
||||||
|
};
|
||||||
|
spec = {
|
||||||
|
selector.matchLabels.app = "vaultwarden";
|
||||||
|
template = {
|
||||||
|
metadata = {
|
||||||
|
labels.app = "vaultwarden";
|
||||||
|
};
|
||||||
|
spec = {
|
||||||
|
securityContext = {
|
||||||
|
runAsUser = 1000;
|
||||||
|
runAsGroup = 1000;
|
||||||
|
};
|
||||||
|
containers = [
|
||||||
|
{
|
||||||
|
name = "vaultwarden";
|
||||||
|
image = "vaultwarden/server:latest";
|
||||||
|
ports = [
|
||||||
|
{
|
||||||
|
name = "vaultwarden-http";
|
||||||
|
containerPort = 80;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
volumeMounts = [
|
||||||
|
{
|
||||||
|
mountPath = "/data";
|
||||||
|
name = "iscsi";
|
||||||
|
subPath = "vaultwarden";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
{
|
||||||
|
name = "iscsi";
|
||||||
|
iscsi = {
|
||||||
|
targetPortal = "10.5.0.2:3260";
|
||||||
|
iqn = "iqn.2026-01.dev.nyxerinys:poseidon.vaultwarden";
|
||||||
|
lun = 0;
|
||||||
|
fsType = "xfs";
|
||||||
|
readOnly = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
apiVersion = "v1";
|
||||||
|
kind = "Service";
|
||||||
|
metadata.name = "vaultwarden";
|
||||||
|
spec = {
|
||||||
|
type = "NodePort";
|
||||||
|
selector.app = "vaultwarden";
|
||||||
|
ports = [
|
||||||
|
{
|
||||||
|
name = "vaultwarden-http";
|
||||||
|
portocol = "TCP";
|
||||||
|
port = 80;
|
||||||
|
nodePort = 30000;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue