Grid環境構築用のChefリポジトリです。
リビジョン | 741222e453a17e78e3305b2227fae2ee639d148a (tree) |
---|---|
日時 | 2017-01-27 22:12:36 |
作者 | whitestar <whitestar@gaea...> |
コミッター | whitestar |
adds the kubernetes-grid::gp-node recipe.
@@ -1,5 +1,9 @@ | ||
1 | 1 | # kubernetes-grid CHANGELOG |
2 | 2 | |
3 | +0.1.1 | |
4 | +----- | |
5 | +- adds the `kubernetes-grid::gp-node` recipe. | |
6 | + | |
3 | 7 | 0.1.0 |
4 | 8 | ----- |
5 | 9 | - Initial release of kubernetes-grid |
@@ -50,6 +50,10 @@ This cookbook sets up Kubernetes cluster. | ||
50 | 50 | |
51 | 51 | This recipe does nothing. |
52 | 52 | |
53 | +#### kubernetes-grid::gp-node | |
54 | + | |
55 | +This recipe sets up a general-purpose (GP) node (master or worker). | |
56 | + | |
53 | 57 | #### kubernetes-grid::master |
54 | 58 | |
55 | 59 | This recipe sets up a master node. |
@@ -5,7 +5,7 @@ maintainer_email '' | ||
5 | 5 | license 'Apache 2.0' |
6 | 6 | description 'Installs/Configures Kubernetes' |
7 | 7 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) |
8 | -version '0.1.0' | |
8 | +version '0.1.1' | |
9 | 9 | |
10 | 10 | source_url 'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git' |
11 | 11 | issues_url 'https://osdn.jp/projects/metasearch/ticket' |
@@ -0,0 +1,23 @@ | ||
1 | +# | |
2 | +# Cookbook Name:: kubernetes-grid | |
3 | +# Recipe:: gp-node | |
4 | +# | |
5 | +# Copyright 2017, whitestar | |
6 | +# | |
7 | +# Licensed under the Apache License, Version 2.0 (the "License"); | |
8 | +# you may not use this file except in compliance with the License. | |
9 | +# You may obtain a copy of the License at | |
10 | +# | |
11 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
12 | +# | |
13 | +# Unless required by applicable law or agreed to in writing, software | |
14 | +# distributed under the License is distributed on an "AS IS" BASIS, | |
15 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
16 | +# See the License for the specific language governing permissions and | |
17 | +# limitations under the License. | |
18 | +# | |
19 | + | |
20 | +# http://kubernetes.io/docs/getting-started-guides/kubeadm/ | |
21 | + | |
22 | +include_recipe 'kubernetes-grid::master' | |
23 | +include_recipe 'kubernetes-grid::node' |
@@ -19,12 +19,19 @@ | ||
19 | 19 | |
20 | 20 | # http://kubernetes.io/docs/getting-started-guides/kubeadm/ |
21 | 21 | |
22 | +::Chef::Recipe.send(:include, PlatformUtils::VirtUtils) | |
23 | + | |
22 | 24 | if node['kubernetes-grid']['docker-engine']['setup'] |
23 | 25 | include_recipe 'docker-grid::engine' |
24 | 26 | end |
25 | 27 | |
26 | 28 | case node['platform_family'] |
27 | 29 | when 'rhel' |
30 | +=begin | |
31 | + if container_guest_node? | |
32 | + # TODO: | |
33 | + end | |
34 | +=end | |
28 | 35 | disable_selinux = 'disable_selinux' |
29 | 36 | resources(execute: disable_selinux) rescue execute disable_selinux do |
30 | 37 | user 'root' |
@@ -53,6 +60,17 @@ when 'rhel' | ||
53 | 60 | notifies :run, 'execute[yum_makecache_kubernetes]', :immediately |
54 | 61 | end |
55 | 62 | when 'debian' |
63 | + if container_guest_node? | |
64 | + Chef::Log.warn( | |
65 | + 'This node is running in the Linux container, Chef installs the linux-image. ' \ | |
66 | + 'See https://github.com/kubernetes/kubernetes/issues/39282' | |
67 | + ) | |
68 | + kern_pkg = "linux-image-#{node['kernel']['release']}" | |
69 | + resources(package: kern_pkg) rescue package kern_pkg do | |
70 | + action :install | |
71 | + end | |
72 | + end | |
73 | + | |
56 | 74 | [ |
57 | 75 | 'curl', |
58 | 76 | ].each {|pkg| |
@@ -0,0 +1,5 @@ | ||
1 | +{ | |
2 | + "run_list": [ | |
3 | + "role[kube-gp-node]" | |
4 | + ] | |
5 | +} |
@@ -0,0 +1,17 @@ | ||
1 | +cluster_name = 'kube' | |
2 | + | |
3 | +name "#{cluster_name}-gp-node" | |
4 | +description "#{cluster_name} cluster general-purpose node" | |
5 | + | |
6 | +run_list( | |
7 | + "role[#{cluster_name}]", | |
8 | + 'recipe[kubernetes-grid::gp-node]', | |
9 | +) | |
10 | + | |
11 | +#env_run_lists | |
12 | + | |
13 | +default_attributes( | |
14 | +) | |
15 | + | |
16 | +override_attributes( | |
17 | +) |
@@ -0,0 +1,25 @@ | ||
1 | +cluster_name = 'kube' | |
2 | + | |
3 | +name "#{cluster_name}" | |
4 | +description "#{cluster_name} cluster" | |
5 | + | |
6 | +run_list( | |
7 | +) | |
8 | + | |
9 | +#env_run_lists | |
10 | + | |
11 | +default_attributes( | |
12 | +) | |
13 | + | |
14 | +override_attributes( | |
15 | + 'docker-grid' => { | |
16 | + 'engine' => { | |
17 | + 'version_on_centos' => '1.11.2-1', | |
18 | + 'version_on_ubuntu' => '1.11.2-0', | |
19 | + 'storage-driver_on_centos' => 'overlay', | |
20 | + 'storage-driver_on_ubuntu' => 'overlay', # default: aufs | |
21 | + #'userns-remap' => 'default', | |
22 | + 'daemon_extra_options' => '-H fd:// --bip=192.168.128.1/24 --fixed-cidr=192.168.128.0/24', | |
23 | + }, | |
24 | + }, | |
25 | +) |