From 3d0bad832400b0f9dc5f87bd0d59d17870092343 Mon Sep 17 00:00:00 2001 From: hieptranquoc Date: Thu, 1 Feb 2018 13:01:16 +0700 Subject: [PATCH] @#31 | add k8s resource --- .idea/kubernetes-stack-cookbook.iml | 16 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/workspace.xml | 304 ++++++++++++++++ .kitchen.dokken.yml | 21 +- .kitchen.yml | 50 ++- .rubocop.yml | 1 + .travis.yml | 14 +- Berksfile | 1 + CONTRIBUTING.md | 1 + CONTRIBUTORS.md | 2 +- README.md | 91 ++++- TESTING.md | 1 + attributes/default.rb | 38 +- .../kubernetes-stack-cookbook/metadata.rb | 2 + .../recipes/chefdk.rb | 1 + .../recipes/default.rb | 1 + .../spec/unit/recipes/default_spec.rb | 1 + .../test/smoke/default/default_test.rb | 3 +- dev-setup/vagrant_config_default.json | 3 +- libraries/helpers.rb | 51 +++ libraries/matcher.rb | 5 + metadata.rb | 4 + recipes/default.rb | 1 + resources/gcloud.rb | 342 +++++++++++------- resources/helm.rb | 223 +++++++++--- resources/kubectl.rb | 194 +++++++--- resources/minikube.rb | 266 ++++++++++++++ spec/spec_helper.rb | 1 + spec/unit/recipes/default_spec.rb | 1 + spec/unit/resources/install_gcloud_spec.rb | 21 +- spec/unit/resources/install_helm_spec.rb | 21 +- spec/unit/resources/install_kubectl_spec.rb | 21 +- spec/unit/resources/install_minikube_spec.rb | 82 +++++ .../kubernetes-stack-test/metadata.rb | 2 + .../kubernetes-stack-test/recipes/default.rb | 3 + .../kubernetes-stack-test/recipes/docker.rb | 31 ++ .../kubernetes-stack-test/recipes/install.rb | 14 + .../recipes/install_gcloud_for_chefspec.rb | 7 +- .../recipes/install_helm_for_chefspec.rb | 5 +- .../recipes/install_kubectl_for_chefspec.rb | 7 +- .../recipes/install_minikube_for_chefspec.rb | 7 + .../recipes/uninstall.rb | 9 +- test/smoke/default/default_test.rb | 3 +- .../gcloud_install_specific_version_test.rb | 10 - ...default_test.rb => gcloud_install_test.rb} | 3 +- test/smoke/gcloud/gcloud_uninstall_test.rb | 3 +- .../helm_install_specific_version_test.rb | 10 - ...l_default_test.rb => helm_install_test.rb} | 3 +- test/smoke/helm/helm_uninstall_test.rb | 3 +- .../kubectl_install_specific_version_test.rb | 10 - ...efault_test.rb => kubectl_install_test.rb} | 3 +- test/smoke/kubectl/kubectl_uninstall_test.rb | 3 +- test/smoke/minikube/minikube_install_test.rb | 56 +++ .../smoke/minikube/minikube_uninstall_test.rb | 10 + 55 files changed, 1580 insertions(+), 418 deletions(-) create mode 100644 .idea/kubernetes-stack-cookbook.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/workspace.xml create mode 100644 CONTRIBUTING.md create mode 100644 TESTING.md create mode 100644 libraries/helpers.rb create mode 100644 resources/minikube.rb create mode 100644 spec/unit/resources/install_minikube_spec.rb create mode 100644 test/fixtures/cookbooks/kubernetes-stack-test/recipes/docker.rb create mode 100644 test/fixtures/cookbooks/kubernetes-stack-test/recipes/install_minikube_for_chefspec.rb delete mode 100644 test/smoke/gcloud/gcloud_install_specific_version_test.rb rename test/smoke/gcloud/{gcloud_install_default_test.rb => gcloud_install_test.rb} (93%) delete mode 100644 test/smoke/helm/helm_install_specific_version_test.rb rename test/smoke/helm/{helm_install_default_test.rb => helm_install_test.rb} (93%) delete mode 100644 test/smoke/kubectl/kubectl_install_specific_version_test.rb rename test/smoke/kubectl/{kubectl_install_default_test.rb => kubectl_install_test.rb} (92%) create mode 100644 test/smoke/minikube/minikube_install_test.rb create mode 100644 test/smoke/minikube/minikube_uninstall_test.rb diff --git a/.idea/kubernetes-stack-cookbook.iml b/.idea/kubernetes-stack-cookbook.iml new file mode 100644 index 0000000..f8b023f --- /dev/null +++ b/.idea/kubernetes-stack-cookbook.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..de6e841 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..01001c1 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..9db6edb --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +