Kubernetes stack cookbook to work with Kubernetes: https://supermarket.chef.io/cookbooks/kubernetes-stack
- Chef 12.5.x or higher. Chef 11 is NOT SUPPORTED.
gcloud | kubectl | helm | |
---|---|---|---|
centos-7 | ✔ | ✔ | ✔ |
ubuntu-16.04 | ✔ | ✔ | ✔ |
kubectl
: support all centos-7 and ubuntu-16.04 versions.helm
: support all centos-7 and ubuntu-16.04 versions.gcloud
: support all centos-7 and ubuntu-16.04 versions.minikube
: support all centos-7 and ubuntu-16.04 versions.
- kubernetes-stack
- docker
-
docker must be installed in machine
-
minikube
should be run with special user. You can change by override attributes in recipe:node.override['kubernetes-stack']['user'] = `user`
-
or edit attributes in
default.rb
file
- Add
depends 'kubernetes-stack'
to your cookbook's metadata.rb. - Use the resources shipped in cookbook in a recipe :
kubectl 'install kubectl' do
action [:install, :remove]
version '' #application version (if empty, default: latest)
path '' #application path (if empty, default: /usr/local/bin)
end
gcloud 'install gcloud' do
action [:install, :remove]
version '' #application version (if empty, default: latest)
path '' #application path (if empty, default: /usr/local/bin)
end
helm 'install helm' do
action [:install, :remove]
version '' #application version (if empty, default: latest)
path '' #application path (if empty, default: /usr/local/bin)
end
minikube 'install minikube' do
action [:install, :run, :remove]
version '' #application version (if empty, default: latest)
path '' #application path (if empty, default: /usr/local/bin)
k8s_version '' #kubernetes_version (if empty, default: latest)
network_plugin '' #network plugin use in minikube
bootstrapper '' #bootstrapper use in minikube
vm_driver '' #vm driver use in minikube (if empty, default: none)
end
-
Fork this project into your personal account and then clone it into the workspace directory:
$ cd ~/teracy-dev/workspace $ git checkout <your_forked_repo> $ cd kubernetes-stack-cookbook $ git remote add upstream [email protected]:teracyhq-incubator/kubernetes-stack-cookbook.git
-
$ vagrant reload --provision
to update the dev-setup from this project into the teracy-dev's VM. -
For codestyle checking:
$ cd ~/teracy-dev $ vagrant ssh $ ws $ cd kubernetes-stack-cookbook $ codestyle
-
For rspec checking:
$ rspec
-
For kitchen testing:
$ kitchen list $ kitchen verify <instance>
- gcloud: install or remove
google-cloud-sdk
. - kubectl: install or remove
kubectl
. - helm: install or remove
helm
. - minikube: install and run or remove
minikube
.
The gcloud
resource auto-install or auto-remove gcloud
with the provider resolution system.
Install gcloud
with default version:
gcloud 'install default gcloud' do
action :install
version ''
path ''
end
Install gcloud
with specific version:
gcloud 'install specific gcloud version' do
action :install
version '164.0.0'
path ''
end
Remove gcloud
:
gcloud 'remove gcloud' do
action :remove
end
action
-:install
to installgcloud
,:remove
to uninstallgcloud
.version
- The desired version ofgcloud
.path
- Application path (if empty, default:/usr/local/bin).
The kubectl
resource auto-install or auto-remove kubectl
with the provider resolution system.
Install kubectl
with default version:
kubectl 'install default kubectl' do
action :install
version ''
path ''
end
Install kubectl
with specific version:
kubectl 'install specific kubectl version' do
action :install
version 'v1.7.0'
path ''
end
Remove kubectl
:
kubectl 'remove kubectl' do
action :remove
end
action
-:install
to installkubectl
,:remove
to uninstallkubectl
.version
- The desired version ofkubectl
.path
- Application path (if empty, default:/usr/local/bin).
The helm
resource auto-install or auto-remove helm
with the provider resolution system.
Install helm
with default version:
helm 'install default helm' do
action :install
version ''
path ''
end
Install helm
with specific version:
helm 'install specific helm version' do
action :install
version 'v2.4.2'
path ''
end
Remove helm
:
helm 'remove helm' do
action :remove
end
action
-:install
to installhelm
,:remove
to uninstallhelm
.version
- The desired version ofhelm
.path
- Application path (if empty, default:/usr/local/bin).
The minikube
resource auto-install and run or auto-remove minikube
with the provider resolution system.
Install and run minikube
:
minikube 'install minikube' do
action [:install, :run]
version 'v0.25.2' #application version (if empty, default: latest)
path '' #application path (if empty, default: /usr/local/bin)
k8s_version '' #kubernetes_version (if empty, default: latest)
network_plugin 'cni' #network plugin use in minikube
bootstrapper 'kubeadm' #bootstrapper use in minikube
vm_driver 'none' #vm driver use in minikube (if empty, default: none)
end
Remove minikube
:
minikube 'remove minikube' do
action :remove
end
action
-:install
to installminikube
,:remove
to uninstallminikube
.version
- The desired version ofminikube
.k8s_version
- The desired version ofkubernetes resource
.path
- Application path (if empty, default:/usr/local/bin).network_plugin
- Network plugin.bootstrapper
- Bootstrapper.vm_driver
- Vm driver (if empty, default:none).
- https://github.com/teracyhq/dev
- https://docs.chef.io/cookstyle.html
- https://github.com/chef/cookstyle
- https://github.com/someara/kitchen-dokken
- https://docs.chef.io/about_chefdk.html
- https://github.com/chef/chef-dk
- http://kitchen.ci/
Copyright (c) Teracy Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.