Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


kube (14) Versions 5.0.0

Custom resources to build a Kubernetes Cluster

cookbook 'kube', '~> 5.0.0', :supermarket
cookbook 'kube', '~> 5.0.0'
knife supermarket install kube
knife supermarket download kube
Quality 33%

kube cookbook

The kube cookbook is a Library cookbook that provides custom resources for
managing various components of a Kubernetes cluster.



  • Chef Infra client 15 or higher


  • Ubuntu 16.04+
  • Debian 8+
  • RHEL 7+

Cookbook Dependencies

  • None


  • Add 'kube', '~> 5.0' to your cookbook's metadata.rb.
  • Use the resources shipped in this cookbook in your recipes the same way you use core Chef resources like file, template, directory, package, etc.
# Master
kube_apiserver 'default' do
  service_cluster_ip_range ''
  etcd_servers ''
  insecure_bind_address '' # for convenience
  action %w(create start)

kube_scheduler 'default' do
  master ''
  action %w(create start)

kube_controller_manager 'default' do
  master ''
  action %w(create start)

# Node

kubelet_service 'default' do
  api_servers ''
  config '/etc/kubernetes/manifests'
  cluster_dns ''
  cluster_domain 'cluster.local'
  action %w(create start)

kube_proxy 'default' do
  master ''
  action %w(create start)

The test cookbook ran under test-kitchen provide good usage examples. It is
found in test/cookbooks/kube_test.

Resources Overview

Components for a Kubernetes node:

  • kubelet
  • kube_proxy

Components for a Kubernetes master:

  • kube_apiserver
  • kube_scheduler
  • kube_controller_manager

Common Properties

All the above resources will contain the following properties:

  • remote - The URL of where a corresponding component's binary can be downloaded. The default value points to the official Kubernetes release URL of each component. Check each resource for the default value of each component.
  • version - The version of the Kubernetes artifact to pull down. Defaults to '1.7.5'. NOTE: This will be ignored if you set the remote property instead.
  • checksum - The SHA256 hash of the Kubernetes component's binary.
  • run_user - The user in which to run the Kubernetes user. Defaults to 'kubernetes'.
  • file_ulimit - The file ulimit value to set for the services - Integer. Defaults to 65536

Common Actions

All the above resources will contain the following actions:

  • create - Download the Kubernetes component's binary to /usr/bin.
  • start - Starts the Kubernetes component managed through a systemd unit.

Resource Properties

Each resource' set of unique properties corresponds to the options in the
Kubernetes component they represent:

In general, a command line flag of the form --long-option will correspond to a
custom resource property called long_option.

Extending Properties

When newer versions of Kubernetes are released, components might introduce and
deprecate some commandline flags that are not yet hard-coded as properties.

To add these properties, a wrapper cookbook can be written like the following:

# wrapper-cookbook/metadata.rb
name 'wrapper-cookbook'
depends 'kube', '~> 5.0' # Make sure you have this

# wrapper-cookbook/libraries/apiserver.rb
class KubernetesCookbook::KubeApiserver
  property :something_only_in_kubernetes9000

The kube_apiserver resource can now use the new commandline flag available in
Kubernetes v9000 like the following:

# wrapper-cookbook/recipes/default.rb
kube_apiserver 'default' do
  something_only_in_kubernetes9000 'someflag'


Copyright 2016-2017 Allan Espinosa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.


  • Support Chef Infra Client 16+
  • Drop Chef Infra Client 12-13 support


  • Add kubernetes 1.12 options
  • Remove default value for kubeconfig
  • Add --rotate-certificates in kubelet


  • Use kubernetes 1.7.6 by default.
  • Add the :version property to pull version binaries upstream.
  • Support other systemd-based platforms like CentOS and Ubuntu.
  • Bump the minimum version required for the chef-client.
  • Document how to anticipate newer versions of Kubernetes.


  • Bump more metadata to pass Supermarket quality metrics.


  • Bump documentation and other metadata information to pass Supermarket quality metrics.


  • Document how to use the custom resources
  • Update unit tests for Chef 13


  • Update resource properties to commandline flags in 1.4.0


  • Update resource properties to reflect kube 1.3.x commandline flags (#13)


  • Bump kubernetes binaries to 1.3.6
  • Remove cluster-name to the api-server parameters (#12)


  • Set systemd unit flags to automatically start on boot
  • Boot the kubelet only after the container runtime is available


  • Introduce remote and checksum properties for downloading the binaries
  • Fix hard-wired kube-proxy command in its systemd unit


  • Complete commandline flags as resource properties for all the custom resources:


  • Specify the cookbook in inline templates
  • Move recipe to a test cookbook fixture


  • Bare resources to boot a cluster

Collaborator Number Metric

5.0.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

5.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

5.0.0 passed this metric

No Binaries Metric

5.0.0 passed this metric

Testing File Metric

5.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

5.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number