Skip to content

Commit 788db6d

Browse files
admontscotty-c
authored andcommitted
Pin versions of debian packages (#86)
* Fix syntax a bit * Change and update documentation a bit * Rename `cni_version` to `cni_package_version` same way as `kubernetes_package_version`. * Parametrize cni package name. * Parametrize docker package name. * Fix `docker_package_name` and `cni_package_name` variables. * Update unit test because of parametrized docker cni package names. * Update documentation and unit test because of `cni_package_version` change. * Parametrize version of docker package to install and pin package for Debian/Ubuntu. * Updated documentation * Rename `cni_package_version` variable back to `cni_version` for back compatibility. * `$docker_package_version` name typo fix * Rename `docker_package_pin` variable to `package_pin`. * Pin kube* packages * Pin kubernetes-cni package * Cover with unit tests * Fix `docker_version`
1 parent e35cfe0 commit 788db6d

File tree

5 files changed

+189
-102
lines changed

5 files changed

+189
-102
lines changed

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,32 @@ The version the Kubernetes OS packages to install, such as kubectl and kubelet.
142142

143143
Defaults to `1.9.2`.
144144

145+
#### `docker_package_name`
146+
147+
The name of the docker package you would like to install.
148+
149+
Defaults to `docker-engine`.
150+
151+
#### `docker_package_version`
152+
153+
The version of the docker package you would like to install.
154+
155+
Defaults depends on operating system.
156+
- Red Hat: `1.12.6`
157+
- Debian: `1.12.0`
158+
159+
#### `package_pin`
160+
161+
If you would like to pin versions of Docker and Kubernetes packages. Works only for Debian/Ubuntu.
162+
163+
Defaults to `true`.
164+
165+
#### `cni_package_name`
166+
167+
The name of the cni package you would like to install.
168+
169+
Defaults to `kubernetes-cni`.
170+
145171
#### `cni_version`
146172

147173
The version of the cni package to install.
@@ -438,13 +464,6 @@ Allows the user to override the label of a node.
438464

439465
Defaults for hostname
440466

441-
#### `docker_version`
442-
443-
This is the version of the docker runtime that you want to install.
444-
445-
Defaults to `1.12.6` on RedHat
446-
Defaults to `1.12.0-0~xenial` on Debian
447-
448467
#### `kube_dns_version`
449468

450469
The version of kube DNS you would like to install

manifests/init.pp

Lines changed: 103 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -6,164 +6,183 @@
66
# Parameters
77
# ----------
88
# [*kubernetes_version*]
9-
# The version of Kubernetes containers you want to install.
10-
# ie api server,
11-
# Defaults to 1.9.2
9+
# The version of Kubernetes containers you want to install - i.e. API server.
10+
# Defaults to `1.9.2`.
1211
#
1312
# [*kubernetes_package_version*]
14-
# The version of the packages the Kubernetes os packages to install
15-
# ie kubectl and kubelet
16-
# Defaults to 1.9.2
13+
# The version of the packages the Kubernetes os packages to install - i.e.
14+
# `kubectl` and `kubelet`.
15+
# Defaults to `1.9.2`.
1716
#
18-
# [*container_runtime]
17+
# [*container_runtime*]
1918
# This is the runtime that the Kubernetes cluster will use.
20-
# It can only be set to "cri_containerd" or "docker"
21-
# Defaults to docker
19+
# It can only be set to `cri_containerd` or `docker`.
20+
# Defaults to `docker`.
2221
#
23-
# [*docker_version]
24-
# This is the version of the docker runtime that you want to install.
25-
# Defaults to 1.12.6 on RedHat
26-
# Defaults to 1.12.0-0~xenial on Debian
22+
# [*docker_package_name*]
23+
# The name of the docker package you would like to install.
24+
# Defaults to `docker-engine`.
25+
#
26+
# [*docker_package_version*]
27+
# The version of the docker package you would like to install.
28+
# Defaults depends on operating system.
29+
# - Red Hat: `1.12.6`
30+
# - Debian: `1.12.0`
31+
#
32+
# [*package_pin*]
33+
# If you would like to pin versions of Docker and Kubernetes packages.
34+
# Works only for Debian/Ubuntu.
35+
# Defaults to `true`.
36+
#
37+
# [*cni_package_name*]
38+
# The name of the cni package you would like to install.
39+
# Defaults to `kubernetes-cni`.
2740
#
2841
# [*cni_version*]
29-
# The version of the cni package you would like to install
30-
# Defaults to 0.6.0
42+
# The version of the cni package you would like to install.
43+
# Defaults to `0.6.0`.
3144
#
32-
# [*cni_provider]
33-
# The url location for the cni providers yaml. This can only be set to weave or flannel.
34-
# Defaults to undef
45+
# [*cni_provider*]
46+
# The url location for the cni providers yaml. This can only be set to `weave`
47+
# or `flannel`.
48+
# Defaults to `undef`.
3549
#
3650
# [*kube_dns_version*]
37-
# The version of kube DNS you would like to install
38-
# Defaults to 1.14.2
51+
# The version of kube DNS you would like to install.
52+
# Defaults to `1.14.2`.
3953
#
4054
# [*controller*]
41-
# This is a bool that sets the node as a Kubernetes controller
42-
# Defaults to false
55+
# This is a bool that sets the node as a Kubernetes controller.
56+
# Defaults to `false`.
4357
#
4458
# [*bootstrap_controller*]
45-
# This sets the node to use as the bootstrap controller
46-
# The bootstrap controller is only used for initial cluster creation
47-
# Defaults to false
59+
# This sets the node to use as the bootstrap controller.
60+
# The bootstrap controller is only used for initial cluster creation.
61+
# Defaults to `false`.
4862
#
4963
# [*bootstrap_controller_ip*]
5064
# The ip address of the bootstrap controller.
51-
# defaults to undef
65+
# Defaults to `undef`.
5266
#
5367
# [*worker*]
5468
# This is a bool that sets a node to a worker.
55-
# defaults to undef
69+
# Defaults to `undef`.
5670
#
5771
# [*kube_api_advertise_address*]
5872
# This is the ip address that the want to api server to expose.
59-
# An example with hiera would be kubernetes::kube_api_advertise_address: "%{::ipaddress_enp0s8}"
60-
# defaults to undef
73+
# An example with hiera would be `kubernetes::kube_api_advertise_address: "%{::ipaddress_enp0s8}"`.
74+
# Defaults to `undef`.
75+
#
76+
# [*$apiserver_extra_arguments*]
77+
# This is an array to pass extra configuration to the Kubernetes API.
78+
# Defaults to `[]`.
6179
#
6280
# [*etcd_version*]
63-
# The version of etcd that you would like to use.
64-
# Defaults to 3.0.17
81+
# The version of `etcd` that you would like to use.
82+
# Defaults to `3.0.17`.
6583
#
6684
# [*etcd_ip*]
67-
# The ip address that you want etcd to use for communications.
68-
# An example with hiera would be kubernetes::etcd_ip: "%{::ipaddress_enp0s8}"
69-
# Defaults to undef
85+
# The ip address that you want `etcd` to use for communications.
86+
# An example with hiera would be `kubernetes::etcd_ip: "%{::ipaddress_enp0s8}"`.
87+
# Defaults to `undef`.
7088
#
7189
# [*etcd_initial_cluster*]
72-
# This will tell etcd how many nodes will be in the cluster and is passed as a string.
73-
# An example with hiera would be kubernetes::etcd_initial_cluster: etcd-kube-master=http://172.17.10.101:2380,etcd-kube-replica-master-01=http://172.17.10.210:2380,etcd-kube-replica-master-02=http://172.17.10.220:2380
74-
# Defaults to undef
90+
# This will tell `etcd` how many nodes will be in the cluster and is passed as a string.
91+
# An example with hiera would be `kubernetes::etcd_initial_cluster: etcd-kube-master=http://172.17.10.101:2380,etcd-kube-replica-master-01=http://172.17.10.210:2380,etcd-kube-replica-master-02=http://172.17.10.220:2380`.
92+
# Defaults to `undef`.
7593
#
7694
# [*bootstrap_token*]
7795
# This is the token Kubernetes will use to start components.
78-
# For more information around bootstrap tokens please see https://kubernetes.io/docs/admin/bootstrap-tokens/
79-
# Defaults to undef
96+
# For more information around bootstrap tokens please see https://kubernetes.io/docs/admin/bootstrap-tokens/.
97+
# Defaults to `undef`.
8098
#
8199
# [*bootstrap_token_name*]
82100
# This is the name of the bootstrap token.
83-
# An example with hiera would be kubernetes::bootstrap_token_name: bootstrap-token-95e1e0
84-
# Defaults to undef
101+
# An example with hiera would be `kubernetes::bootstrap_token_name: bootstrap-token-95e1e0`.
102+
# Defaults to `undef`.
85103
#
86104
# [*bootstrap_token_description*]
87105
# The boot strap token description, this must be base64 encoded.
88106
# lint:ignore:140chars
89-
# An example with hierawould be kubernetes::bootstrap_token_description: VGhlIGRlZmF1bHQgYm9vdHN0cmFwIHRva2VuIHBhc3NlZCB0byB0aGUgY2x1c3RlciB2aWEgUHVwcGV0Lg==
107+
# An example with hierawould be `kubernetes::bootstrap_token_description: VGhlIGRlZmF1bHQgYm9vdHN0cmFwIHRva2VuIHBhc3NlZCB0byB0aGUgY2x1c3RlciB2aWEgUHVwcGV0Lg==`.
90108
# lint:endignore
109+
# Defaults to `undef`.
91110
#
92111
# [*bootstrap_token_id*]
93112
# This is the id the cluster will use to point to the token, this must be base64 encoded.
94-
# An example with hiera would be kubernetes::bootstrap_token_id: OTVlMWUwDQo=
95-
# Defaults to undef
113+
# An example with hiera would be `kubernetes::bootstrap_token_id: OTVlMWUwDQo=`.
114+
# Defaults to `undef`.
96115
#
97116
# [*bootstrap_token_secret*]
98117
# This is the secret to validate the boot strap token, this must be base64 encoded.
99-
# An example with hiera would be kubernetes::bootstrap_token_secret: OTVlMWUwLmFlMmUzYjkwYTdmYjlkMzYNCg==
100-
# Defaults to undef
118+
# An example with hiera would be `kubernetes::bootstrap_token_secret: OTVlMWUwLmFlMmUzYjkwYTdmYjlkMzYNCg==`.
119+
# Defaults to `undef`.
101120
#
102121
# [*bootstrap_token_usage_bootstrap_authentication*]
103-
# This is the bool to use the boot strap token, this must be base64 encoded. (true = dHJ1ZQ==)
104-
# An example with hiera would be kubernetes::bootstrap_token_usage_bootstrap_authentication: dHJ1ZQ==
105-
# Defaults to undef
122+
# This is the bool to use the boot strap token, this must be base64 encoded. (`true` = `dHJ1ZQ==`)
123+
# An example with hiera would be `kubernetes::bootstrap_token_usage_bootstrap_authentication: dHJ1ZQ==`.
124+
# Defaults to `undef`.
106125
#
107126
# [*bootstrap_token_usage_bootstrap_signing*]
108-
# This is a bool to use boot trap signing, , this must be base64 encoded. (true = dHJ1ZQ==)
109-
# An example with hiera would be kubernetes::bootstrap_token_usage_bootstrap_signing: dHJ1ZQ==
110-
# Defaults to undef
127+
# This is a bool to use boot trap signing, this must be base64 encoded. (`true` = `dHJ1ZQ==`)
128+
# An example with hiera would be `kubernetes::bootstrap_token_usage_bootstrap_signing: dHJ1ZQ==`.
129+
# Defaults to `undef`.
111130
#
112131
# [*certificate_authority_data*]
113132
# This is the ca certificate data for the cluster. This must be passed as string not as a file.
114-
# Defaults to undef
133+
# Defaults to `undef`.
115134
#
116135
# [*client_certificate_data_controller*]
117136
# This is the client certificate data for the controllers. This must be passed as string not as a file.
118-
# Defaults to undef
137+
# Defaults to `undef`.
119138
#
120139
# [*client_certificate_data_controller_manager*]
121140
# This is the client certificate data for the controller manager. This must be passed as string not as a file.
122-
# Defaults to undef
141+
# Defaults to `undef`.
123142
#
124143
# [*client_certificate_data_scheduler*]
125144
# This is the client certificate data for the scheduler. This must be passed as string not as a file.
126-
# Defaults to undef
145+
# Defaults to `undef`.
127146
#
128147
# [*client_certificate_data_worker*]
129148
# This is the client certificate data for the kubernetes workers. This must be passed as string not as a file.
130-
# Defaults to undef
149+
# Defaults to `undef`.
131150
#
132151
# [*client_key_data_controller*]
133152
# This is the client certificate key for the controllers. This must be passed as string not as a file.
134-
# Defaults to undef
153+
# Defaults to `undef`.
135154
#
136155
# [*client_key_data_controller_manager*]
137156
# This is the client certificate key for the controller manager. This must be passed as string not as a file.
138-
# Defaults to undef
157+
# Defaults to `undef`.
139158
#
140159
# [*client_key_data_scheduler*]
141160
# This is the client certificate key for the scheduler. This must be passed as string not as a file.
142-
# Defaults to undef
161+
# Defaults to `undef`.
143162
#
144163
# [*client_key_data_worker*]
145164
# This is the client certificate key for the kubernetes workers. This must be passed as string not as a file.
146-
# Defaults to undef
165+
# Defaults to `undef`.
147166
#
148167
# [*apiserver_kubelet_client_crt*]
149168
# The kubelet api server certificate. Must be passed as cert not a file.
150-
# Defaults to undef
169+
# Defaults to `undef`.
151170
#
152171
# [*apiserver_kubelet_client_key*]
153172
# The kubelet api server key. Must be passed as cert not a file.
154-
# Defaults to undef
173+
# Defaults to `undef`.
155174
#
156175
# [*apiserver_crt*]
157176
# The api server certificate. Must be passed as cert not a file.
158-
# Defaults to undef
177+
# Defaults to `undef`.
159178
#
160179
# [*apiserver_key*]
161180
# The api server key. Must be passed as cert not a file.
162-
# Defaults to undef
181+
# Defaults to `undef`.
163182
#
164183
# [*apiserver_extra_arguments*]
165184
# A string array of extra arguments to be passed to the api server.
166-
# Defaults to []
185+
# Defaults to `[]`.
167186
#
168187
# [*apiserver_extra_volumes*]
169188
# An array of objects describing additional volumes and volumeMounts to be configured in the api server pod. Each
@@ -172,40 +191,41 @@
172191
#
173192
# [*ca_crt*]
174193
# The clusters ca certificate. Must be passed as cert not a file.
175-
# Defaults to undef
194+
# Defaults to `undef`.
176195
#
177196
# [*ca_key*]
178197
# The clusters ca key. Must be passed as cert not a file.
179-
# Defaults to undef
198+
# Defaults to `undef`.
180199
#
181200
# [*front_proxy_ca_crt*]
182201
# The front proxy ca certificate. Must be passed as cert not a file.
183-
# Defaults to undef
202+
# Defaults to `undef`.
184203
#
185204
# [*front_proxy_ca_key*]
186205
# The front proxy ca key. Must be passed as cert not a file.
187-
# Defaults to undef
206+
# Defaults to `undef`.
188207
#
189208
# [*front_proxy_client_crt*]
190209
# The front proxy client certificate. Must be passed as cert not a file.
191-
# Defaults to undef
210+
# Defaults to `undef`.
192211
#
193212
# [*front_proxy_client_key*]
194213
# The front proxy client key. Must be passed as cert not a file.
195-
# Defaults to undef
214+
# Defaults to `undef`.
196215
#
197216
# [*sa_key*]
198217
# The service account key. Must be passed as cert not a file.
199-
# Defaults to undef
218+
# Defaults to `undef`.
200219
#
201220
# [*sa_pub*]
202-
# The service account public key. Must be passed as cert not a file.
203-
# Defaults to undef
221+
# The service account public key. Must be passed as cert not a file.
222+
# Defaults to `undef`.
204223
#
205224
# [*cni_network_provider*]
206-
# This is the url that kubectl can find the networking deployment.
207-
# We will support any networking provider that supports cni
208-
# This defaults to https://git.io/weave-kube-1.6
225+
# This is the url that `kubectl` can find the networking deployment - i.e.
226+
# `https://git.io/weave-kube-1.6`.
227+
# We will support any networking provider that supports cni.
228+
# Defaults to `undef`.
209229
#
210230
# [*cni_cluster_cidr*]
211231
# The overlay (internal) network range to use.
@@ -217,7 +237,7 @@
217237
#
218238
# [*install_dashboard*]
219239
# This is a bool that determines if the kubernetes dashboard is installed.
220-
# Defaults to false
240+
# Defaults to `false`.
221241
#
222242
# [*kube_dns_ip*]
223243
# The service IP to use for kube-dns.
@@ -244,7 +264,10 @@
244264
Optional[String] $kubernetes_package_version = $kubernetes::params::kubernetes_package_version,
245265
String $kubernetes_fqdn = $kubernetes::params::kubernetes_fqdn,
246266
String $container_runtime = $kubernetes::params::container_runtime,
247-
Optional[String] $docker_version = $kubernetes::params::docker_version,
267+
Optional[String] $docker_package_name = $kubernetes::params::docker_package_name,
268+
Optional[String] $docker_package_version = $kubernetes::params::docker_package_version,
269+
Optional[Boolean] $package_pin = $kubernetes::params::package_pin,
270+
Optional[String] $cni_package_name = $kubernetes::params::cni_package_name,
248271
Optional[String] $cni_version = $kubernetes::params::cni_version,
249272
Optional[String] $cni_cluster_cidr = $kubernetes::params::cni_cluster_cidr,
250273
Optional[Boolean] $cni_node_cidr = $kubernetes::params::cni_node_cidr,

0 commit comments

Comments
 (0)