Skip to content

Commit 8611746

Browse files
Merge pull request #616 from puppetlabs/CONT-358-Syntax_update
(CONT-358) Syntax update
2 parents 8750ffe + 1d5fbb0 commit 8611746

15 files changed

+687
-62
lines changed

.puppet-lint.rc

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
--relative
2-
--no-parameter_documentation-check
32
--no-params_empty_string_assignment-check
4-
--no-file_ensure-check
5-
--no-variables_not_enclosed-check

.sync.yml

-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ Rakefile:
2424
end
2525
end
2626
extra_disabled_lint_checks:
27-
- parameter_documentation
2827
- params_empty_string_assignment
29-
- file_ensure
30-
- variables_not_enclosed
3128

3229
.rubocop.yml:
3330
include_todos:

Rakefile

-3
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ def changelog_future_release
4242
end
4343

4444
PuppetLint.configuration.send('disable_relative')
45-
PuppetLint.configuration.send('disable_parameter_documentation')
4645
PuppetLint.configuration.send('disable_params_empty_string_assignment')
47-
PuppetLint.configuration.send('disable_file_ensure')
48-
PuppetLint.configuration.send('disable_variables_not_enclosed')
4946

5047

5148
if Bundler.rubygems.find_name('github_changelog_generator').any?

manifests/cluster_roles.pp

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
# This class configures the RBAC roles for Kubernetes 1.10.x
2-
1+
# @summary
2+
# This class configures the RBAC roles for Kubernetes 1.10.x
3+
#
4+
# @param controller
5+
# This is a bool that sets the node as a Kubernetes controller. Defaults to false.
6+
# @param worker
7+
# This is a bool that sets a node to a worker. Defaults to false.
8+
# @param node_name
9+
# Sets the name of the node. Defaults to a networking fact.
10+
# @param container_runtime
11+
# Configure whether the container runtime should be configured to use a proxy.
12+
# If set to true, the container runtime will use the http_proxy, https_proxy and no_proxy values.
13+
# Defaults to false
14+
# @param join_discovery_file
15+
# Sets the name of the discovery file. Defaults to undef.
16+
# @param ignore_preflight_errors
17+
# List of errors to ignore pre_flight. Defaults to undef.
18+
# @param env
19+
# The environment passed to kubectl commands.
20+
# Defaults to setting HOME and KUBECONFIG variables
21+
# @param skip_phases
22+
# Allow kubeadm init skip some phases
23+
# Default: none phases skipped
24+
#
325
class kubernetes::cluster_roles (
426
Optional[Boolean] $controller = $kubernetes::controller,
527
Optional[Boolean] $worker = $kubernetes::worker,

manifests/config/kubeadm.pp

+219
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,223 @@
11
# Class kubernetes config kubeadm, populates kubeadm config file with params to bootstrap cluster
2+
# @param config_file
3+
# Path to the configuration file. Defaults to '/etc/kubernetes/config.yaml'
4+
# @param controller_address
5+
# The IP address and Port of the controller that worker node will join. eg 172.17.10.101:6443
6+
# Defaults to undef
7+
# @param dns_domain
8+
# This is a string that sets the dns domain in kubernetes cluster
9+
# Default cluster.local
10+
# @param manage_etcd
11+
# When set to true, etcd will be downloaded from the specified source URL.
12+
# Defaults to true.
13+
# @param delegated_pki
14+
# Set to true if all required X509 certificates will be provided by external means. Setting this to true will ignore all *_crt and *_key including sa.key and sa.pub files.
15+
# Defaults to false
16+
# @param etcd_install_method
17+
# The method on how to install etcd. Can be either wget (using etcd_source) or package (using $etcd_package_name)
18+
# Defaults to wget
19+
# @param kubernetes_version
20+
# The version of Kubernetes containers you want to install.
21+
# ie api server,
22+
# Defaults to 1.10.2
23+
# @param kubernetes_cluster_name
24+
# The name of the cluster, for use when multiple clusters are accessed from the same source
25+
# Only used by Kubernetes 1.12+
26+
# Defaults to "kubernetes"
27+
# @param etcd_ca_key
28+
# This is the ca certificate key data for the etcd cluster. This must be passed as string not as a file.
29+
# Defaults to undef
30+
# @param etcd_ca_crt
31+
# This is the ca certificate data for the etcd cluster. This must be passed as string not as a file.
32+
# Defaults to undef
33+
# @param etcdclient_key
34+
# This is the client certificate key data for the etcd cluster. This must be passed as string not as a file.
35+
# Defaults to undef
36+
# @param etcdclient_crt
37+
# This is the client certificate data for the etcd cluster. This must be passed as string not as a file.
38+
# Defaults to undef
39+
# @param etcdserver_crt
40+
# This is the server certificate data for the etcd cluster . This must be passed as string not as a file.
41+
# Defaults to undef
42+
# @param etcdserver_key
43+
# This is the server certificate key data for the etcd cluster. This must be passed as string not as a file.
44+
# Defaults to undef
45+
# @param etcdpeer_crt
46+
# This is the peer certificate data for the etcd cluster. This must be passed as string not as a file.
47+
# Defaults to undef
48+
# @param etcdpeer_key
49+
# This is the peer certificate key data for the etcd cluster. This must be passed as string not as a file.
50+
# Defaults to undef
51+
# @param etcd_peers
52+
# This will tell etcd how the list of peers to connect to into the cluster.
53+
# An example with hiera would be kubernetes::etcd_peers:
54+
# - 172.17.10.101
55+
# - 172.17.10.102
56+
# - 172.17.10.103
57+
# Defaults to undef
58+
# @param etcd_hostname
59+
# The name of the etcd instance.
60+
# An example with hiera would be kubernetes::etcd_hostname: "%{::fqdn}"
61+
# Defaults to hostname
62+
# @param etcd_data_dir
63+
# Directory, where etcd data is stored.
64+
# Defaults to /var/lib/etcd.
65+
# @param etcd_ip
66+
# The ip address that you want etcd to use for communications.
67+
# An example with hiera would be kubernetes::etcd_ip: "%{networking.ip}"
68+
# Or to pin explicitly to a specific interface kubernetes::etcd_ip: "%{::ipaddress_enp0s8}"
69+
# Defaults to undef
70+
# @param cni_pod_cidr
71+
# The overlay (internal) network range to use.
72+
# Defaults to undef. kube_tool sets this per cni provider.
73+
# @param kube_api_bind_port
74+
# Apiserver bind port
75+
# Defaults to 6443
76+
# @param kube_api_advertise_address
77+
# This is the ip address that the want to api server to expose.
78+
# An example with hiera would be kubernetes::kube_api_advertise_address: "%{networking.ip}"
79+
# Or to pin explicitly to a specific interface kubernetes::kube_api_advertise_address: "%{::ipaddress_enp0s8}"
80+
# defaults to undef
81+
# @param etcd_initial_cluster
82+
# This will tell etcd how many nodes will be in the cluster and is passed as a string.
83+
# An example with hiera would be kubernetes::etcd_initial_cluster: etcd-kube-control-plane=http://172.17.10.101:2380,etcd-kube-replica-control-plane-01=http://172.17.10.210:2380,etcd-kube-replica-control-plane-02=http://172.17.10.220:2380
84+
# Defaults to undef
85+
# @param etcd_discovery_srv
86+
# This will tell etcd to use DNS SRV discovery method. This option is exclusive with `etcd_initial_cluster`, taking precedence
87+
# over it if both are present.
88+
# An example with hiera would be kubernetes::etcd_discovery_srv: etcd-gen.example.org
89+
# Defaults to undef
90+
# @param etcd_initial_cluster_state
91+
# This will tell etcd the initial state of the cluster. Useful for adding a node to the cluster. Allowed values are
92+
# "new" or "existing"
93+
# Defaults to "new"
94+
# @param etcd_compaction_method
95+
# This will tell etcd the compaction method to be used.
96+
# "periodic" or "revision"
97+
# Defaults to "periodic"
98+
# @param etcd_compaction_retention
99+
# This will tell etcd how much retention to be applied. This value can change depending on `etcd_compaction_method`. An integer or time string (i.e.: "5m") can be used in case of "periodic". Only integer allowed in case of "revision"
100+
# Integer or String
101+
# Defaults to 0 (disabled)
102+
# @param api_server_count
103+
# Defaults to undef
104+
# @param etcd_version
105+
# The version of etcd that you would like to use.
106+
# Defaults to 3.2.18
107+
# @param etcd_max_wals
108+
# This will tell etcd how many WAL files to be kept
109+
# Defaults to 5
110+
# @param etcd_max_request_bytes
111+
# This will tell etcd the maximum size of a request in bytes
112+
# Defaults to 1572864
113+
# @param etcd_listen_metric_urls
114+
# The URL(s) to listen on to respond to /metrics and /health for etcd
115+
# Defaults to undef
116+
# @param token
117+
# A string to use when joining nodes to the cluster. Must be in the form of '[a-z0-9]{6}.[a-z0-9]{16}'
118+
# Defaults to undef
119+
# @param ttl_duration
120+
# Availability of the token
121+
# Default to 24h
122+
# @param discovery_token_hash
123+
# A string to validate to the root CA public key when joining a cluster. Created by kubetool
124+
# Defaults to undef
125+
# @param kubernetes_ca_crt
126+
# The clusters ca certificate. Must be passed as a string not a file.
127+
# Defaults to undef
128+
# @param kubernetes_ca_key
129+
# The clusters ca key. Must be passed as a string not a file.
130+
# Defaults to undef
131+
# @param kubernetes_front_proxy_ca_crt
132+
# The clusters front-proxy ca certificate. Must be passed as a string not a file.
133+
# Defaults to undef
134+
# @param kubernetes_front_proxy_ca_key
135+
# The clusters front-proxy ca key. Must be passed as a string not a file.
136+
# Defaults to undef
137+
# @param container_runtime
138+
# This is the runtime that the Kubernetes cluster will use.
139+
# It can only be set to "cri_containerd" or "docker"
140+
# Defaults to cri_containerd
141+
# @param sa_pub
142+
# The service account public key. Must be passed as cert not a file.
143+
# Defaults to undef
144+
# @param sa_key
145+
# The service account key. Must be passed as string not a file.
146+
# Defaults to undef
147+
# @param apiserver_cert_extra_sans
148+
# A string array of Subhect Alternative Names for the api server certificates.
149+
# Defaults to []
150+
# @param apiserver_extra_arguments
151+
# A string array of extra arguments to be passed to the api server.
152+
# Defaults to []
153+
# @param controllermanager_extra_arguments
154+
# A string array of extra arguments to be passed to the controller manager.
155+
# Defaults to []
156+
# @param scheduler_extra_arguments
157+
# A string array of extra arguments to be passed to scheduler.
158+
# Defaults to []
159+
# @param kubelet_extra_arguments
160+
# A string array to be appended to kubeletExtraArgs in the Kubelet's nodeRegistration configuration applied to both control planes and nodes.
161+
# Use this for critical Kubelet settings such as `pod-infra-container-image` which may be problematic to configure via kubelet_extra_config
162+
# Defaults to []
163+
# @param service_cidr
164+
# The IP assdress range for service VIPs
165+
# Defaults to 10.96.0.0/12
166+
# @param node_name
167+
# Name of the node. Defaults to a fact
168+
# @param cloud_provider
169+
# The name of the cloud provider of the cloud provider configured in /etc/kubernetes/cloud-config
170+
# Note: this file is not managed within this module and must be present before bootstrapping the kubernetes controller
171+
# Defaults to undef
172+
# @param cloud_config
173+
# The file location of the cloud config to be used by cloud_provider [*For use with v1.12 and above*]
174+
# Note: this file is not managed within this module and must be present before bootstrapping the kubernetes controller
175+
# Defaults to undef
176+
# @param apiserver_extra_volumes
177+
# A hash of extra volume mounts mounted on the api server.
178+
# Defaults to {}
179+
# @param controllermanager_extra_volumes
180+
# A hash of extra volume mounts mounted on the controller manager.
181+
# Defaults to []
182+
# @param kubeadm_extra_config
183+
# A hash containing extra configuration data to be serialised with `to_yaml` and appended to the config.yaml file used by kubeadm.
184+
# Defaults to {}
185+
# @param kubelet_extra_config
186+
# A hash containing extra configuration data to be serialised with `to_yaml` and appended to Kubelet configuration file for the cluster.
187+
# Requires DynamicKubeletConfig.
188+
# Defaults to {}
189+
# @param image_repository
190+
# The container registry to pull control plane images from
191+
# Defaults to k8s.gcr.io
192+
# @param cgroup_driver
193+
# The cgroup driver to be used.
194+
# Defaults to 'systemd' on EL and 'cgroupfs' otherwise
195+
# @param proxy_mode
196+
# The mode for kubeproxy to run. It should be one of: "" (default), "userspace", "kernelspace", "iptables", or "ipvs".
197+
# Defaults to ""
198+
# @param metrics_bind_address
199+
# Set the metricsBindAddress (to allow prometheus)
200+
# Default to 127.0.0.1
201+
# @param conntrack_max_per_core
202+
# Maximum number of NAT connections to track per CPU core.
203+
# Set to 0 to leave the limit as-is and ignore conntrack_min.
204+
# Default to 32768
205+
# @param conntrack_min
206+
# Minimum number of conntrack entries to allocate, regardless of conntrack-max-per-core.
207+
# Set conntrack_max_per_core to 0 to leave the limit as-is
208+
# Default to 131072
209+
# @param conntrack_tcp_wait_timeout
210+
# NAT timeout for TCP connections in the CLOSE_WAIT state.
211+
# Default to 1h0m0s
212+
# @param conntrack_tcp_stablished_timeout
213+
# Idle timeout for established TCP connections (0 to leave as-is).
214+
# Default to 24h0m0s
215+
# @param feature_gates
216+
# Feature gate hash to be added to kubeadm configuration
217+
# Example:
218+
# {'RootlessControlPlane' => true}
219+
# Default: undefined, no feature gates
220+
#
2221
class kubernetes::config::kubeadm (
3222
String $config_file = $kubernetes::config_file,
4223
String $controller_address = $kubernetes::controller_address,

manifests/config/worker.pp

+68
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,72 @@
11
# Class kubernetes config_worker, populates worker config files with joinconfig
2+
# @param node_name
3+
# Name of the node. Defaults to a fact
4+
# @param config_file
5+
# Path to the configuration file. Defaults to '/etc/kubernetes/config.yaml'
6+
# @param kubernetes_version
7+
# The version of Kubernetes containers you want to install.
8+
# ie api server,
9+
# Defaults to 1.10.2
10+
# @param kubernetes_cluster_name
11+
# The name of the cluster, for use when multiple clusters are accessed from the same source
12+
# Only used by Kubernetes 1.12+
13+
# Defaults to "kubernetes"
14+
# @param controller_address
15+
# The IP address and Port of the controller that worker node will join. eg 172.17.10.101:6443
16+
# Defaults to undef
17+
# @param discovery_token_hash
18+
# A string to validate to the root CA public key when joining a cluster. Created by kubetool
19+
# Defaults to undef
20+
# @param container_runtime
21+
# This is the runtime that the Kubernetes cluster will use.
22+
# It can only be set to "cri_containerd" or "docker"
23+
# Defaults to cri_containerd
24+
# @param discovery_token
25+
# A string to validate to the root CA public key when joining a cluster. Created by kubetool
26+
# Defaults to undef
27+
# @param tls_bootstrap_token
28+
# A string to validate to the root CA public key when joining a cluster. Created by kubetool
29+
# Defaults to undef
30+
# @param token
31+
# A string to validate to the root CA public key when joining a cluster. Created by kubetool
32+
# Defaults to undef
33+
# @param discovery_file
34+
# Defaults to undef
35+
# @param feature_gates
36+
# Defaults to undef
37+
# @param cloud_provider
38+
# The name of the cloud provider of the cloud provider configured in /etc/kubernetes/cloud-config
39+
# Note: this file is not managed within this module and must be present before bootstrapping the kubernetes controller
40+
# Defaults to undef
41+
# @param cloud_config
42+
# The file location of the cloud config to be used by cloud_provider [*For use with v1.12 and above*]
43+
# Note: this file is not managed within this module and must be present before bootstrapping the kubernetes controller
44+
# Defaults to undef
45+
# @param node_extra_taints
46+
# Additional taints for node.
47+
# Example:
48+
# [{'key' => 'dedicated','value' => 'NewNode','effect' => 'NoSchedule', 'operator' => 'Equal'}]
49+
# Defaults to undef
50+
# @param kubelet_extra_arguments
51+
# A string array to be appended to kubeletExtraArgs in the Kubelet's nodeRegistration configuration applied to both control planes and nodes.
52+
# Use this for critical Kubelet settings such as `pod-infra-container-image` which may be problematic to configure via kubelet_extra_config
53+
# Defaults to []
54+
# @param kubelet_extra_config
55+
# A hash containing extra configuration data to be serialised with `to_yaml` and appended to Kubelet configuration file for the cluster.
56+
# Requires DynamicKubeletConfig.
57+
# Defaults to {}
58+
# @param ignore_preflight_errors
59+
# Defaults to undef
60+
# @param skip_ca_verification
61+
# Defaults to false
62+
# @param cgroup_driver
63+
# The cgroup driver to be used.
64+
# Defaults to 'systemd' on EL and 'cgroupfs' otherwise
65+
# @param skip_phases_join
66+
# Allow kubeadm join to skip some phases
67+
# Only works with Kubernetes 1.22+
68+
# Default: no phases skipped
69+
#
270
class kubernetes::config::worker (
371
Stdlib::Fqdn $node_name = $kubernetes::node_name,
472
String $config_file = $kubernetes::config_file,

0 commit comments

Comments
 (0)