kuber_kit 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/kuber_kit.rb +1 -0
- data/lib/kuber_kit/service_deployer/strategies/kubernetes_runner.rb +27 -0
- data/lib/kuber_kit/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f32cf040d33941d931b9e5fa2f67c8132f6538e4301f2f533531e2524410ee91
|
4
|
+
data.tar.gz: 2f769ec987b79ad51f594237968698515fea823cefdc0382d2631e3f7b0abbc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7f532ee9af8a02191d4a895f30647fb7d30abf63573e93b3616ee17adb657ed6f220ac0fc79a8b2a1bdc2a7f542bfc341937ef631835f0e2c4534505ce38b55
|
7
|
+
data.tar.gz: 24f8f053b3ef45ab3dc277d6d255b9334f4afa3c68490df1dd47f4fc2198aaf4b53584eb06040319e5cd87822b179d979ebaf1e7a4f9a36cf7d92170be28d5e5
|
data/Gemfile.lock
CHANGED
data/lib/kuber_kit.rb
CHANGED
@@ -141,6 +141,7 @@ module KuberKit
|
|
141
141
|
module Strategies
|
142
142
|
autoload :Abstract, 'service_deployer/strategies/abstract'
|
143
143
|
autoload :Kubernetes, 'service_deployer/strategies/kubernetes'
|
144
|
+
autoload :KubernetesRunner, 'service_deployer/strategies/kubernetes_runner'
|
144
145
|
end
|
145
146
|
end
|
146
147
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class KuberKit::ServiceDeployer::Strategies::KubernetesRunner < KuberKit::ServiceDeployer::Strategies::Abstract
|
2
|
+
include KuberKit::Import[
|
3
|
+
"service_reader.reader",
|
4
|
+
"shell.kubectl_commands",
|
5
|
+
"configs",
|
6
|
+
]
|
7
|
+
|
8
|
+
Contract KuberKit::Shell::AbstractShell, KuberKit::Core::Service => Any
|
9
|
+
def deploy(shell, service)
|
10
|
+
service_config = reader.read(shell, service)
|
11
|
+
config_path = "#{configs.service_config_dir}/#{service.name}.yml"
|
12
|
+
shell.write(config_path, service_config)
|
13
|
+
|
14
|
+
kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
|
15
|
+
deploy_namespace = KuberKit.current_configuration.deploy_namespace
|
16
|
+
|
17
|
+
deployment_resource_name = service.attribute(:deployment_resource_name, default: service.uri)
|
18
|
+
deployment_resource_type = service.attribute(:deployment_resource_type, default: "job")
|
19
|
+
|
20
|
+
deployment_delete_enabled = service.attribute(:deployment_delete_enabled, default: true)
|
21
|
+
if deployment_delete_enabled
|
22
|
+
kubectl_commands.delete_resource(shell, deployment_resource_type, deployment_resource_name, kubeconfig_path: kubeconfig_path, namespace: deploy_namespace)
|
23
|
+
end
|
24
|
+
|
25
|
+
kubectl_commands.apply_file(shell, config_path, kubeconfig_path: kubeconfig_path, namespace: deploy_namespace)
|
26
|
+
end
|
27
|
+
end
|
data/lib/kuber_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuber_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Khaziev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: contracts-lite
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- lib/kuber_kit/service_deployer/service_list_resolver.rb
|
258
258
|
- lib/kuber_kit/service_deployer/strategies/abstract.rb
|
259
259
|
- lib/kuber_kit/service_deployer/strategies/kubernetes.rb
|
260
|
+
- lib/kuber_kit/service_deployer/strategies/kubernetes_runner.rb
|
260
261
|
- lib/kuber_kit/service_deployer/strategy_detector.rb
|
261
262
|
- lib/kuber_kit/service_reader/action_handler.rb
|
262
263
|
- lib/kuber_kit/service_reader/reader.rb
|