This is a library cookbook that provides resources for setting up flannel instances.
- Chef 12.5.0 or higher.
- Network accessible web server hosting the flannel binaries.
Tested on the following platforms with test-kitchen:
- debian-8.4
- centos-7.2
- ubuntu-16.04
- Add
depends 'flannel', '~> 0.3'
to your cookbook'smetadata.rb
. - Use the resources shipped in this cookbook.
flannel_service
Downloads pre-compiled Go binaries of flanneld onto disk.
- The
:create
action downloads the pre-compiled go binary of flanneld onto disk. - The
:configure
action connects to etcd and loads the flanneld configuration to it. - The
:start
action runs flanneld as a systemd service
It has the following properties corresponding to flannel's commandline options
public_ip
etcd_endpoints
etcd_prefix
etcd_keyfile
etcd_certfile
etcd_cafile
iface
subnet_file
ip_masq
listen
remote
remote_keyfile
remote_certfile
networks
v
orlog_level
Another property called config
corresponds to
flannel's etcd-stored configuration
Additionally, if you are using TLS with etcd, you can pass extra options to the
etcdctl tool using the etcdctl_options
property
The libraries/subnet_parser.rb file extends the flannel_service resource to read and parse the subnet file. An example approach on integrating with the docker cookbook is found in test/cookbooks/flannel_test/recipes/docker.rb.