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. Should use version avaiable in https://packages.cloud.google.com/apt/ (with ubuntu platform) for faster autocomplete.
- 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)
binary_path '' #application path (if empty, default: /usr/local/bin/kubectl)
end
gcloud 'install gcloud' do
action [:install, :remove]
version '' #application version (if empty, default: latest)
binary_path '' #application path (if empty, default: /usr/local/bin/gcloud)
end
helm 'install helm' do
action [:install, :remove]
version '' #application version (if empty, default: latest)
binary_path '' #application path (if empty, default: /usr/local/bin/helm)
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 --provisionto 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.
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 ''
binary_path ''
endInstall gcloud with specific version:
gcloud 'install specific gcloud version' do
action :install
version '164.0.0'
binary_path ''
endRemove gcloud:
gcloud 'remove gcloud' do
action :remove
endaction-:installto installgcloud,:removeto uninstallgcloud.version- The desired version ofgcloud.binary_path- Application path (if empty, default:/usr/local/bin/gcloud)
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 ''
binary_path ''
endInstall kubectl with specific version:
kubectl 'install specific kubectl version' do
action :install
version 'v1.7.0'
binary_path ''
endRemove kubectl:
kubectl 'remove kubectl' do
action :remove
endaction-:installto installkubectl,:removeto uninstallkubectl.version- The desired version ofkubectl.binary_path- Application path (if empty, default:/usr/local/bin/kubectl)
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 ''
binary_path ''
endInstall helm with specific version:
helm 'install specific helm version' do
action :install
version 'v2.4.2'
binary_path ''
endRemove helm:
helm 'remove helm' do
action :remove
endaction-:installto installhelm,:removeto uninstallhelm.version- The desired version ofhelm.binary_path- Application path (if empty, default:/usr/local/bin/helm)
- 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.