kuber_kit 0.2.7 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +15 -13
  3. data/TODO.md +5 -7
  4. data/example/app_data/docker_compose.yml +6 -0
  5. data/example/config.rb +3 -0
  6. data/example/configurations/review.rb +1 -1
  7. data/example/images/ruby_app/Dockerfile +1 -1
  8. data/example/images/ruby_app/image.rb +3 -0
  9. data/example/infrastructure/build_servers.rb +5 -5
  10. data/example/infrastructure/templates.rb +5 -0
  11. data/example/services/compose_app.rb +10 -0
  12. data/example/services/env_file.rb +1 -1
  13. data/lib/kuber_kit.rb +22 -3
  14. data/lib/kuber_kit/actions/configuration_loader.rb +19 -1
  15. data/lib/kuber_kit/actions/kubectl_applier.rb +2 -2
  16. data/lib/kuber_kit/actions/kubectl_attacher.rb +2 -2
  17. data/lib/kuber_kit/actions/template_reader.rb +3 -6
  18. data/lib/kuber_kit/configs.rb +63 -32
  19. data/lib/kuber_kit/container.rb +14 -2
  20. data/lib/kuber_kit/core/configuration.rb +19 -8
  21. data/lib/kuber_kit/core/configuration_definition.rb +30 -10
  22. data/lib/kuber_kit/core/configuration_factory.rb +11 -10
  23. data/lib/kuber_kit/core/context_helper/base_helper.rb +4 -0
  24. data/lib/kuber_kit/core/context_helper/context_helper_factory.rb +3 -2
  25. data/lib/kuber_kit/core/context_helper/context_vars.rb +39 -0
  26. data/lib/kuber_kit/core/context_helper/image_helper.rb +17 -0
  27. data/lib/kuber_kit/core/image.rb +3 -1
  28. data/lib/kuber_kit/core/image_definition.rb +7 -5
  29. data/lib/kuber_kit/core/service.rb +4 -4
  30. data/lib/kuber_kit/core/service_definition.rb +3 -3
  31. data/lib/kuber_kit/core/service_factory.rb +6 -6
  32. data/lib/kuber_kit/env_file_reader/reader.rb +10 -6
  33. data/lib/kuber_kit/extensions/indocker_compat.rb +4 -0
  34. data/lib/kuber_kit/image_compiler/compiler.rb +1 -1
  35. data/lib/kuber_kit/service_deployer/deployer.rb +14 -8
  36. data/lib/kuber_kit/service_deployer/strategies/docker_compose.rb +24 -0
  37. data/lib/kuber_kit/service_deployer/strategies/kubernetes.rb +6 -6
  38. data/lib/kuber_kit/service_deployer/strategies/kubernetes_runner.rb +7 -7
  39. data/lib/kuber_kit/service_deployer/strategy_detector.rb +1 -1
  40. data/lib/kuber_kit/shell/abstract_shell.rb +4 -0
  41. data/lib/kuber_kit/shell/commands/docker_commands.rb +14 -0
  42. data/lib/kuber_kit/shell/commands/docker_compose_commands.rb +17 -0
  43. data/lib/kuber_kit/shell/commands/kubectl_commands.rb +5 -6
  44. data/lib/kuber_kit/shell/local_shell.rb +14 -0
  45. data/lib/kuber_kit/shell/ssh_shell.rb +4 -0
  46. data/lib/kuber_kit/template_reader/action_handler.rb +13 -0
  47. data/lib/kuber_kit/template_reader/reader.rb +13 -9
  48. data/lib/kuber_kit/template_reader/{abstract_template_reader.rb → strategies/abstract.rb} +1 -1
  49. data/lib/kuber_kit/template_reader/{artifact_file_reader.rb → strategies/artifact_file.rb} +1 -1
  50. data/lib/kuber_kit/version.rb +1 -1
  51. metadata +11 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2735934312125fca63822a1f45333ae928f4e053d9b6e9509a99036285e171a
