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
:createaction downloads the pre-compiled go binary of flanneld onto disk. - The
:configureaction connects to etcd and loads the flanneld configuration to it. - The
:startaction runs flanneld as a systemd service
It has the following properties corresponding to flannel's commandline options
public_ipetcd_endpointsetcd_prefixetcd_keyfileetcd_certfileetcd_cafileifacesubnet_fileip_masqlistenremoteremote_keyfileremote_certfilenetworksvorlog_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.