Merge pull request #86634 from zowoq/crio-upstream-config
nixos/cri-o: copy upstream config
This commit is contained in:
commit
b1ae5f864a
@ -4,6 +4,11 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.virtualisation.cri-o;
|
cfg = config.virtualisation.cri-o;
|
||||||
|
|
||||||
|
# Copy configuration files to avoid having the entire sources in the system closure
|
||||||
|
copyFile = filePath: pkgs.runCommandNoCC (builtins.unsafeDiscardStringContext (builtins.baseNameOf filePath)) {} ''
|
||||||
|
cp ${filePath} $out
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -45,9 +50,9 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment.systemPackages = with pkgs;
|
environment.systemPackages = with pkgs;
|
||||||
[ cri-o cri-tools conmon iptables runc utillinux ];
|
[ cri-o cri-tools conmon iptables runc utillinux ];
|
||||||
environment.etc."crictl.yaml".text = ''
|
|
||||||
runtime-endpoint: unix:///var/run/crio/crio.sock
|
environment.etc."crictl.yaml".source = copyFile "${pkgs.cri-o.src}/crictl.yaml";
|
||||||
'';
|
|
||||||
environment.etc."crio/crio.conf".text = ''
|
environment.etc."crio/crio.conf".text = ''
|
||||||
[crio]
|
[crio]
|
||||||
storage_driver = "${cfg.storageDriver}"
|
storage_driver = "${cfg.storageDriver}"
|
||||||
@ -66,23 +71,7 @@ in
|
|||||||
manage_network_ns_lifecycle = true
|
manage_network_ns_lifecycle = true
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.etc."cni/net.d/20-cri-o-bridge.conf".text = ''
|
environment.etc."cni/net.d/10-crio-bridge.conf".source = copyFile "${pkgs.cri-o.src}/contrib/cni/10-crio-bridge.conf";
|
||||||
{
|
|
||||||
"cniVersion": "0.3.1",
|
|
||||||
"name": "crio-bridge",
|
|
||||||
"type": "bridge",
|
|
||||||
"bridge": "cni0",
|
|
||||||
"isGateway": true,
|
|
||||||
"ipMasq": true,
|
|
||||||
"ipam": {
|
|
||||||
"type": "host-local",
|
|
||||||
"subnet": "10.88.0.0/16",
|
|
||||||
"routes": [
|
|
||||||
{ "dst": "0.0.0.0/0" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Enable common /etc/containers configuration
|
# Enable common /etc/containers configuration
|
||||||
virtualisation.containers.enable = true;
|
virtualisation.containers.enable = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user