services.k3s.manifests

Auto-deploying manifests that are linked to /var/lib/rancher/k3s/server/manifests before k3s starts. Note that deleting manifest files will not remove or otherwise modify the resources it created. Please use the the --disable flag or .skip files to delete/disable AddOns, as mentioned in the docs. This option only makes sense on server nodes (role = server). Read the auto-deploying manifests docs for further information.

WARNING: If you have multiple server nodes, and set this option on more than one server, it is your responsibility to ensure that files stay in sync across those nodes. AddOn content is not synced between nodes, and k3s cannot guarantee correct behavior if different servers attempt to deploy conflicting manifests.

Type
attribute set of (submodule)
Default
{ }
Example
{
  deployment.source = ../manifests/deployment.yaml;
  my-service = {
    enable = false;
    target = "app-service.yaml";
    content = {
      apiVersion = "v1";
      kind = "Service";
      metadata = {
        name = "app-service";
      };
      spec = {
        selector = {
          "app.kubernetes.io/name" = "MyApp";
        };
        ports = [
          {
            name = "name-of-service-port";
            protocol = "TCP";
            port = 80;
            targetPort = "http-web-svc";
          }
        ];
      };
    };
  };

  nginx.content = [
    {
      apiVersion = "v1";
      kind = "Pod";
      metadata = {
        name = "nginx";
        labels = {
          "app.kubernetes.io/name" = "MyApp";
        };
      };
      spec = {
        containers = [
          {
            name = "nginx";
            image = "nginx:1.14.2";
            ports = [
              {
                containerPort = 80;
                name = "http-web-svc";
              }
            ];
          }
        ];
      };
    }
    {
      apiVersion = "v1";
      kind = "Service";
      metadata = {
        name = "nginx-service";
      };
      spec = {
        selector = {
          "app.kubernetes.io/name" = "MyApp";
        };
        ports = [
          {
            name = "name-of-service-port";
            protocol = "TCP";
            port = 80;
            targetPort = "http-web-svc";
          }
        ];
      };
    }
  ];
};
Declared
<nixpkgs/nixos/modules/services/cluster/rancher/default.nix>