File tree 2 files changed +44
-4
lines changed
2 files changed +44
-4
lines changed Original file line number Diff line number Diff line change @@ -1720,6 +1720,38 @@ Default value: `$k8s::etcd_version`
1720
1720
1721
1721
Creates a dummy exec to allow deferring applies until the Kubernetes API server has started
1722
1722
1723
+ #### Parameters
1724
+
1725
+ The following parameters are available in the ` k8s::server::wait_online ` class:
1726
+
1727
+ * [ ` tries ` ] ( #-k8s--server--wait_online--tries )
1728
+ * [ ` try_sleep ` ] ( #-k8s--server--wait_online--try_sleep )
1729
+ * [ ` timeout ` ] ( #-k8s--server--wait_online--timeout )
1730
+
1731
+ ##### <a name =" -k8s--server--wait_online--tries " ></a >` tries `
1732
+
1733
+ Data type: ` Integer `
1734
+
1735
+ Number of retries
1736
+
1737
+ Default value: ` 15 `
1738
+
1739
+ ##### <a name =" -k8s--server--wait_online--try_sleep " ></a >` try_sleep `
1740
+
1741
+ Data type: ` Integer `
1742
+
1743
+ Sleep time in seconds
1744
+
1745
+ Default value: ` 2 `
1746
+
1747
+ ##### <a name =" -k8s--server--wait_online--timeout " ></a >` timeout `
1748
+
1749
+ Data type: ` Integer `
1750
+
1751
+ Execution timeout in seconds (0 to disable)
1752
+
1753
+ Default value: ` 5 `
1754
+
1723
1755
## Defined types
1724
1756
1725
1757
### <a name =" k8s--binary " ></a >` k8s::binary `
Original file line number Diff line number Diff line change 1
1
# @summary Creates a dummy exec to allow deferring applies until the Kubernetes API server has started
2
2
#
3
- class k8s::server::wait_online {
4
- # Wait up to 30 seconds for kube-apiserver to start
3
+ # @param tries Number of retries
4
+ # @param try_sleep Sleep time in seconds
5
+ # @param timeout Execution timeout in seconds (0 to disable)
6
+ class k8s::server::wait_online (
7
+ Integer $tries = 15,
8
+ Integer $timeout = 5,
9
+ Integer $try_sleep = 2,
10
+ ) {
11
+ # Wait up to $tries * ( $timeout + $try_sleep) seconds for kube-apiserver to start
5
12
exec { 'k8s apiserver wait online' :
6
13
command => ' kubectl --kubeconfig /root/.kube/config version' ,
7
14
path => $facts [' path' ],
8
15
refreshonly => true ,
9
- tries => 15,
10
- try_sleep => 2,
16
+ tries => $tries ,
17
+ try_sleep => $try_sleep ,
18
+ timeout => $timeout ,
11
19
}
12
20
13
21
# Require possibly managed components before checking online state
You can’t perform that action at this time.
0 commit comments