kuby-kube-db 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/kuby-kube-db.gemspec +1 -1
- data/lib/kuby/kube-db/plugin.rb +31 -6
- data/lib/kuby/kube-db/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 410cd6089e3ecf3de0324d3969ad8afa36a3787f962c664957fcad5d90629d58
|
4
|
+
data.tar.gz: ed650147e64258ebf60b350168ce9df7e389393134cf554c6d3893dcafafc26d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05cd94f38afede349d7c63a08eac7d96435a924a5d912e97bad63e869660d71c9b87a84c1c7941c30eadb7107695c8c61342909b11f0d6560d4c6ee193a82181
|
7
|
+
data.tar.gz: e8b8a3a13b4023a2f237096e14773e60c3d0e75493c9dcaaad2bac3df383e4c2a1eee451e1076ea94cad477a9ac918eccd681ed470448762e7fcd9bccdcfbf07
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.6.0
|
2
|
+
* Wait for API resources to become available.
|
3
|
+
- Krane queries k8s for API resources which causes kubectl to exit with a non-zero status code if KubeDB's operator isn't finished spinning up.
|
4
|
+
|
1
5
|
## 0.5.0
|
2
6
|
* Conform to new plugin architecture.
|
3
7
|
* Accept `environment` instead of `definition` instances.
|
data/kuby-kube-db.gemspec
CHANGED
data/lib/kuby/kube-db/plugin.rb
CHANGED
@@ -6,6 +6,7 @@ module Kuby
|
|
6
6
|
module KubeDB
|
7
7
|
class KubeDBError < StandardError; end
|
8
8
|
class OperatorDeployError < KubeDBError; end
|
9
|
+
class APIResourcesError < KubeDBError; end
|
9
10
|
|
10
11
|
class Plugin < ::Kuby::Plugin
|
11
12
|
NAMESPACE = 'kube-system'.freeze
|
@@ -16,8 +17,8 @@ module Kuby
|
|
16
17
|
CATALOG_RELEASE_NAME = 'kubedb-catalog'.freeze
|
17
18
|
OPERATOR_CHART_NAME = 'appscode/kubedb'.freeze
|
18
19
|
CATALOG_CHART_NAME = 'appscode/kubedb-catalog'.freeze
|
19
|
-
|
20
|
-
|
20
|
+
WAIT_INTERVAL = 5 # seconds
|
21
|
+
WAIT_MAX = 120 # seconds
|
21
22
|
|
22
23
|
OPERATOR_PARAMS = {
|
23
24
|
'apiserver.enableValidatingWebhook' => 'true',
|
@@ -40,6 +41,10 @@ module Kuby
|
|
40
41
|
Kuby.logger.info('Waiting for kubedb operator deployment')
|
41
42
|
end
|
42
43
|
|
44
|
+
wait_for_api_resources do
|
45
|
+
Kuby.logger.info('Waiting for API resources to become available')
|
46
|
+
end
|
47
|
+
|
43
48
|
Kuby.logger.info('Deploying kubedb catalog')
|
44
49
|
catalog_deployed? ? upgrade_catalog : install_catalog
|
45
50
|
|
@@ -88,15 +93,35 @@ module Kuby
|
|
88
93
|
loop do
|
89
94
|
break if operator_ready?
|
90
95
|
|
91
|
-
if time_elapsed >=
|
96
|
+
if time_elapsed >= WAIT_MAX
|
92
97
|
raise OperatorDeployError, 'timeout waiting for operator to start. '\
|
93
98
|
"Waited #{time_elapsed}s."
|
94
99
|
end
|
95
100
|
|
96
101
|
yield
|
97
102
|
|
98
|
-
sleep
|
99
|
-
time_elapsed +=
|
103
|
+
sleep WAIT_INTERVAL
|
104
|
+
time_elapsed += WAIT_INTERVAL
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def wait_for_api_resources
|
109
|
+
time_elapsed = 0
|
110
|
+
|
111
|
+
loop do
|
112
|
+
begin
|
113
|
+
if time_elapsed >= WAIT_MAX
|
114
|
+
raise APIResourcesError, 'timeout waiting for API resources to '\
|
115
|
+
"become available. Waited #{time_elapsed}s."
|
116
|
+
end
|
117
|
+
|
118
|
+
kubernetes_cli.api_resources
|
119
|
+
break
|
120
|
+
rescue KubernetesCLI::KubernetesError
|
121
|
+
yield
|
122
|
+
sleep WAIT_INTERVAL
|
123
|
+
time_elapsed += WAIT_INTERVAL
|
124
|
+
end
|
100
125
|
end
|
101
126
|
end
|
102
127
|
|
@@ -168,7 +193,7 @@ module Kuby
|
|
168
193
|
end
|
169
194
|
|
170
195
|
def helm_cli
|
171
|
-
|
196
|
+
provider.helm_cli
|
172
197
|
end
|
173
198
|
|
174
199
|
def kubernetes_cli
|
data/lib/kuby/kube-db/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuby-kube-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: helm-cli
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: kube-dsl
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|