Skip to content

Commit ad61459

Browse files
authored
WIP Kube 1.8.3 support (#21)
Kube 1.8.3 support
1 parent 3cb7f1b commit ad61459

File tree

13 files changed

+28
-13
lines changed

13 files changed

+28
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
# Version 0.1.2
2+
Supports Kubernetes up to 1.8.x
3+
14
# Version 0.1.1
25
Hotfix for kubeproxy
36

4-
57
# Version 0.1.0
68
First release
79
Supports Kubernetes 1.6 - 1.7.5

manifests/cluster_roles.pp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class kubernetes::cluster_roles (
44

55
$bootstrap_controller = $kubernetes::bootstrap_controller,
6-
6+
$kubernetes_version = $kubernetes::kubernetes_version,
77
){
88

99
if $bootstrap_controller {
@@ -31,5 +31,12 @@
3131
refreshonly => true,
3232
require => File['/etc/kubernetes/manifests/clusterRoleBinding.yaml'],
3333
}
34+
35+
if $kubernetes_version =~ /1[.]8[.]\d/ {
36+
37+
exec { 'Create role biniding for system nodes':
38+
command => 'kubectl set subject clusterrolebinding system:node --group=system:nodes',
39+
}
40+
}
3441
}
3542
}

manifests/config.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
$bootstrap_token_id = $kubernetes::bootstrap_token_id,
2121
$bootstrap_token_secret = $kubernetes::bootstrap_token_secret,
2222
$bootstrap_token_usage_bootstrap_authentication = $kubernetes::bootstrap_token_usage_bootstrap_authentication,
23+
$bootstrap_token_expiration = $kubernetes::bootstrap_token_expiration,
2324
$bootstrap_token_usage_bootstrap_signing = $kubernetes::bootstrap_token_usage_bootstrap_signing,
2425
$certificate_authority_data = $kubernetes::certificate_authority_data,
2526
$client_certificate_data_controller = $kubernetes::client_certificate_data_controller,

manifests/init.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
$bootstrap_token_id = $kubernetes::params::bootstrap_token_id,
221221
$bootstrap_token_secret = $kubernetes::params::bootstrap_token_secret,
222222
$bootstrap_token_usage_bootstrap_authentication = $kubernetes::params::bootstrap_token_usage_bootstrap_authentication,
223+
$bootstrap_token_expiration = $kubernetes::params::bootstrap_token_expiration,
223224
$bootstrap_token_usage_bootstrap_signing = $kubernetes::params::bootstrap_token_usage_bootstrap_signing,
224225
$certificate_authority_data = $kubernetes::params::certificate_authority_data,
225226
$client_certificate_data_controller = $kubernetes::params::client_certificate_data_controller,

manifests/kube_addons.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
if $install_dashboard {
7575
exec { 'Install Kubernetes dashboard':
76-
command => 'kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.6.3/src/deploy/kubernetes-dashboard.yaml',
76+
command => 'kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml',
7777
onlyif => 'kubectl get nodes',
7878
unless => 'kubectl -n kube-system get pods | grep kubernetes-dashboard',
7979
}

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
$bootstrap_token_id = undef
3232
$bootstrap_token_secret = undef
3333
$bootstrap_token_usage_bootstrap_authentication = undef
34+
$bootstrap_token_expiration = undef
3435
$bootstrap_token_usage_bootstrap_signing = undef
3536
$certificate_authority_data = undef
3637
$client_certificate_data_controller = undef

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-kubernetes",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"author": "Puppet",
55
"summary": "The module installs and configures a Kubernetes cluster",
66
"license": "Apache-2.0",

spec/classes/cluster_roles_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
describe 'kubernetes::cluster_roles', :type => :class do
33

44
context 'with bootstrap_controller => true' do
5-
let(:params) { { 'bootstrap_controller' => true } }
5+
let(:params) { { 'bootstrap_controller' => true, 'kubernetes_version' => '1.7.3' } }
66

77
it { should contain_exec('Create kube bootstrap token') }
88
it { should contain_exec('Create kube proxy cluster bindings') }
99
end
10-
end
10+
end

spec/classes/config_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
'bootstrap_token_secret' => 'foo',
3333
'bootstrap_token_usage_bootstrap_authentication' => 'foo',
3434
'bootstrap_token_usage_bootstrap_signing' => 'foo',
35+
'bootstrap_token_expiration' => 'foo',
3536
'certificate_authority_data' => 'foo',
3637
'client_certificate_data_controller' => 'foo',
3738
'client_certificate_data_controller_manager' => 'foo',
@@ -131,4 +132,4 @@
131132
it { should contain_file("/etc/kubernetes/pki/#{kube_pki_file}") }
132133
end
133134
end
134-
end
135+
end

templates/clusterRoleBinding.yaml.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: rbac.authorization.k8s.io/v1beta1
22
kind: ClusterRoleBinding
33
metadata:
4-
name: kube-master:node-proxier
4+
name: <%= @hostname %>:node-proxier
55
roleRef:
66
apiGroup: rbac.authorization.k8s.io
77
kind: ClusterRole

0 commit comments

Comments
 (0)