kubernetes-deploy 0.12.6 → 0.12.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ci +1 -1
- data/lib/kubernetes-deploy/kubernetes_resource/memcached.rb +12 -16
- data/lib/kubernetes-deploy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 354e84986f12ef307946408879b5c6d181a273fc
|
4
|
+
data.tar.gz: bc326119695e2d3bdc202d5f34af02b96787c197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09ed8b6ff1a64e0a1e23e2b575bd29ab39e6d16608cb002f44158aaf92761344ead3b0ff0295322d30c2d009e03687af569085212973a228e0f3dcb899da55a9'
|
7
|
+
data.tar.gz: ba9e47d26b21cb351e3b4971f4fa2e1bc4a30ff029b7917e8448171463d6938631341f8d3ea7ab8f5d6eb669a32be844c50ba5f1cc3e41391e3f6b703fb57bce
|
data/bin/ci
CHANGED
@@ -10,7 +10,7 @@ docker run --rm \
|
|
10
10
|
-v "$HOME/.kube":/"$HOME/.kube" \
|
11
11
|
-v "$HOME/.minikube":/"$HOME/.minikube" \
|
12
12
|
-v "$PWD":/usr/src/app \
|
13
|
-
-v "/usr/
|
13
|
+
-v "/usr/bin/minikube/kubectl":"/usr/bin/kubectl" \
|
14
14
|
-e CI=1 \
|
15
15
|
-e CODECOV_TOKEN=$CODECOV_TOKEN \
|
16
16
|
-e COVERAGE=1 \
|
@@ -2,16 +2,16 @@
|
|
2
2
|
module KubernetesDeploy
|
3
3
|
class Memcached < KubernetesResource
|
4
4
|
TIMEOUT = 5.minutes
|
5
|
-
|
5
|
+
CONFIGMAP_NAME = "memcached-url"
|
6
6
|
|
7
7
|
def sync
|
8
8
|
_, _err, st = kubectl.run("get", type, @name)
|
9
9
|
@found = st.success?
|
10
10
|
@deployment_exists = memcached_deployment_exists?
|
11
11
|
@service_exists = memcached_service_exists?
|
12
|
-
@
|
12
|
+
@configmap_exists = memcached_configmap_exists?
|
13
13
|
|
14
|
-
@status = if @deployment_exists && @service_exists && @
|
14
|
+
@status = if @deployment_exists && @service_exists && @configmap_exists
|
15
15
|
"Provisioned"
|
16
16
|
else
|
17
17
|
"Unknown"
|
@@ -19,7 +19,7 @@ module KubernetesDeploy
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def deploy_succeeded?
|
22
|
-
@deployment_exists && @service_exists && @
|
22
|
+
@deployment_exists && @service_exists && @configmap_exists
|
23
23
|
end
|
24
24
|
|
25
25
|
def deploy_failed?
|
@@ -33,26 +33,22 @@ module KubernetesDeploy
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def memcached_deployment_exists?
|
36
|
-
|
36
|
+
deployment, _err, st = kubectl.run("get", "deployments", "memcached-#{@name}", "-o=json")
|
37
37
|
return false unless st.success?
|
38
|
-
parsed = JSON.parse(
|
39
|
-
|
40
|
-
deployment = parsed.fetch("items", []).first
|
41
|
-
status = deployment.fetch("status", {})
|
38
|
+
parsed = JSON.parse(deployment)
|
39
|
+
status = parsed.fetch("status", {})
|
42
40
|
status.fetch("availableReplicas", -1) == status.fetch("replicas", 0)
|
43
41
|
end
|
44
42
|
|
45
43
|
def memcached_service_exists?
|
46
|
-
|
44
|
+
service, _err, st = kubectl.run("get", "services", "memcached-#{@name}", "-o=json")
|
47
45
|
return false unless st.success?
|
48
|
-
parsed = JSON.parse(
|
49
|
-
|
50
|
-
service = parsed.fetch("items", []).first
|
51
|
-
service.dig("spec", "clusterIP").present?
|
46
|
+
parsed = JSON.parse(service)
|
47
|
+
parsed.dig("spec", "clusterIP").present?
|
52
48
|
end
|
53
49
|
|
54
|
-
def
|
55
|
-
secret, _err, st = kubectl.run("get", "
|
50
|
+
def memcached_configmap_exists?
|
51
|
+
secret, _err, st = kubectl.run("get", "configmaps", CONFIGMAP_NAME, "-o=json")
|
56
52
|
return false unless st.success?
|
57
53
|
parsed = JSON.parse(secret)
|
58
54
|
parsed.dig("data", @name).present?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubernetes-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Verey
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-10-
|
12
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
263
|
version: '0'
|
264
264
|
requirements: []
|
265
265
|
rubyforge_project:
|
266
|
-
rubygems_version: 2.5.2
|
266
|
+
rubygems_version: 2.5.2.1
|
267
267
|
signing_key:
|
268
268
|
specification_version: 4
|
269
269
|
summary: Kubernetes deploy scripts
|