aespinosa / cookbook-kube

Custom Chef resources to launch a Kubernetes cluster
https://supermarket.chef.io/cookbooks/kube
Apache License 2.0
32 stars 20 forks source link

Resource defaults are not rendered #11

Closed lchi closed 8 years ago

lchi commented 8 years ago

Hello!

I was trying to use this cookbook to get started with launching a Kubernetes cluster, but noticed that a basic declaration like:

kubelet_service 'kubelet' do
  action [:create, :start]
  address '127.0.01'
end

does not render the default properties for the systemd ExecStart option. As it stands I don't think any of the resources can render out default properties.


Actual behavior:

# in /etc/systemd/system/kubelet.service
ExecStart=/usr/sbin/kubelet

Expected behavior:

# in /etc/systemd/system/kubelet.service
ExecStart=/usr/sbin/kubelet --address=0.0.0.0 --allow-privileged=false ...

Is this intended? If not, I believe the fix could be simple and I'd be happy to implement it.

aespinosa commented 8 years ago

Hi,

When I used the resource defaults, I based it off the commandline defaults in http://kubernetes.io/docs/admin/kubelet/ (and on other binaries). So it if it the default value in the resource, then not having the flag should have the same intended effect.

I had the tests laid out in https://github.com/aespinosa/cookbook-kube/blob/master/test/unit/command_generator_test.rb#L24 to show that it was intended.

lchi commented 8 years ago

I see, thanks!