<p>I am using the latest Kube cookbook for deploying Kubernetes cluster in my environment using Chef Here is my recipe based on the Kube cookbook available in the <a href="https://supermarket.chef.io/cookbooks/kube" rel="nofollow noreferrer">chef supermarket</a></p>
<pre><code># Etcd 
etcd_service 'default' do
  action %w(create start)
end

# Kubernetes cluster

kube_apiserver 'default' do
  service_cluster_ip_range '10.0.0.1/24'
  etcd_servers 'http://127.0.0.1:2379'
  insecure_bind_address '0.0.0.0'
  action %w(create start)
end

group 'docker' do
  members %w(kubernetes)
end

kube_scheduler 'default' do
  master '127.0.0.1:8080'
  action %w(create start)
end

kube_controller_manager 'default' do
  master '127.0.0.1:8080'
  action %w(create start)
end
</code></pre>
<p>Here is my metadata.rb</p>
<pre><code>depends 'etcd', '&gt;= 6.0.0'
depends 'kube', '&gt;= 4.0.0'
depends 'docker', '&gt;= 7.0.0'
</code></pre>
<p>But after running the recipe I get the following error:</p>
<pre><code>    ================================================================================
    virtualbox-iso: Recipe Compile Error in /var/chef/cache/cookbooks/k8_master/recipes/default.rb
    virtualbox-iso: ================================================================================
    virtualbox-iso:
    virtualbox-iso: NoMethodError
    virtualbox-iso: -------------
    virtualbox-iso: undefined method `kube_apiserver' for cookbook: k8_master, recipe: default :Chef::Recipe
    virtualbox-iso:
    virtualbox-iso: Cookbook Trace: (most recent call first)
    virtualbox-iso: ----------------------------------------
    virtualbox-iso:   /var/chef/cache/cookbooks/k8_master/recipes/default.rb:48:in `from_file'
    virtualbox-iso:
    virtualbox-iso: Relevant File Content:
    virtualbox-iso: ----------------------
    virtualbox-iso: /var/chef/cache/cookbooks/k8_master/recipes/default.rb:
    virtualbox-iso:
    virtualbox-iso:  46:  # Kubernetes cluster
    virtualbox-iso:  47:
    virtualbox-iso:  48&gt;&gt; kube_apiserver 'default' do
    virtualbox-iso:  49:    service_cluster_ip_range '10.0.0.1/24'
    virtualbox-iso:  50:    etcd_servers 'http://127.0.0.1:2379'
    virtualbox-iso:  51:    insecure_bind_address '0.0.0.0'
    virtualbox-iso:  52:    action %w(create start)
    virtualbox-iso:  53:  end
    virtualbox-iso: 
    virtualbox-iso: System Info:
    virtualbox-iso: ------------
    virtualbox-iso: chef_version=16.4.41
    virtualbox-iso: platform=centos
    virtualbox-iso: platform_version=7.8.2003
    virtualbox-iso: ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
    virtualbox-iso: program_name=/bin/chef-client
    virtualbox-iso: executable=/opt/chef/bin/chef-client
    virtualbox-iso:
    virtualbox-iso:

</code></pre>
<p>I followed exactly as specified in <a href="https://github.com/aespinosa/cookbook-kube" rel="nofollow noreferrer">Readme</a>
Can someone tell me whats wrong here ?</p>

<p>You need to use the v5.0.0 version of that cookbook which has support for Chef Infra Client 16:</p>
<p><a href="https://github.com/aespinosa/cookbook-kube/commit/f95626f6ce00b9f8c9cf94fbcb87dfffb74d00c2" rel="nofollow noreferrer">https://github.com/aespinosa/cookbook-kube/commit/f95626f6ce00b9f8c9cf94fbcb87dfffb74d00c2</a></p>