4
- data.tar.gz: 3045f6fb2cbe3d77313af0c3740edc3ae2dcd838cc46c65f672d419d6590d815
3
+ metadata.gz: 339883bd875277f494fdef1fe01035920e6a867ea98394e10c4d08e5a8b5a108
4
+ data.tar.gz: 96448b7bb059d60e55ec0b8bceb70e1a02b8740773dcdbc4944afa3fafda3192
5
5
  SHA512:
6
- metadata.gz: 613792df522946cf5b5fdf83447214549ca47976c5d5a3c2c24c32813535237674fb72e62ccca378ba437e0b3a2675047ed4db32e7a6f53dc8b2598377497ae4
7
- data.tar.gz: e0f187c76817f7af79716816459683b731726b2ae296481229fbcee23f75c65b0d7e7d934da4c18330b5b20602c43688a1c4e02d7d9852a19bf68703df6cd819
6
+ metadata.gz: 49b5bf9c115c06ab88f67b60bc54f55b254a3a1a4de58ebe0fa834c04b352d8e759ed66747bd98e1d62a8adbb794cbda948dbd324c06165113af29d28ce02aad
7
+ data.tar.gz: 77354cf127ad50ff4f5f092aeaebfdb7568030ea8120e990dc01eb109a9ca679da83f1124cd5df225d37053ce2abe84d4e9016c0d284b47a323a4d175ba28b40
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kuber_kit (0.2.7)
4
+ kuber_kit (0.3.2)
5
5
  cli-ui
6
6
  contracts-lite
7
7
  dry-auto_inject
@@ -35,23 +35,25 @@ GEM
35
35
  coderay (~> 1.1)
36
36
  method_source (~> 1.0)
37
37
  rake (10.5.0)
38
- rspec (3.9.0)
39
- rspec-core (~> 3.9.0)
40
- rspec-expectations (~> 3.9.0)
41
- rspec-mocks (~> 3.9.0)
42
- rspec-core (3.9.3)
43
- rspec-support (~> 3.9.3)
44
- rspec-expectations (3.9.3)
38
+ rspec (3.10.0)
39
+ rspec-core (~> 3.10.0)
40
+ rspec-expectations (~> 3.10.0)
41
+ rspec-mocks (~> 3.10.0)
42
+ rspec-core (3.10.0)
43
+ rspec-support (~> 3.10.0)
44
+ rspec-expectations (3.10.0)
45
45
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.9.0)
47
- rspec-mocks (3.9.1)
46
+ rspec-support (~> 3.10.0)
47
+ rspec-mocks (3.10.0)
48
48
  diff-lcs (>= 1.2.0, < 2.0)
49
- rspec-support (~> 3.9.0)
50
- rspec-support (3.9.4)
51
- simplecov (0.19.0)
49
+ rspec-support (~> 3.10.0)
50
+ rspec-support (3.10.0)
51
+ simplecov (0.20.0)
52
52
  docile (~> 1.1)
53
53
  simplecov-html (~> 0.11)
54
+ simplecov_json_formatter (~> 0.1)
54
55
  simplecov-html (0.12.3)
56
+ simplecov_json_formatter (0.1.2)
55
57
  thor (1.0.1)
56
58
 
57
59
  PLATFORMS
data/TODO.md CHANGED
@@ -1,10 +1,8 @@
1
- - add config file support to kuber_kit root folder
2
- - find a way to always deploy some service, e.g. for migrations and env_files
3
- - allow setting default configuration for kuberkit using env variable
4
- - add ability to set container health checks
5
- - implement interactive shell.exec!
6
- - allow deploying only services enabled for specific configuration
7
1
  - list services and require confirmation before deployment
