mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
nixos/flannel: node name needs to be configured for flannel to work with kubernetes storage backend
This commit is contained in:
parent
adc9da6178
commit
94136fdc1b
@ -87,6 +87,15 @@ in {
|
|||||||
type = types.str;
|
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 {
|
storageBackend = mkOption {
|
||||||
description = "Determines where flannel stores its configuration at runtime";
|
description = "Determines where flannel stores its configuration at runtime";
|
||||||
type = types.enum ["etcd" "kubernetes"];
|
type = types.enum ["etcd" "kubernetes"];
|
||||||
@ -150,6 +159,7 @@ in {
|
|||||||
} // optionalAttrs (cfg.storageBackend == "kubernetes") {
|
} // optionalAttrs (cfg.storageBackend == "kubernetes") {
|
||||||
FLANNELD_KUBE_SUBNET_MGR = "true";
|
FLANNELD_KUBE_SUBNET_MGR = "true";
|
||||||
FLANNELD_KUBECONFIG_FILE = cfg.kubeconfig;
|
FLANNELD_KUBECONFIG_FILE = cfg.kubeconfig;
|
||||||
|
NODE_NAME = cfg.nodeName;
|
||||||
};
|
};
|
||||||
preStart = mkIf (cfg.storageBackend == "etcd") ''
|
preStart = mkIf (cfg.storageBackend == "etcd") ''
|
||||||
echo "setting network configuration"
|
echo "setting network configuration"
|
||||||
|
Loading…
Reference in New Issue
Block a user