Installing the cni plugins.
This commit is contained in:
parent
c61da527f2
commit
1da6250301
@ -20,22 +20,23 @@
|
||||
config = lib.mkIf config.me.containerd.enable {
|
||||
virtualisation.containerd.enable = true;
|
||||
virtualisation.containerd.settings =
|
||||
# let
|
||||
# my-cni-plugins = pkgs.buildEnv {
|
||||
# name = "my-cni-plugins";
|
||||
# paths = with pkgs; [
|
||||
# cni-plugins
|
||||
# cni-plugin-flannel
|
||||
# ];
|
||||
# };
|
||||
# in
|
||||
let
|
||||
my-cni-plugins = pkgs.buildEnv {
|
||||
name = "my-cni-plugins";
|
||||
paths = with pkgs; [
|
||||
cni-plugins
|
||||
cni-plugin-flannel
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
"plugins" = {
|
||||
"io.containerd.grpc.v1.cri" = {
|
||||
"cni" = {
|
||||
"bin_dir" = "/opt/cni/bin";
|
||||
# "bin_dir" = "${my-cni-plugins}/bin";
|
||||
"conf_dir" = "/etc/cni/net.d";
|
||||
# "bin_dir" = "/opt/cni/bin";
|
||||
"bin_dir" = "${my-cni-plugins}/bin";
|
||||
# "conf_dir" = "/etc/cni/net.d";
|
||||
"conf_dir" = "${pkgs.callPackage ./package/cni_conf/package.nix { }}";
|
||||
};
|
||||
"containerd" = {
|
||||
"default_runtime_name" = "runc";
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
{
|
||||
"cniVersion": "1.0.0",
|
||||
"name": "bridge",
|
||||
"type": "bridge",
|
||||
"bridge": "cni0",
|
||||
"isGateway": true,
|
||||
"ipMasq": true,
|
||||
"ipam": {
|
||||
"type": "host-local",
|
||||
"ranges": [
|
||||
[{"subnet": "SUBNET"}]
|
||||
],
|
||||
"routes": [{"dst": "0.0.0.0/0"}]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"cniVersion": "1.1.0",
|
||||
"name": "lo",
|
||||
"type": "loopback"
|
||||
}
|
||||
27
nix/kubernetes/roles/containerd/package/cni_conf/package.nix
Normal file
27
nix/kubernetes/roles/containerd/package/cni_conf/package.nix
Normal file
@ -0,0 +1,27 @@
|
||||
# unpackPhase
|
||||
# patchPhase
|
||||
# configurePhase
|
||||
# buildPhase
|
||||
# checkPhase
|
||||
# installPhase
|
||||
# fixupPhase
|
||||
# installCheckPhase
|
||||
# distPhase
|
||||
{
|
||||
stdenv,
|
||||
openssl,
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
name = "cni-conf";
|
||||
nativeBuildInputs = [ openssl ];
|
||||
buildInputs = [ ];
|
||||
|
||||
unpackPhase = "true";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out"
|
||||
cd "$out"
|
||||
install ${./files/10-bridge.conf} ${./files/99-loopback.conf} $out/
|
||||
'';
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user