attempt at nfs docker
This commit is contained in:
7
kubernetes/k3s-install.md
Normal file
7
kubernetes/k3s-install.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# sources
|
||||||
|
|
||||||
|
|
||||||
|
nix instructions <https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/cluster/k3s/README.md>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1
kubernetes/nfs-server/.gitignore
vendored
Normal file
1
kubernetes/nfs-server/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
test/
|
||||||
13
kubernetes/nfs-server/Dockerfile
Normal file
13
kubernetes/nfs-server/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache nfs-utils bash
|
||||||
|
|
||||||
|
RUN mkdir -p /exports
|
||||||
|
|
||||||
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||||
|
|
||||||
|
EXPOSE 2049 20048
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
|
|
||||||
24
kubernetes/nfs-server/entrypoint.sh
Normal file
24
kubernetes/nfs-server/entrypoint.sh
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
ALLOWED_CLIENTS="${ALLOWED_CLIENTS:-*}"
|
||||||
|
|
||||||
|
echo "/exports $ALLOWED_CLIENTS(rw,sync,no_subtree_check,no_root_squash)" > /etc/exports
|
||||||
|
|
||||||
|
rpcbind || true
|
||||||
|
rpc.statd || true
|
||||||
|
|
||||||
|
echo "Starting NFS server..."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mount -t nfsd nfsd /proc/fs/nfsd
|
||||||
|
|
||||||
|
rpc.nfsd -N 3 -V 4 --grace-time 10 $nfsd_debug_opt &
|
||||||
|
rpc.mountd -N 2 -N 3 -V 4 --foreground $mountd_debug_opt &
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
# rpc.mountd -N 2 -N 3 -V 4 --foreground
|
||||||
|
|
||||||
|
# wait
|
||||||
19
kubernetes/nfs-server/readme.md
Normal file
19
kubernetes/nfs-server/readme.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<https://wiki.alpinelinux.org/wiki/Setting_up_an_NFS_server>
|
||||||
|
|
||||||
|
|
||||||
|
example docker run
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it \
|
||||||
|
--name nfs-server \
|
||||||
|
--cap-add SYS_ADMIN \
|
||||||
|
-e ALLOWED_CLIENTS="127.0.0.1.0/24" \
|
||||||
|
-v (pwd)/test:/exports \
|
||||||
|
--network host \
|
||||||
|
nfs-server
|
||||||
|
```
|
||||||
|
|
||||||
|
currently not working, i like the idea of running the nfs server in a docker container, but doing it as a nixos module is probably better
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# sources
|
|
||||||
|
|
||||||
https://ranchermanager.docs.rancher.com/pages-for-subheaders/install-upgrade-on-a-kubernetes-cluster
|
|
||||||
|
|
||||||
install r3k for manager cluster: https://docs.k3s.io/quick-start
|
|
||||||
|
|
||||||
@@ -89,6 +89,7 @@
|
|||||||
tmux
|
tmux
|
||||||
libguestfs-with-appliance
|
libguestfs-with-appliance
|
||||||
iperf
|
iperf
|
||||||
|
nfs-utils
|
||||||
];
|
];
|
||||||
services.tailscale.enable = true;
|
services.tailscale.enable = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
@@ -164,7 +165,7 @@
|
|||||||
device = "/dev/disk/by-uuid/437358fd-b9e4-46e2-bd45-f6b368acaac1";
|
device = "/dev/disk/by-uuid/437358fd-b9e4-46e2-bd45-f6b368acaac1";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
boot.supportedFilesystems = [ "zfs" "nfs" ];
|
||||||
boot.zfs.forceImportRoot = false;
|
boot.zfs.forceImportRoot = false;
|
||||||
networking.hostId = "eafe9999";
|
networking.hostId = "eafe9999";
|
||||||
boot.zfs.extraPools = [ "data" "data2" ];
|
boot.zfs.extraPools = [ "data" "data2" ];
|
||||||
|
|||||||
Reference in New Issue
Block a user