kube_cluster 1.3.0 → 1.3.1

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: '0768b58c75b80c58ddbe6bbae20aab3e57cad3a607058d7c2ebe64662d601f14'
4
- data.tar.gz: b6260994b93ce8c91c897d6e44fb771fb2df82eebab158353485a8423ba9a61a
3
+ metadata.gz: 821079f616a7cafa9d2115b32cebda37de37601d9ac116827c7fbcead48de3eb
4
+ data.tar.gz: bb33e6aec68bc2a83c67272d2a2fa73e38234095aefbb686e6b749bbd4add87c
5
5
  SHA512:
6
- metadata.gz: 0d10e0cda8c7483ca5190dc2351cf12a4a9ea856a61498cc1b210c1ff431d0e20c1fbe1908520f05c799329e1304d10ec1cdb0dcc7a80cd550ad8d0fc1ea695d
7
- data.tar.gz: ba7e0fcd06465f26a7d6197f41c4de71e713ebb06bde325433ac3dc41390ae7e95571e04cad35110f5cf4e17613262dae9189c8da3d35de4683b55537983ef7c
6
+ metadata.gz: 070b4bdf62bbf662bfa99eb55a464335d9666734ef3985f08949b072c78aa548cd51d0527c9cee62d26ca8839df8d2ddafa285b0fb44f0b346268174aab78ec8
7
+ data.tar.gz: 28f9483b8a10994f19f485c9e55b33e464541742842eff8c5791218ff294435f6ce55f59921aa9eb5c8725bd456d8a63d74be2f39c25d88c46e8601295829f13
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.3.1] - 2026-07-13
9
+
10
+ ### Changed
11
+ - `Standard::CloudNativePg::Cluster` is now the bare named `Cluster` CR subclass
12
+ (resolved to `postgresql.cnpg.io/v1/Cluster`); the whole spec is supplied via
13
+ the block.
14
+
15
+ ### Removed
16
+ - `Standard::CloudNativePg::PostgresCluster` (shipped in 1.3.0) — it baked in a
17
+ specific deployment's config, which belongs at the call site, not the library.
18
+
8
19
  ## [1.3.0] - 2026-07-13
9
20
 
10
21
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kube_cluster (1.3.0)
4
+ kube_cluster (1.3.1)
5
5
  activesupport (~> 8.0)
6
6
  kube_kubectl (~> 2.0)
7
7
  kube_schema (~> 1.9.2)
@@ -7,16 +7,9 @@ module Kube
7
7
  module Cluster
8
8
  module Standard
9
9
  module CloudNativePg
10
- # A CloudNativePG Cluster CR. Thin wrapper: sets metadata, leaves the
11
- # (large, deployment-specific) spec to the block.
10
+ # A CloudNativePG Cluster CR, resolved to postgresql.cnpg.io/v1/Cluster.
11
+ # The (large, deployment-specific) spec is supplied via the block.
12
12
  class Cluster < Kube::Cluster["Cluster"]
13
- def initialize(name: "postgres", namespace: nil, &block)
14
- super() {
15
- metadata.name = name
16
- metadata.namespace = namespace if namespace
17
- instance_exec(&block) if block
18
- }
19
- end
20
13
  end
21
14
  end
22
15
  end
@@ -28,7 +21,8 @@ __END__
28
21
  describe "CloudNativePg::Cluster" do
29
22
  it "initializes without error" do
30
23
  Kube::Cluster::Standard::CloudNativePg::Cluster
