Skip to content

Commit 7ba2da7

Browse files
sheenaajayscotty-c
authored andcommitted
(dashboard deploy for each version) (#26)
1 parent 379e05d commit 7ba2da7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

manifests/kube_addons.pp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
$bootstrap_controller = $kubernetes::bootstrap_controller,
55
$cni_network_provider = $kubernetes::cni_network_provider,
66
$install_dashboard = $kubernetes::install_dashboard,
7-
7+
$kubernetes_version = $kubernetes::kubernetes_version
88
){
99

1010
if $bootstrap_controller {
@@ -71,12 +71,19 @@
7171
require => Exec['Create kube dns service account'],
7272
}
7373

74-
if $install_dashboard {
74+
if $install_dashboard and $kubernetes_version =~ /1[.]8[.]\d/ {
7575
exec { 'Install Kubernetes dashboard':
7676
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
}
8080
}
81+
if $install_dashboard and $kubernetes_version =~ /1[.](6|7)[.]\d/ {
82+
exec { 'Install Kubernetes dashboard':
83+
command => 'kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.6.3/src/deploy/kubernetes-dashboard.yaml',
84+
onlyif => 'kubectl get nodes',
85+
unless => 'kubectl -n kube-system get pods | grep kubernetes-dashboard',
86+
}
87+
}
8188
}
8289
}

spec/classes/kube_addons_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
'bootstrap_controller' => true,
1919
'cni_network_provider' => 'https://foo.test',
2020
'install_dashboard' => false,
21+
'kubernetes_version' => '1.7.3'
2122
}
2223
end
2324

@@ -35,6 +36,7 @@
3536
'bootstrap_controller' => true,
3637
'cni_network_provider' => 'https://foo.test',
3738
'install_dashboard' => true,
39+
'kubernetes_version' => '1.7.3'
3840
}
3941
end
4042

0 commit comments

Comments
 (0)