Skip to content

Commit

Permalink
caa: adjust peer-pod image to immutable /etc
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Dec 13, 2024
1 parent 8b6d35c commit 2aa1e0d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 74 deletions.
25 changes: 0 additions & 25 deletions packages/by-name/kernel-podvm-azure/0001-azure-fix-sublevel.patch

This file was deleted.

47 changes: 0 additions & 47 deletions packages/by-name/kernel-podvm-azure/package.nix

This file was deleted.

1 change: 0 additions & 1 deletion packages/by-name/mkNixosConfig/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ lib.makeOverridable (
inherit (outerPkgs)
azure-no-agent
cloud-api-adaptor
kernel-podvm-azure
pause-bundle
nvidia-ctk-oci-hook
nvidia-ctk-with-config
Expand Down
3 changes: 2 additions & 1 deletion packages/nixos/azure.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ in
};

config = lib.mkIf cfg.enable {
boot.kernelPackages = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor pkgs.kernel-podvm-azure);
# TODO(burgerdev): find a recent kernel tailored for Azure.
boot.kernelPackages = pkgs.linuxPackages_latest;

boot.initrd = {
kernelModules = [
Expand Down
14 changes: 14 additions & 0 deletions packages/nixos/peerpods.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ in
ExecStop = "${pkgs.iproute2}/bin/ip netns del %I";
};
};
# Contrary to bare-metal, a peer pod needs regular network access and DNS. The default setup
# with dhcpcd and resolvconf does not play well with the immutable /etc, so we use the full
# systemd stack instead.
networking.dhcpcd.enable = false;
systemd.network.enable = true;
networking.useNetworkd = true;
services.resolved.enable = true;

# The /etc/machine-id should be populated by systemd, but the immutable /etc seems to prevent
# that. However, systemd-networkd requires this file to exist, so we add an empty file which
# will then be bind-mounted over by systemd. Let's hope no important services are gated on
# first-boot.
# https://www.man7.org/linux//man-pages/man5/machine-id.5.html#FIRST_BOOT_SEMANTICS
environment.etc."machine-id".text = "uninitialized";

environment.etc."kata-opa/default-policy.rego".source = pkgs.cloud-api-adaptor.default-policy;
};
Expand Down

0 comments on commit 2aa1e0d

Please sign in to comment.