kuber_kit 0.8.2 → 0.8.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d37959e170cf0ae0f88daa765fed03f52d3df930a05f8130fccbd2d6b68468d
4
- data.tar.gz: 89610ec982168e4bad20d1688b792d60f95174e9a3d8d420bc7a257db6889b86
3
+ metadata.gz: 861dcc68aede1a1383503407122ddcd8ff87a318609499d054da82622a5b04b4
4
+ data.tar.gz: a3dac127827d387865a9efa50c0cf622b4c75f2b56d4fa77d8bab22ae32c262c
5
5
  SHA512:
6
- metadata.gz: f6d6dbe6c69bb428b7b528bcfed76d1619abd1b8253bd2a2c069a657e487db6444cdfa65a6ec8e896bb691b688dcb4a5dfcd1a024bf657c29ad77b0eb40b5cc5
7
- data.tar.gz: 758e908ce338e9effb8d9e1740e200ee69b64b22154436c6548635eca3ffcd39c1ee634c94850741cecb629558a875055afc85434ba45adeccecc29e209a8f3e
6
+ metadata.gz: 2ef883008c62f3eb0f3660a124513f1051e1c0ca555d53bc0d0eae4ac0aadeee6ad07076d96e4c9fd19fac83755d31f11dc67e44b363e2243a67631bc0448f67
7
+ data.tar.gz: d41a9dbab50e8fbd59f639c03cdb1e6263cabef6f6503dddb526639499d6b875c226a12eed7e4903fcba91a334c941b35c00427591a27f5adbd1c157df7dce50
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ **0.8.5**
2
+ - Properly show initial services in deployment confirmation
3
+
4
+ **0.8.4**
5
+ - Added initial services support, to deploy before all other servies
6
+
7
+ **0.8.3**
8
+ - Always load artifacts, if kubeconfig is an artifact
9
+
1
10
  **0.8.2**
2
11
  - Update Kit Env command to support kubeconfig path as artifact
3
12
 
@@ -42,9 +42,11 @@ class KuberKit::Actions::ConfigurationLoader
42
42
  load_configurations(configurations_path, configuration_name)
43
43
  load_infrastructure(infra_path)
44
44
 
45
- if load_inventory
45
+ if load_inventory || KuberKit.current_configuration.kubeconfig_path.is_a?(KuberKit::Core::ArtifactPath)
46
46
  update_artifacts(KuberKit.current_configuration.artifacts.values)
47
+ end
47
48
 
49
+ if load_inventory
48
50
  ui.create_task("Loading image definitions") do |task|
49
51
  files = image_store.load_definitions(images_path)
50
52
 
@@ -28,9 +28,11 @@ class KuberKit::Actions::ServiceDeployer
28
28
  services, tags = deployment_options_selector.call()
29
29
  end
30
30
 
31
- default_services = current_configuration.default_services.map(&:to_s)
32
31
  disabled_services = current_configuration.disabled_services.map(&:to_s)
33
32
  disabled_services += skip_services if skip_services
33
+ default_services = current_configuration.default_services.map(&:to_s) - disabled_services
34
+ initial_services = current_configuration.initial_services.map(&:to_s) - disabled_services
35
+ initial_service_names = initial_services.map(&:to_sym)
34
36
 