31
- .new(name: "postgres", namespace: "cloudnative-pg") {
24
+ .new {
25
+ metadata.name = "postgres"
32
26
  spec.instances = 1
33
27
  spec.storage = { size: "1Gi" }
34
28
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kube
4
4
  module Cluster
5
- VERSION = "1.3.0"
5
+ VERSION = "1.3.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kube_cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan K
@@ -219,7 +219,6 @@ files:
219
219
  - lib/kube/cluster/standard/cloud_native_pg/database_with_external_secret.rb
220
220
  - lib/kube/cluster/standard/cloud_native_pg/external_secret.rb
221
221
  - lib/kube/cluster/standard/cloud_native_pg/helm.rb
222
- - lib/kube/cluster/standard/cloud_native_pg/postgres_cluster.rb
223
222
  - lib/kube/cluster/standard/config_map.rb
224
223
  - lib/kube/cluster/standard/cron_job.rb
225
224
  - lib/kube/cluster/standard/cron_job_with_service_account.rb
@@ -1,128 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/setup"
4
- require "kube/cluster"
5
- require "kube/cluster/standard/cloud_native_pg/cluster"
6
-
7
- module Kube
8
- module Cluster
9
- module Standard
10
- module CloudNativePg
11
- # The standard single-node PostgreSQL cluster: custom image, HA
12
- # replication slots, logical WAL, and barman-cloud WAL archiving.
13
- # Deployment-specific additions (managed roles, extra spec) come via the
14
- # block; databases are separate Database CRs.
15
- class PostgresCluster < Cluster
16
- def initialize(name: "postgres", namespace: nil, &block)
17
- super(name: name, namespace: namespace) {
18
- spec.affinity = { podAntiAffinityType: "preferred" }
19
- spec.bootstrap = {
20
- initdb: {
21
- database: "app",
22
- encoding: "UTF8",
23
- localeCType: "C",
24
- localeCollate: "C",
25
- owner: "app",
26
- },
27
- }
28
- spec.enablePDB = true
29
- spec.enableSuperuserAccess = false
30
- spec.failoverDelay = 0
31
- spec.imageName = "ghcr.io/general-intelligence-systems/postgresql:17-custom"
32
- spec.imagePullPolicy = "Always"
33
- spec.instances = 1
34
- spec.plugins = [{
35
- name: "barman-cloud.cloudnative-pg.io",
36
- isWALArchiver: true,
37
- parameters: { barmanObjectName: "cnpg-backups" },
38
- }]
39
- spec.logLevel = "info"
40
- spec.maxSyncReplicas = 0
41
- spec.minSyncReplicas = 0
42
- spec.monitoring = {
43
- disableDefaultQueries: false,
44
- enablePodMonitor: false,
45
- }
46
- spec.postgresGID = 26
47
- spec.postgresUID = 26
48
- spec.postgresql = {
49
- parameters: {
50
- archive_mode: "on",
51
- archive_timeout: "5min",
52
- dynamic_shared_memory_type: "posix",
53
- full_page_writes: "on",
54
- log_destination: "csvlog",
55
- log_directory: "/controller/log",
56
- log_filename: "postgres",
57
- log_rotation_age: "0",
58
- log_rotation_size: "0",
59
- log_truncate_on_rotation: "false",
60
- logging_collector: "on",
61
- max_parallel_workers: "32",
62
- max_replication_slots: "32",
63
- max_worker_processes: "32",
64
- shared_memory_type: "mmap",
65
- shared_preload_libraries: "",
66
- ssl_max_protocol_version: "TLSv1.3",
67
- ssl_min_protocol_version: "TLSv1.3",
68
- wal_keep_size: "512MB",
69
- wal_level: "logical",
70
- wal_log_hints: "on",
71
- wal_receiver_timeout: "5s",
72
- wal_sender_timeout: "5s",
73
- },
74
- syncReplicaElectionConstraint: {
75
- enabled: false,
76
- },
77
- }
78
- spec.primaryUpdateMethod = "restart"
79
- spec.primaryUpdateStrategy = "unsupervised"
80
- spec.probes = {
81
- liveness: {
82
- isolationCheck: {
83
- connectionTimeout: 1000,
84
- enabled: true,
85
- requestTimeout: 1000,
86
- },
87
- },
88
- }
89
- spec.replicationSlots = {
90
- highAvailability: {
91
- enabled: true,
92
- slotPrefix: "_cnpg_",
93
- },
94
- synchronizeReplicas: {
95
- enabled: true,
96
- },
97
- updateInterval: 30,
98
- }
99
- spec.resources = {}
100
- spec.smartShutdownTimeout = 180
101
- spec.startDelay = 3600
102
- spec.stopDelay = 1800
103
- spec.storage = {
104
- resizeInUseVolumes: true,
105
- size: "5Gi",
106
- }
107
- spec.switchoverDelay = 3600
108
-
109
- instance_exec(&block) if block
110
- }
111
- end
112
- end
113
- end
114
- end
115
- end
116
- end
117
-
118
- __END__
119
-
120
- describe "CloudNativePg::PostgresCluster" do
121
- it "initializes without error" do
122
- Kube::Cluster::Standard::CloudNativePg::PostgresCluster
123
- .new(namespace: "cloudnative-pg")
124
- .to_yaml
125
- .is_a?(String)
126
- .should == true
127
- end
128
- end