File tree 6 files changed +26
-12
lines changed
6 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -732,6 +732,7 @@ The following parameters are available in the `k8s::node` class:
732
732
* [ ` firewall_type ` ] ( #-k8s--node--firewall_type )
733
733
* [ ` manage_crictl ` ] ( #-k8s--node--manage_crictl )
734
734
* [ ` manage_firewall ` ] ( #-k8s--node--manage_firewall )
735
+ * [ ` manage_packages ` ] ( #-k8s--node--manage_packages )
735
736
* [ ` manage_kernel_modules ` ] ( #-k8s--node--manage_kernel_modules )
736
737
* [ ` manage_kubelet ` ] ( #-k8s--node--manage_kubelet )
737
738
* [ ` manage_proxy ` ] ( #-k8s--node--manage_proxy )
@@ -803,6 +804,14 @@ whether to manage firewall or not
803
804
804
805
Default value: ` $k8s::manage_firewall `
805
806
807
+ ##### <a name =" -k8s--node--manage_packages " ></a >` manage_packages `
808
+
809
+ Data type: ` Boolean `
810
+
811
+ whether to manage packages
812
+
813
+ Default value: ` $k8s::manage_packages `
814
+
806
815
##### <a name =" -k8s--node--manage_kernel_modules " ></a >` manage_kernel_modules `
807
816
808
817
Data type: ` Boolean `
Original file line number Diff line number Diff line change 136
136
}
137
137
}
138
138
139
- if $active and $packaging != ' container' and !defined (File [" /usr/bin/${name} " ]) {
139
+ if $active and $packaging != ' container' and $_packaging != ' manual ' and !defined (File [" /usr/bin/${name} " ]) {
140
140
if $packaging == ' package' {
141
141
file { "/usr/bin/${name}" :
142
142
ensure => $ensure ,
Original file line number Diff line number Diff line change 69
69
' /usr/libexec/kubernetes' : ;
70
70
' /var/lib/kubelet' : ;
71
71
' /var/lib/kubelet/pki' : ;
72
-
73
- ' /usr/share/containers/' : ;
74
- ' /usr/share/containers/oci/' : ;
75
- ' /usr/share/containers/oci/hooks.d' : ;
76
72
}
77
73
}
Original file line number Diff line number Diff line change 86
86
name => $pkg ,
87
87
}
88
88
89
+ file {
90
+ default:
91
+ ensure => directory ;
92
+
93
+ ' /usr/share/containers/' : ;
94
+ ' /usr/share/containers/oci/' : ;
95
+ ' /usr/share/containers/oci/hooks.d' : ;
96
+ }
97
+
89
98
if $manage_repo {
90
99
require k8s::repo
91
100
}
Original file line number Diff line number Diff line change 7
7
# @param firewall_type define the type of firewall to use
8
8
# @param manage_crictl toggle to install crictl
9
9
# @param manage_firewall whether to manage firewall or not
10
+ # @param manage_packages whether to manage packages
10
11
# @param manage_kernel_modules whether to load kernel modules or not
11
12
# @param manage_kubelet whether to manage kublet or not
12
13
# @param manage_proxy whether to manage kube-proxy or not
33
34
Boolean $manage_proxy = $k8s::manage_kube_proxy == ' on-node' ,
34
35
Boolean $manage_crictl = false ,
35
36
Boolean $manage_firewall = $k8s::manage_firewall,
37
+ Boolean $manage_packages = $k8s::manage_packages,
36
38
Boolean $manage_kernel_modules = $k8s::manage_kernel_modules,
37
39
Boolean $manage_sysctl_settings = $k8s::manage_sysctl_settings,
38
40
Boolean $manage_simple_cni = false ,
Original file line number Diff line number Diff line change 71
71
case $auth {
72
72
' bootstrap' : {
73
73
$_ca_cert = pick($ca_cert , ' /var/lib/kubelet/pki/ca.pem' )
74
- ensure_packages([' jq' ])
75
74
if !defined (K8s::Binary[' kubectl' ]) {
76
75
k8s::binary { 'kubectl' :
77
76
ensure => $ensure ,
85
84
~> exec { ' Retrieve K8s CA' :
86
85
path => [' /usr/local/bin' ,' /usr/bin' ,' /bin' ],
87
86
command => " kubectl --server='${control_plane_url} ' --username=anonymous --insecure-skip-tls-verify=true \
88
- get --raw /api/v1/namespaces/ kube-system/configmaps/ cluster-info | jq .data.ca -r > '${_ca_cert}'" ,
87
+ get --namespace= kube-system configmap cluster-info --output=jsonpath={ .data.ca} > '${_ca_cert}'" ,
89
88
creates => $_ca_cert,
90
- require => [
91
- K8s::Binary[' kubectl' ],
92
- Package[' jq' ],
93
- ],
89
+ require => K8s::Binary[' kubectl' ],
94
90
}
95
91
-> kubeconfig { $_bootstrap_kubeconfig:
96
92
ensure => $ensure ,
280
276
}
281
277
}
282
278
283
- Class[' k8s::install::container_runtime' ] -> Service[' kubelet' ]
279
+ if defined (Class[' k8s::install::container_runtime' ]) {
280
+ Class[' k8s::install::container_runtime' ] -> Service[' kubelet' ]
281
+ }
284
282
Package <| title == ' containernetworking-plugins' |> -> Service[' kubelet' ]
285
283
286
284
if $manage_firewall {
You can’t perform that action at this time.
0 commit comments