8
- - add build vars support (use images instead of containers)
2
+ - kit attach should list available deployments/pods, and ask for specific container if it has multiple containers
3
+ - add kit logs support, should work similar to kit attach
4
+ - allow deploying only services enabled for specific configuration
5
+ - find a way to always deploy some service, e.g. for migrations and env_files
6
+ - add ability to set container health checks
9
7
  - template should be able to set default attributes
10
8
  - template should be able to depend on image?
@@ -0,0 +1,6 @@
1
+ version: "3.3"
2
+ services:
3
+ <%= service_name %>:
4
+ container_name: <%= service_name %>
5
+ hostname: <%= service_name %>
6
+ image: <%= image_url(attribute(:image_name, default: service_name.to_sym)) %>
@@ -0,0 +1,3 @@
1
+ KuberKit.configure do |config|
2
+ config.kuber_kit_min_version = "0.2.0"
3
+ end
@@ -2,4 +2,4 @@ KuberKit
2
2
  .define_configuration(:review)
3
3
  .use_registry(:review_default, as: :default)
4
4
  .use_artifact(:kuber_kit_repo, as: :kuber_kit_repo)
5
- .use_build_server(:remote_bs)
5
+ #.use_build_server(:remote_bs)
@@ -8,4 +8,4 @@ COPY README.md README.md
8
8
 
9
9
  RUN ruby /app/source.rb
10
10
 
11
- COPY example_file.txt example_file.txt
11
+ COPY example_file.txt <%= build_vars.example_file_name %>
@@ -2,6 +2,9 @@ KuberKit
2
2
  .define_image(:ruby_app)
3
3
  .registry(:default)
4
4
  .depends_on(:ruby, :app_sources)
5
+ .build_vars({
6
+ example_file_name: "example.txt"
7
+ })
5
8
  .before_build do |context_helper, build_dir|
6
9
  # copy file: local artifact
7
10
  source_path = context_helper.artifact_path(:kuber_kit_example_data, "test.txt")
@@ -1,8 +1,8 @@
1
1
  ENV['SSH_TEST_HOST'] ||= "indocker.artstn.ninja"
2
2
  ENV['SSH_TEST_USER'] ||= "kuber_kit"
3
3
 
