config: document and update flannel config values

Fixes #297
This commit is contained in:
Eugene Yakubovich 2015-01-13 15:49:33 -08:00
parent 1ab530f157
commit 58f0dadaf9
3 changed files with 24 additions and 13 deletions

View File

@ -109,7 +109,7 @@ flanneld. For example, the following cloud-config...
coreos: coreos:
flannel: flannel:
etcd-prefix: /coreos.com/network2 etcd_prefix: /coreos.com/network2
``` ```
...will generate a systemd unit drop-in like so: ...will generate a systemd unit drop-in like so:
@ -119,7 +119,15 @@ coreos:
Environment="FLANNELD_ETCD_PREFIX=/coreos.com/network2" Environment="FLANNELD_ETCD_PREFIX=/coreos.com/network2"
``` ```
For the complete list of flannel configuraion parameters, see the [flannel documentation][flannel-readme]. List of flannel configuration parameters:
- **etcd_endpoints**: Comma separated list of etcd endpoints
- **etcd_cafile**: Path to CA file used for TLS communication with etcd
- **etcd_certfile**: Path to certificate file used for TLS communication with etcd
- **etcd_keyfile**: Path to private key file used for TLS communication with etcd
- **etcd_prefix**: Etcd prefix path to be used for flannel keys
- **ip_masq**: Install IP masquerade rules for traffic outside of flannel subnet
- **subnet_file**: Path to flannel subnet file to write out
- **interface**: Interface (name or IP) that should be used for inter-host communication
[flannel-readme]: https://github.com/coreos/flannel/blob/master/README.md [flannel-readme]: https://github.com/coreos/flannel/blob/master/README.md

View File

@ -1,7 +1,10 @@
package config package config
type Flannel struct { type Flannel struct {
EtcdEndpoint string `yaml:"etcd_endpoint" env:"FLANNELD_ETCD_ENDPOINT"` EtcdEndpoints string `yaml:"etcd_endpoints" env:"FLANNELD_ETCD_ENDPOINTS"`
EtcdCAFile string `yaml:"etcd_cafile" env:"FLANNELD_ETCD_CAFILE"`
EtcdCertFile string `yaml:"etcd_certfile" env:"FLANNELD_ETCD_CERTFILE"`
EtcdKeyFile string `yaml:"etcd_keyfile" env:"FLANNELD_ETCD_KEYFILE"`
EtcdPrefix string `yaml:"etcd_prefix" env:"FLANNELD_ETCD_PREFIX"` EtcdPrefix string `yaml:"etcd_prefix" env:"FLANNELD_ETCD_PREFIX"`
IPMasq string `yaml:"ip_masq" env:"FLANNELD_IP_MASQ"` IPMasq string `yaml:"ip_masq" env:"FLANNELD_IP_MASQ"`
SubnetFile string `yaml:"subnet_file" env:"FLANNELD_SUBNET_FILE"` SubnetFile string `yaml:"subnet_file" env:"FLANNELD_SUBNET_FILE"`

View File

@ -18,10 +18,10 @@ func TestFlannelEnvVars(t *testing.T) {
}, },
{ {
config.Flannel{ config.Flannel{
EtcdEndpoint: "http://12.34.56.78:4001", EtcdEndpoints: "http://12.34.56.78:4001",
EtcdPrefix: "/coreos.com/network/tenant1", EtcdPrefix: "/coreos.com/network/tenant1",
}, },
`FLANNELD_ETCD_ENDPOINT=http://12.34.56.78:4001 `FLANNELD_ETCD_ENDPOINTS=http://12.34.56.78:4001
FLANNELD_ETCD_PREFIX=/coreos.com/network/tenant1`, FLANNELD_ETCD_PREFIX=/coreos.com/network/tenant1`,
}, },
} { } {
@ -43,13 +43,13 @@ func TestFlannelFile(t *testing.T) {
}, },
{ {
config.Flannel{ config.Flannel{
EtcdEndpoint: "http://12.34.56.78:4001", EtcdEndpoints: "http://12.34.56.78:4001",
EtcdPrefix: "/coreos.com/network/tenant1", EtcdPrefix: "/coreos.com/network/tenant1",
}, },
&File{config.File{ &File{config.File{
Path: "run/flannel/options.env", Path: "run/flannel/options.env",
RawFilePermissions: "0644", RawFilePermissions: "0644",
Content: `FLANNELD_ETCD_ENDPOINT=http://12.34.56.78:4001 Content: `FLANNELD_ETCD_ENDPOINTS=http://12.34.56.78:4001
FLANNELD_ETCD_PREFIX=/coreos.com/network/tenant1`, FLANNELD_ETCD_PREFIX=/coreos.com/network/tenant1`,
}}, }},
}, },