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 69
69
case $auth {
70
70
' bootstrap' : {
71
71
$_ca_cert = pick($ca_cert , ' /var/lib/kubelet/pki/ca.pem' )
72
- ensure_packages([' jq' ])
73
72
if !defined (K8s::Binary[' kubectl' ]) {
74
73
k8s::binary { 'kubectl' :
75
74
ensure => $ensure ,
83
82
~> exec { ' Retrieve K8s CA' :
84
83
path => [' /usr/local/bin' ,' /usr/bin' ,' /bin' ],
85
84
command => " kubectl --server='${control_plane_url} ' --username=anonymous --insecure-skip-tls-verify=true \
86
- get --raw /api/v1/namespaces/ kube-system/configmaps/ cluster-info | jq .data.ca -r > '${_ca_cert}'" ,
85
+ get --namespace= kube-system configmap cluster-info --output=jsonpath={ .data.ca} > '${_ca_cert}'" ,
87
86
creates => $_ca_cert,
88
- require => [
89
- K8s::Binary[' kubectl' ],
90
- Package[' jq' ],
91
- ],
87
+ require => K8s::Binary[' kubectl' ],
92
88
}
93
89
-> kubeconfig { $_bootstrap_kubeconfig:
94
90
ensure => $ensure ,
275
271
}
276
272
}
277
273
278
- Class[' k8s::install::container_runtime' ] -> Service[' kubelet' ]
274
+ if defined (Class[' k8s::install::container_runtime' ]) {
275
+ Class[' k8s::install::container_runtime' ] -> Service[' kubelet' ]
276
+ }
279
277
Package <| title == ' containernetworking-plugins' |> -> Service[' kubelet' ]
280
278
281
279
if $manage_firewall {
You can’t perform that action at this time.
0 commit comments