summary refs log tree commit diff
path: root/nixos/modules/services/networking/flannel.nix
diff options
context:
space:
mode:
authorJohan Thomsen <jth@dbc.dk>2019-02-13 17:17:52 +0100
committerJohan Thomsen <jth@dbc.dk>2019-02-13 17:17:52 +0100
commit94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e (patch)
treeade8be55f3b0ef43edba9fd6142a2bec74b8694f /nixos/modules/services/networking/flannel.nix
parentadc9da617884b240f3799875b8e3b1ae3ae3185e (diff)
downloadnixpkgs-94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e.tar
nixpkgs-94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e.tar.gz
nixpkgs-94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e.tar.bz2
nixpkgs-94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e.tar.lz
nixpkgs-94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e.tar.xz
nixpkgs-94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e.tar.zst
nixpkgs-94136fdc1b6c0eb71d10b27a9a2cb597d73ca33e.zip
nixos/flannel: node name needs to be configured for flannel to work with kubernetes storage backend
Diffstat (limited to 'nixos/modules/services/networking/flannel.nix')
-rw-r--r--nixos/modules/services/networking/flannel.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/flannel.nix b/nixos/modules/services/networking/flannel.nix
index cb39a53b5f9..6c43573851b 100644
--- a/nixos/modules/services/networking/flannel.nix
+++ b/nixos/modules/services/networking/flannel.nix
@@ -87,6 +87,15 @@ in {
       type = types.str;
     };
 
+    nodeName = mkOption {
+      description = ''
+        Needed when running with Kubernetes as backend as this cannot be auto-detected";
+      '';
+      type = types.nullOr types.str;
+      default = with config.networking; (hostName + optionalString (!isNull domain) ".${domain}");
+      example = "node1.example.com";
+    };
+
     storageBackend = mkOption {
       description = "Determines where flannel stores its configuration at runtime";
       type = types.enum ["etcd" "kubernetes"];
@@ -150,6 +159,7 @@ in {
       } // optionalAttrs (cfg.storageBackend == "kubernetes") {
         FLANNELD_KUBE_SUBNET_MGR = "true";
         FLANNELD_KUBECONFIG_FILE = cfg.kubeconfig;
+        NODE_NAME = cfg.nodeName;
       };
       preStart = mkIf (cfg.storageBackend == "etcd") ''
         echo "setting network configuration"