4
- KuberKit.add_build_server(
5
- KuberKit::Core::BuildServers::BuildServer
6
- .new(:remote_bs)
7
- .setup(host: ENV['SSH_TEST_HOST'], user: ENV['SSH_TEST_USER'], port: 22)
8
- )
4
+ # KuberKit.add_build_server(
5
+ # KuberKit::Core::BuildServers::BuildServer
6
+ # .new(:remote_bs)
7
+ # .setup(host: ENV['SSH_TEST_HOST'], user: ENV['SSH_TEST_USER'], port: 22)
8
+ # )
@@ -6,4 +6,9 @@ KuberKit.add_template(
6
6
  KuberKit.add_template(
7
7
  KuberKit::Core::Templates::ArtifactFile
8
8
  .new(:env_file, artifact_name: :kuber_kit_example_data, file_path: "env_file.yml")
9
+ )
10
+
11
+ KuberKit.add_template(
12
+ KuberKit::Core::Templates::ArtifactFile
13
+ .new(:docker_compose, artifact_name: :kuber_kit_example_data, file_path: "docker_compose.yml")
9
14
  )
@@ -0,0 +1,10 @@
1
+ KuberKit
2
+ .define_service(:compose_app)
3
+ .template(:docker_compose)
4
+ .images(:ruby_app)
5
+ .tags(:compose)
6
+ .deployer_strategy(:docker_compose)
7
+ .attributes(
8
+ image_name: :ruby_app,
9
+ deployer_interactive: true
10
+ )
@@ -3,5 +3,5 @@ KuberKit
3
3
  .template(:env_file)
4
4
  .tags("env_file")
5
5
  .attributes(
6
- deployment_restart_enabled: false
6
+ deployer_restart_enabled: false
7
7
  )
@@ -57,6 +57,7 @@ module KuberKit
57
57
  autoload :ImageHelper, 'core/context_helper/image_helper'
58
58
  autoload :ServiceHelper, 'core/context_helper/service_helper'
59
59
  autoload :ContextHelperFactory, 'core/context_helper/context_helper_factory'
60
+ autoload :ContextVars, 'core/context_helper/context_vars'
60
61
  end
61
62
 
62
63
  module Registries
@@ -87,6 +88,7 @@ module KuberKit
87
88
  module Commands
88
89
  autoload :BashCommands, 'shell/commands/bash_commands'
89
90
  autoload :DockerCommands, 'shell/commands/docker_commands'
91
+ autoload :DockerComposeCommands, 'shell/commands/docker_compose_commands'
90
92
  autoload :GitCommands, 'shell/commands/git_commands'
91
93
  autoload :RsyncCommands, 'shell/commands/rsync_commands'
92
94
  autoload :KubectlCommands, 'shell/commands/kubectl_commands'
@@ -127,9 +129,13 @@ module KuberKit
127
129
  end
128
130
 
129
131
  module TemplateReader
132
+ autoload :ActionHandler, 'template_reader/action_handler'
130
133
  autoload :Reader, 'template_reader/reader'
131
- autoload :AbstractTemplateReader, 'template_reader/abstract_template_reader'
132
- autoload :ArtifactFileReader, 'template_reader/artifact_file_reader'
134
+
135
+ module Strategies
136
+ autoload :Abstract, 'template_reader/strategies/abstract'
137
+ autoload :ArtifactFile, 'template_reader/strategies/artifact_file'
138
+ end
133
139
  end
134
140
 
135
141
  module ServiceDeployer
@@ -140,6 +146,7 @@ module KuberKit
140
146
 
141
147
  module Strategies
142
148
  autoload :Abstract, 'service_deployer/strategies/abstract'
149
+ autoload :DockerCompose, 'service_deployer/strategies/docker_compose'
143
150
  autoload :Kubernetes, 'service_deployer/strategies/kubernetes'
144
151
  autoload :KubernetesRunner, 'service_deployer/strategies/kubernetes_runner'
145
152
  end
@@ -170,9 +177,9 @@ module KuberKit
170
177
  autoload :Simple, 'ui/simple'
171
178
  end
172
179
 
173
- autoload :Configs, 'configs'
174
180
  autoload :CLI, 'cli'
175
181
  autoload :Container, 'container'
182
+ autoload :Configs, 'configs'
176
183
 
177
184
  Import = Dry::AutoInject(Container)
178
185
 
@@ -204,6 +211,10 @@ module KuberKit
204
211
  !!@debug_mode
205
212
  end
206
213
 
214
+ def deprecation_warnings_disabled?
215
+ Container["configs"].deprecation_warnings_disabled
216
+ end
217
+
207
218
  def current_configuration
208
219
  if @configuration_name.nil?
209
220
  raise "Please set configuration name before calling current_configuration"
@@ -211,6 +222,10 @@ module KuberKit
211
222
  @current_configuration ||= Container['core.configuration_store'].get_configuration(@configuration_name)
212
223
  end
213
224
 
225
+ def global_build_vars
226
+ KuberKit::Core::ContextHelper::ContextVars.new(current_configuration.global_build_vars)
227
+ end
228
+
214
229
  def add_registry(registry)
215
230
  Container["core.registry_store"].add(registry)
216
231
  end
@@ -234,6 +249,10 @@ module KuberKit
234
249
  def build_helper(&proc)
235
250
  KuberKit::Core::ContextHelper::BaseHelper.class_exec(&proc)
236
251
  end
252
+
253
+ def configure(&proc)
254
+ yield(Container["configs"])
255
+ end
237
256
  end
238
257
  end
239
258
 
@@ -1,4 +1,6 @@
1
1
  class KuberKit::Actions::ConfigurationLoader
2
+ APP_CONFIG_FILENAME = "config.rb".freeze
3
+
2
4
  include KuberKit::Import[
3
5
  "core.registry_store",
4
6
  "core.image_store",
@@ -14,11 +16,18 @@ class KuberKit::Actions::ConfigurationLoader
14
16
  Contract Hash => Any
15
17
  def call(options)
16
18
  root_path = options[:path] || File.join(Dir.pwd, configs.kuber_kit_dirname)
19
+
20
+ # require config file first, in case if other dirs are overriden in config
21
+ config_file_path = File.join(root_path, APP_CONFIG_FILENAME)
22
+ if File.exists?(config_file_path)
23
+ require config_file_path
24
+ end
25
+
17
26
  images_path = options[:images_path] || File.join(root_path, configs.images_dirname)
18
27
  services_path = options[:services_path] || File.join(root_path, configs.services_dirname)
19
28
  infra_path = options[:infra_path] || File.join(root_path, configs.infra_dirname)
20
29
  configurations_path = options[:configurations_path] || File.join(root_path, configs.configurations_dirname)
21
- configuration_name = options[:configuration]
30
+ configuration_name = ENV["KUBER_KIT_CONFIGURATION"] || options[:configuration]
22
31
 
23
32
  logger.info "Launching kuber_kit with:"
24
33
  logger.info " Root path: #{root_path.to_s.yellow}"
@@ -32,6 +41,10 @@ class KuberKit::Actions::ConfigurationLoader
32
41
  ui.print_warning "WARNING", "KuberKit root path #{root_path} doesn't exist. You may want to pass it --path parameter."
33
42
  end
34
43
 
44
+ if Gem::Version.new(KuberKit::VERSION) < Gem::Version.new(configs.kuber_kit_min_version)
45
+ raise KuberKit::Error, "The minimal required kuber_kit version is #{configs.kuber_kit_min_version}"
46
+ end
47
+
35
48
  load_configurations(configurations_path, configuration_name)
36
49
  load_infrastructure(infra_path)
37
50
 
@@ -43,6 +56,11 @@ class KuberKit::Actions::ConfigurationLoader
43
56
 
44
57
  ui.create_task("Loading image definitions") do |task|
45
58
  files = image_store.load_definitions(images_path)
59
+
60
+ configs.additional_images_paths.each do |path|
61
+ files += image_store.load_definitions(path)
62
+ end
63
+
46
64
  task.update_title("Loaded #{files.count} image definitions")
47
65
  end
48
66
 
@@ -8,9 +8,9 @@ class KuberKit::Actions::KubectlApplier
8
8
  Contract String, Hash => Any
9
9
  def call(file_path, options)
10
10
  kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
11
- deploy_namespace = KuberKit.current_configuration.deploy_namespace
11
+ deployer_namespace = KuberKit.current_configuration.deployer_namespace
12
12
  ui.create_task("Applying file: #{file_path}") do |task|
13
- kubectl_commands.apply_file(local_shell, file_path, kubeconfig_path: kubeconfig_path, namespace: deploy_namespace)
13
+ kubectl_commands.apply_file(local_shell, file_path, kubeconfig_path: kubeconfig_path, namespace: deployer_namespace)
14
14
  task.update_title("Applied file: #{file_path}")
15
15
  end
16
16
 
@@ -8,13 +8,13 @@ class KuberKit::Actions::KubectlAttacher
8
8
  Contract String, Hash => Any
9
9
  def call(pod_name, options)
10
10
  kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
11
- deploy_namespace = KuberKit.current_configuration.deploy_namespace
11
+ deployer_namespace = KuberKit.current_configuration.deployer_namespace
12
12
 
13
13
  kubectl_commands.exec(
14
14
  local_shell, pod_name, "bash", args: "-it",
15
15
  kubeconfig_path: kubeconfig_path,
16
16
  interactive: true,
17
- namespace: deploy_namespace
17
+ namespace: deployer_namespace
18
18
  )
19
19
 
20
20
  true
@@ -1,16 +1,13 @@
1
1
  class KuberKit::Actions::TemplateReader
2
2
  include KuberKit::Import[
3
- "core.template_store",
4
- "template_reader.reader",
5
3
  "shell.local_shell",
6
- "ui"
4
+ "ui",
5
+ template_reader: "template_reader.action_handler",
7
6
  ]
8
7
 
9
8
  Contract Symbol, Hash => Any
10
9
  def call(template_name, options)
11
- template = template_store.get(template_name)
12
-
13
- result = reader.read(local_shell, template)
10
+ result = template_reader.call(local_shell, template_name)
14
11
 
15
12
  ui.print_info(template_name.to_s, result)
16
13
 
@@ -1,8 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class KuberKit::Configs
2
- IMAGE_DOCKERFILE_NAME = "Dockerfile".freeze
3
- IMAGE_BUILD_CONTEXT_DIR = "build_context".freeze
4
- IMAGE_TAG = 'latest'.freeze
5
- IMAGE_COMPILE_DIR = "/tmp/kuber_kit/image_builds"
4
+ AVAILABLE_CONFIGS = [
5
+ :image_dockerfile_name, :image_build_context_dir, :image_tag, :docker_ignore_list, :image_compile_dir,
6
+ :kuber_kit_dirname, :kuber_kit_min_version, :images_dirname, :services_dirname, :infra_dirname, :configurations_dirname,
7
+ :artifact_clone_dir, :service_config_dir, :deployer_strategy, :compile_simultaneous_limit,
8
+ :additional_images_paths, :deprecation_warnings_disabled
9
+ ]
6
10
  DOCKER_IGNORE_LIST = [
7
11
  'Dockerfile',
8
12
  '.DS_Store',
@@ -14,35 +18,62 @@ class KuberKit::Configs
14
18
  'tmp',
15
19
  'logs'
16
20
  ]
17
- KUBER_KIT_DIRNAME = "kuber_kit".freeze
18
- IMAGES_DIRNAME = "images".freeze
19
- SERVICES_DIRNAME = "services".freeze
20
- INFRA_DIRNAME = "infrastructure".freeze
21
- CONFIGURATIONS_DIRNAME = "configurations".freeze
22
- ARTIFACT_CLONE_DIR = "/tmp/kuber_kit/artifacts"
23
- SERVICE_CONFIG_DIR = "/tmp/kuber_kit/services"
24
- DEPLOY_STRATEGY = :kubernetes
25
- COMPILE_SIMULTANEOUS_LIMIT = 5
26
-
27
- attr_accessor :image_dockerfile_name, :image_build_context_dir, :image_tag,
28
- :docker_ignore_list, :image_compile_dir,
29
- :kuber_kit_dirname, :images_dirname, :services_dirname, :infra_dirname, :configurations_dirname,
30
- :artifact_clone_dir, :service_config_dir, :deploy_strategy, :compile_simultaneous_limit
21
+
22
+ AVAILABLE_CONFIGS.each do |config_name|
23
+ define_method(config_name) do
24
+ get(config_name.to_sym)
25
+ end
26
+
27
+ define_method(:"#{config_name}=") do |value|
28
+ set(config_name.to_sym, value)
29
+ end
30
+ end
31
31
 
32
32
  def initialize
33
- @image_dockerfile_name = IMAGE_DOCKERFILE_NAME
34
- @image_build_context_dir = IMAGE_BUILD_CONTEXT_DIR
35
- @image_tag = IMAGE_TAG
36
- @image_compile_dir = IMAGE_COMPILE_DIR
37
- @docker_ignore_list = DOCKER_IGNORE_LIST
38
- @kuber_kit_dirname = KUBER_KIT_DIRNAME
39
- @images_dirname = IMAGES_DIRNAME
40
- @services_dirname = SERVICES_DIRNAME
41
- @infra_dirname = INFRA_DIRNAME
42
- @configurations_dirname = CONFIGURATIONS_DIRNAME
43
- @artifact_clone_dir = ARTIFACT_CLONE_DIR
44
- @service_config_dir = SERVICE_CONFIG_DIR
45
- @deploy_strategy = DEPLOY_STRATEGY
46
- @compile_simultaneous_limit = COMPILE_SIMULTANEOUS_LIMIT
33
+ add_default_configs unless items.any?
34
+ end
35
+
36
+ def add_default_configs
37
+ set :image_dockerfile_name, "Dockerfile"
38
+ set :image_build_context_dir, "build_context"
39
+ set :image_tag, 'latest'
40
+ set :image_compile_dir, "/tmp/kuber_kit/image_builds"
41
+ set :docker_ignore_list, DOCKER_IGNORE_LIST
42
+ set :kuber_kit_dirname, "kuber_kit"
43
+ set :kuber_kit_min_version, KuberKit::VERSION
44
+ set :images_dirname, "images"
45
+ set :services_dirname, "services"
46
+ set :infra_dirname, "infrastructure"
47
+ set :configurations_dirname, "configurations"
48
+ set :artifact_clone_dir, "/tmp/kuber_kit/artifacts"
49
+ set :service_config_dir, "/tmp/kuber_kit/services"
50
+ set :deployer_strategy, :kubernetes
51
+ set :compile_simultaneous_limit, 5
52
+ set :additional_images_paths, []
53
+ set :deprecation_warnings_disabled, false
54
+ end
55
+
56
+ def items
57
+ @@items ||= {}
58
+ end
59
+
60
+ def set(key, value)
61
+ unless AVAILABLE_CONFIGS.include?(key)
62
+ raise ArgumentError, "#{key} is not a valid configuration key"
63
+ end
64
+
65
+ items[key] = value
66
+ end
67
+
68
+ def get(key)
69
+ unless AVAILABLE_CONFIGS.include?(key)
70
+ raise ArgumentError, "#{key} is not a valid configuration key"
71
+ end
72
+
73
+ items[key]
74
+ end
75
+
76
+ def reset!
77
+ @@items = {}
47
78
  end
48
79
  end
@@ -117,6 +117,10 @@ class KuberKit::Container
117
117
  KuberKit::Shell::Commands::DockerCommands.new
118
118
  end
119
119
 
120
+ register "shell.docker_compose_commands" do
121
+ KuberKit::Shell::Commands::DockerComposeCommands.new
122
+ end
123
+
120
124
  register "shell.git_commands" do
121
125
  KuberKit::Shell::Commands::GitCommands.new
122
126
  end
@@ -197,12 +201,16 @@ class KuberKit::Container
197
201
  KuberKit::EnvFileReader::Strategies::ArtifactFile.new
198
202
  end
199
203
 
204
+ register "template_reader.action_handler" do
205
+ KuberKit::TemplateReader::ActionHandler.new
206
+ end
207
+
200
208
  register "template_reader.reader" do
201
209
  KuberKit::TemplateReader::Reader.new
202
210
  end
203
211
 
204
- register "template_reader.artifact_file_reader" do
205
- KuberKit::TemplateReader::ArtifactFileReader.new
212
+ register "template_reader.strategies.artifact_file" do
213
+ KuberKit::TemplateReader::Strategies::ArtifactFile.new
206
214
  end
207
215
 
208
216
  register "service_deployer.action_handler" do
@@ -229,6 +237,10 @@ class KuberKit::Container
229
237
  KuberKit::ServiceDeployer::Strategies::KubernetesRunner.new
230
238
  end
231
239
 
240
+ register "service_deployer.strategies.docker_compose" do
241
+ KuberKit::ServiceDeployer::Strategies::DockerCompose.new
242
+ end
243
+
232
244
  register "service_reader.action_handler" do
233
245
  KuberKit::ServiceReader::ActionHandler.new
234
246
  end