diff options
Diffstat (limited to 'nixpkgs/nixos/modules/services/networking/flannel.nix')
-rw-r--r-- | nixpkgs/nixos/modules/services/networking/flannel.nix | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/nixpkgs/nixos/modules/services/networking/flannel.nix b/nixpkgs/nixos/modules/services/networking/flannel.nix index ac84b3d35a3d..547b6e03949b 100644 --- a/nixpkgs/nixos/modules/services/networking/flannel.nix +++ b/nixpkgs/nixos/modules/services/networking/flannel.nix @@ -17,14 +17,14 @@ in { enable = mkEnableOption "flannel"; package = mkOption { - description = "Package to use for flannel"; + description = lib.mdDoc "Package to use for flannel"; type = types.package; default = pkgs.flannel; defaultText = literalExpression "pkgs.flannel"; }; publicIp = mkOption { - description = '' + description = lib.mdDoc '' IP accessible by other nodes for inter-host communication. Defaults to the IP of the interface being used for communication. ''; @@ -33,7 +33,7 @@ in { }; iface = mkOption { - description = '' + description = lib.mdDoc '' Interface to use (IP or name) for inter-host communication. Defaults to the interface for the default route on the machine. ''; @@ -43,38 +43,38 @@ in { etcd = { endpoints = mkOption { - description = "Etcd endpoints"; + description = lib.mdDoc "Etcd endpoints"; type = types.listOf types.str; default = ["http://127.0.0.1:2379"]; }; prefix = mkOption { - description = "Etcd key prefix"; + description = lib.mdDoc "Etcd key prefix"; type = types.str; default = "/coreos.com/network"; }; caFile = mkOption { - description = "Etcd certificate authority file"; + description = lib.mdDoc "Etcd certificate authority file"; type = types.nullOr types.path; default = null; }; certFile = mkOption { - description = "Etcd cert file"; + description = lib.mdDoc "Etcd cert file"; type = types.nullOr types.path; default = null; }; keyFile = mkOption { - description = "Etcd key file"; + description = lib.mdDoc "Etcd key file"; type = types.nullOr types.path; default = null; }; }; kubeconfig = mkOption { - description = '' + description = lib.mdDoc '' Path to kubeconfig to use for storing flannel config using the Kubernetes API ''; @@ -88,7 +88,7 @@ in { }; nodeName = mkOption { - description = '' + description = lib.mdDoc '' Needed when running with Kubernetes as backend as this cannot be auto-detected"; ''; type = types.nullOr types.str; @@ -100,13 +100,13 @@ in { }; storageBackend = mkOption { - description = "Determines where flannel stores its configuration at runtime"; + description = lib.mdDoc "Determines where flannel stores its configuration at runtime"; type = types.enum ["etcd" "kubernetes"]; default = "etcd"; }; subnetLen = mkOption { - description = '' + description = lib.mdDoc '' The size of the subnet allocated to each host. Defaults to 24 (i.e. /24) unless the Network was configured to be smaller than a /24 in which case it is one less than the network. @@ -116,7 +116,7 @@ in { }; subnetMin = mkOption { - description = '' + description = lib.mdDoc '' The beginning of IP range which the subnet allocation should start with. Defaults to the first subnet of Network. ''; @@ -125,7 +125,7 @@ in { }; subnetMax = mkOption { - description = '' + description = lib.mdDoc '' The end of IP range which the subnet allocation should start with. Defaults to the last subnet of Network. ''; @@ -134,7 +134,7 @@ in { }; backend = mkOption { - description = "Type of backend to use and specific configurations for that backend."; + description = lib.mdDoc "Type of backend to use and specific configurations for that backend."; type = types.attrs; default = { Type = "vxlan"; @@ -155,10 +155,11 @@ in { FLANNELD_ETCD_KEYFILE = cfg.etcd.keyFile; FLANNELD_ETCD_CERTFILE = cfg.etcd.certFile; FLANNELD_ETCD_CAFILE = cfg.etcd.caFile; - ETCDCTL_CERT_FILE = cfg.etcd.certFile; - ETCDCTL_KEY_FILE = cfg.etcd.keyFile; - ETCDCTL_CA_FILE = cfg.etcd.caFile; - ETCDCTL_PEERS = concatStringsSep "," cfg.etcd.endpoints; + ETCDCTL_CERT = cfg.etcd.certFile; + ETCDCTL_KEY = cfg.etcd.keyFile; + ETCDCTL_CACERT = cfg.etcd.caFile; + ETCDCTL_ENDPOINTS = concatStringsSep "," cfg.etcd.endpoints; + ETCDCTL_API = "3"; } // optionalAttrs (cfg.storageBackend == "kubernetes") { FLANNELD_KUBE_SUBNET_MGR = "true"; FLANNELD_KUBECONFIG_FILE = cfg.kubeconfig; @@ -167,7 +168,7 @@ in { path = [ pkgs.iptables ]; preStart = optionalString (cfg.storageBackend == "etcd") '' echo "setting network configuration" - until ${pkgs.etcd}/bin/etcdctl set /coreos.com/network/config '${builtins.toJSON networkConfig}' + until ${pkgs.etcd}/bin/etcdctl put /coreos.com/network/config '${builtins.toJSON networkConfig}' do echo "setting network configuration, retry" sleep 1 |