35
37
  service_names = service_list_resolver.resolve(
36
38
  services: services || [],
@@ -52,21 +54,32 @@ class KuberKit::Actions::ServiceDeployer
52
54
  return false
53
55
  end
54
56
 
55
- unless allow_deployment?(require_confirmation: require_confirmation, service_names: all_service_names)
57
+ unless allow_deployment?(require_confirmation: require_confirmation, service_names: (initial_service_names + all_service_names).uniq)
56
58
  return false
57
59
  end
58
60
 
59
61
  # Compile images for all services and dependencies
60
- images_names = get_image_names(service_names: all_service_names)
62
+ images_names = get_image_names(service_names: (initial_service_names + all_service_names).uniq)
61
63
  unless skip_compile
62
64
  compilation_result = compile_images(images_names)
63
65
 
64
66
  return false unless compilation_result && compilation_result.succeeded?
65
67
  end
66
68
 
69
+ # First deploy initial services.
70
+ # This feature is used to deploy some services, required for deployment of other services, e.g. env files
71
+ # Note: Initial services are deployed without dependencies
72
+ initial_services.map(&:to_sym).each_slice(configs.deploy_simultaneous_limit) do |batch_service_names|
73
+ ui.print_debug("ServiceDeployer", "Scheduling to compile: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
74
+
75
+ if deployment_result.succeeded?
76
+ deploy_simultaneously(batch_service_names, deployment_result)
77
+ end
78
+ end
79
+
67
80
  if skip_dependencies
68
81
  service_names.each_slice(configs.deploy_simultaneous_limit) do |batch_service_names|
69
- ui.print_debug("ServiceDeployer", "Scheduling to compile: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
82
+ ui.print_debug("ServiceDeployer", "Scheduling to deploy: #{batch_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
70
83
 
71
84
  if deployment_result.succeeded?
72
85
  deploy_simultaneously(batch_service_names, deployment_result)
@@ -74,7 +87,7 @@ class KuberKit::Actions::ServiceDeployer
74
87
  end
75
88
  else
76
89
  service_dependency_resolver.each_with_deps(service_names) do |dep_service_names|
77
- ui.print_debug("ServiceDeployer", "Scheduling to compile: #{dep_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
90
+ ui.print_debug("ServiceDeployer", "Scheduling to deploy: #{dep_service_names.inspect}. Limit: #{configs.deploy_simultaneous_limit}")
78
91
 
79
92
  if deployment_result.succeeded?
80
93
  deploy_simultaneously(dep_service_names, deployment_result)
@@ -1,7 +1,7 @@
1
1
  class KuberKit::Core::Configuration
2
2
  attr_reader :name, :artifacts, :registries, :env_files, :templates, :kubeconfig_path,
3
- :services_attributes, :enabled_services, :disabled_services, :default_services,
4
- :build_servers, :global_build_vars,
3
+ :services_attributes, :enabled_services, :disabled_services, :default_services,
4
+ :initial_services, :build_servers, :global_build_vars,
5
5
  :deployer_strategy, :deployer_namespace, :deployer_require_confirmation
6
6
 
7
7
  Contract KeywordArgs[
@@ -15,15 +15,16 @@ class KuberKit::Core::Configuration
15
15
  enabled_services: ArrayOf[Symbol],
16
16
  disabled_services: ArrayOf[Symbol],
17
17
  default_services: ArrayOf[Symbol],
18
+ initial_services: ArrayOf[Symbol],
18
19
  build_servers: ArrayOf[KuberKit::Core::BuildServers::AbstractBuildServer],
19
20
  global_build_vars: HashOf[Symbol => Any],
20
21
  deployer_strategy: Symbol,
21
- deployer_namespace: Maybe[Symbol],
22
+ deployer_namespace: Maybe[Or[Symbol, String]],
22
23
  deployer_require_confirmation: Bool,
23
24
  ] => Any
24
25
  def initialize(name:, artifacts:, registries:, env_files:, templates:, kubeconfig_path:,
25
26
  services_attributes:, enabled_services:, disabled_services:, default_services:,
26
- build_servers:, global_build_vars:,
27
+ initial_services:, build_servers:, global_build_vars:,
27
28
  deployer_strategy:, deployer_namespace:, deployer_require_confirmation:)
28
29
  @name = name
29
30
  @artifacts = artifacts
@@ -36,6 +37,7 @@ class KuberKit::Core::Configuration
36
37
  @enabled_services = enabled_services
37
38
  @disabled_services = disabled_services
38
39
  @default_services = default_services
40
+ @initial_services = initial_services
39
41
  @global_build_vars = global_build_vars
40
42
  @deployer_strategy = deployer_strategy
41
43
  @deployer_namespace = deployer_namespace
@@ -52,4 +54,4 @@ class KuberKit::Core::Configuration
52
54
  end
53
55
  global_build_vars
54
56
  end
55
- end
57
+ end
@@ -14,6 +14,7 @@ class KuberKit::Core::ConfigurationDefinition
14
14
  @enabled_services = []
15
15
  @disabled_services = []
16
16
  @default_services = []
17
+ @initial_services = []
17
18
  @services_attributes = {}
18
19
  end
19
20
 
@@ -28,6 +29,7 @@ class KuberKit::Core::ConfigurationDefinition
28
29
  enabled_services: @enabled_services,
29
30
  disabled_services: @disabled_services,
30
31
  default_services: @default_services,
32
+ initial_services: @initial_services,
31
33
  build_servers: @build_servers,
32
34
  services_attributes: @services_attributes,
33
35
  global_build_vars: @global_build_vars,
@@ -126,6 +128,11 @@ class KuberKit::Core::ConfigurationDefinition
126
128
  return self
127
129
  end
128
130
 
131
+ def initial_services(services)
132
+ @initial_services += services.map(&:to_sym)
133
+ return self
134
+ end
135
+
129
136
  def disabled_services(services)
130
137
  @disabled_services += services.map(&:to_sym)
131
138
  return self
@@ -31,6 +31,7 @@ class KuberKit::Core::ConfigurationFactory
31
31
  enabled_services: configuration_attrs.enabled_services,
32
32
  disabled_services: configuration_attrs.disabled_services,
33
33
  default_services: configuration_attrs.default_services,
34
+ initial_services: configuration_attrs.initial_services,
34
35
  global_build_vars: configuration_attrs.global_build_vars || {},
35
36
  deployer_strategy: configuration_attrs.deployer_strategy || configs.deployer_strategy,
36
37
  deployer_namespace: configuration_attrs.deployer_namespace,
@@ -16,10 +16,11 @@ class KuberKit::Shell::Commands::KubectlCommands
16
16
  def kubectl_run(shell, command_list, kubeconfig_path: nil, namespace: nil, interactive: false)
17
17
  command_parts = []
18
18
 
19
+ if kubeconfig_path.is_a?(KuberKit::Core::ArtifactPath)
20
+ kubeconfig_path = artifact_path_resolver.call(kubeconfig_path)
21
+ end
22
+
19
23
  if kubeconfig_path
20
- if kubeconfig_path.is_a?(KuberKit::Core::ArtifactPath)
21
- kubeconfig_path = artifact_path_resolver.call(kubeconfig_path)
22
- end
23
24
  command_parts << "KUBECONFIG=#{kubeconfig_path}"
24
25
  end
25
26
 
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.6"
3
3
  end
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.8.2
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: contracts