pfab 0.58.14 → 0.58.16

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: c77b8a2325626b7403cd985d77f96d09b69b91fa27ef50a994119a7e6e49fbb0
4
- data.tar.gz: a5ea741047cb908c9b43e2ea2b22bee73d346c9b2f1c89b71a7ccfd0eb829d03
3
+ metadata.gz: fdf9b193b4e1b7e8536a0e5f6e21311832e0e54b48b5fee66e03c64a3b7102a5
4
+ data.tar.gz: af334222e925d2550aeb678e2009506881a37059a3020bddd7e15e381337f4ff
5
5
  SHA512:
6
- metadata.gz: 60b196351564de476c35d64f8fb9fe541e9af59ec50edf8e32149f0fb35a12b0c156d6aaac63a10d1de1c9af32c018a42c9496fe56221cab303e2dd171879a38
7
- data.tar.gz: 814f14ea77fa64512a7ed1c19f919919bd520c207cd36060b5eaf394c3e6fb15cf2a65d96d863b9c4174bfe31b62eedbdd32b6ef825e82116f6c16ad7a26f8b4
6
+ metadata.gz: e45ab033fd4a6227b13a5487b6144f70561bfec98fa9bf1ca74d5940639f788c2c6300a0ebca6b8b2749e2ca58794ae2a6cb9e1172250cec7eb44eb8c5625d3f
7
+ data.tar.gz: 6d53b717e2f2bc88e1043f8fbbdf5d6898b3f9efc6270a953f87f41697bfb4c45caf7e184f830dd4fed7ecc097f41815260e9d4fe40760716f665332c3e25c1c
data/Gemfile.lock CHANGED
@@ -77,7 +77,7 @@ GEM
77
77
  multi_json (1.15.0)
78
78
  multi_xml (0.6.0)
79
79
  multipart-post (2.1.1)
80
- nokogiri (1.18.3)
80
+ nokogiri (1.18.4)
81
81
  mini_portile2 (~> 2.8.2)
82
82
  racc (~> 1.4)
83
83
  oauth2 (1.4.11)
@@ -96,7 +96,7 @@ GEM
96
96
  psych (4.0.2)
97
97
  public_suffix (4.0.6)
98
98
  racc (1.8.1)
99
- rack (3.0.12)
99
+ rack (3.0.14)
100
100
  rake (13.0.6)
101
101
  rchardet (1.8.0)
102
102
  rdoc (6.1.2.1)
@@ -28,6 +28,7 @@ module Pfab
28
28
  },
29
29
  spec: {
30
30
  schedule: get("schedule"),
31
+ concurrencyPolicy: get("concurrencyPolicy") || 'Allow',
31
32
  successfulJobsHistoryLimit: 1,
32
33
  failedJobsHistoryLimit: 1,
33
34
  jobTemplate: {
@@ -21,9 +21,7 @@ module Pfab
21
21
  puts "skipping ingress because ingress_disabled = #{@data['generateIngressEnabled']}"
22
22
  end
23
23
  f << StyledYAML.dump(deployment.deep_stringify_keys)
24
- if get_replica_count() > 1
25
- f << StyledYAML.dump(pod_disruption_budget.deep_stringify_keys)
26
- end
24
+ f << StyledYAML.dump(pod_disruption_budget.deep_stringify_keys)
27
25
  end
28
26
  end
29
27
 
@@ -151,6 +149,16 @@ module Pfab
151
149
  end
152
150
 
153
151
  def pod_disruption_budget
152
+ replica_count = get_replica_count()
153
+
154
+ # For single replica deployments, allow the pod to be disrupted
155
+ # For multi-replica deployments, ensure at least 50% of pods remain available
156
+ disruption_spec = if replica_count == 1
157
+ { maxUnavailable: 1 }
158
+ else
159
+ { minAvailable: (replica_count * 0.5).floor }
160
+ end
161
+
154
162
  pdb = {
155
163
  apiVersion: "policy/v1",
156
164
  kind: "PodDisruptionBudget",
@@ -158,16 +166,15 @@ module Pfab
158
166
  name: "#{@data['deployed_name']}-pdb",
159
167
  namespace: get_namespace()
160
168
  },
161
- spec: {
162
- minAvailable: 1,
169
+ spec: disruption_spec.merge({
163
170
  selector: {
164
- matchLabels: {
165
- application: @data['application'],
166
- "deployed-name" => @data['deployed_name'],
167
- "application-type" => application_type
171
+ matchLabels: {
172
+ application: @data['application'],
173
+ "deployed-name" => @data['deployed_name'],
174
+ "application-type" => application_type
168
175
  }
169
176
  }
170
- }
177
+ })
171
178
  }
172
179
  return pdb
173
180
  end
data/lib/pfab/version.rb CHANGED
@@ -2,7 +2,7 @@ module Pfab
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 58
5
- PATCH = 14
5
+ PATCH = 16
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
data/pfab.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: pfab 0.58.14 ruby lib
5
+ # stub: pfab 0.58.16 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "pfab".freeze
9
- s.version = "0.58.14"
9
+ s.version = "0.58.16"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2025-03-05"
14
+ s.date = "2025-05-22"
15
15
  s.description = "k8s helper".freeze
16
16
  s.email = "jdwyer@prefab.cloud".freeze
17
17
  s.executables = ["pfab".freeze]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.58.14
4
+ version: 0.58.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-05 00:00:00.000000000 Z
11
+ date: 2025-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander