From 68f75cc1005c02162799297150349c3243090d0b Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 27 Sep 2023 11:58:34 +0200 Subject: [PATCH 1/7] feat: Support PodDisruptionBudgets --- CHANGELOG.md | 3 +- Cargo.lock | 798 +++++++++--------- Cargo.toml | 2 +- .../zookeeper-operator/templates/roles.yaml | 13 + rust/crd/src/lib.rs | 17 +- rust/operator-binary/Cargo.toml | 3 + rust/operator-binary/src/main.rs | 1 + rust/operator-binary/src/operations/mod.rs | 1 + rust/operator-binary/src/operations/pdb.rs | 105 +++ rust/operator-binary/src/zk_controller.rs | 19 +- tests/templates/kuttl/smoke/10-assert.yaml.j2 | 9 + 11 files changed, 568 insertions(+), 403 deletions(-) create mode 100644 rust/operator-binary/src/operations/mod.rs create mode 100644 rust/operator-binary/src/operations/pdb.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index ec2f4bbc..b4d56028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,12 @@ All notable changes to this project will be documented in this file. - Default stackableVersion to operator version ([#711]). - Configuration overrides for the JVM security properties, such as DNS caching ([#715]). +- Support PodDisruptionBudgets ([#XXX]). ### Changed - `vector` `0.26.0` -> `0.31.0` ([#709]). -- `operator-rs` `0.44.0` -> `0.45.1` ([#711]). +- `operator-rs` `0.44.0` -> `0.51.1` ([#711], [#XXX]). - Let secret-operator handle certificate conversion ([#695]). [#695]: https://github.com/stackabletech/zookeeper-operator/pull/695 diff --git a/Cargo.lock b/Cargo.lock index 47742d72..b4ef63d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -61,24 +61,23 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] name = "anstyle-parse" @@ -100,9 +99,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle", "windows-sys", @@ -110,19 +109,19 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -144,9 +143,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -157,12 +156,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.20.0" @@ -171,9 +164,9 @@ checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bit-set" @@ -198,9 +191,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "built" @@ -215,9 +208,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" @@ -227,9 +220,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cargo-lock" @@ -245,9 +238,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -261,58 +254,56 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "winapi", + "windows-targets", ] [[package]] name = "clap" -version = "4.3.21" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" +checksum = "824956d0dca8334758a5b7f7e50518d66ea319330cbceedcf76905c2f6ab30e3" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.21" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" +checksum = "122ec64120a49b4563ccaedcbea7818d069ed8e9aa6d829b82d8a4128936b2ab" dependencies = [ "anstream", "anstyle", "clap_lex", - "once_cell", "strsim", ] [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "colorchoice" @@ -340,6 +331,16 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -410,7 +411,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -432,7 +433,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -454,9 +455,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "either" @@ -465,96 +466,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] -name = "encoding" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" -dependencies = [ - "encoding-index-japanese", - "encoding-index-korean", - "encoding-index-simpchinese", - "encoding-index-singlebyte", - "encoding-index-tradchinese", -] - -[[package]] -name = "encoding-index-japanese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-korean" -version = "1.20141219.5" +name = "encoding_rs" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-simpchinese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-singlebyte" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-tradchinese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" -dependencies = [ - "encoding_index_tests", + "cfg-if", ] -[[package]] -name = "encoding_index_tests" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" - [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "failure" version = "0.1.8" @@ -579,9 +504,9 @@ dependencies = [ [[package]] name = "fancy-regex" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95b4efe5be9104a4a18a9916e86654319895138be727b229820c39257c30dda" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ "bit-set", "regex", @@ -593,21 +518,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.0" @@ -679,7 +589,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -694,6 +604,12 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.28" @@ -726,9 +642,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git2" @@ -743,6 +659,12 @@ dependencies = [ "url", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "hashbrown" version = "0.12.3" @@ -767,9 +689,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "home" @@ -816,9 +738,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" @@ -836,7 +758,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -844,21 +766,19 @@ dependencies = [ ] [[package]] -name = "hyper-openssl" -version = "0.9.2" +name = "hyper-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ee5d7a8f718585d1c3c61dfde28ef5b0bb14734b4db13f5ada856cdc6c612b" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", - "linked_hash_set", - "once_cell", - "openssl", - "openssl-sys", - "parking_lot", + "log", + "rustls", + "rustls-native-certs", "tokio", - "tokio-openssl", - "tower-layer", + "tokio-rustls", ] [[package]] @@ -947,17 +867,6 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix", - "windows-sys", -] - [[package]] name = "itoa" version = "1.0.9" @@ -966,11 +875,11 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "java-properties" -version = "1.4.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1904d8654a1ef51034d02d5a9411b50bf91bea15b0ab644ae179d1325976263" +checksum = "37bf6f484471c451f2b51eabd9e66b3fa7274550c5ec4b6c3d6070840945117f" dependencies = [ - "encoding", + "encoding_rs", "lazy_static", "regex", ] @@ -995,9 +904,9 @@ dependencies = [ [[package]] name = "json-patch" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f54898088ccb91df1b492cc80029a6fdf1c48ca0db7c6822a8babad69c94658" +checksum = "4f7765dccf8c39c3a470fc694efe322969d791e713ca46bc7b5c506886157572" dependencies = [ "serde", "serde_json", @@ -1018,11 +927,11 @@ dependencies = [ [[package]] name = "k8s-openapi" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95578de7d6eac4fba42114bc751e38c59a739968769df1be56feba6f17fd148e" +checksum = "edc3606fd16aca7989db2f84bb25684d0270c6d6fa1dbcd0025af7b4130523a6" dependencies = [ - "base64 0.21.2", + "base64 0.21.4", "bytes", "chrono", "schemars", @@ -1033,9 +942,9 @@ dependencies = [ [[package]] name = "kube" -version = "0.85.0" +version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a189cb8721a47de68d883040713bbb9c956763d784fcf066828018d32c180b96" +checksum = "f8647c2211a9b480d910b155d573602c52cd5f646acecb06a03d594865dc4784" dependencies = [ "k8s-openapi", "kube-client", @@ -1046,9 +955,9 @@ dependencies = [ [[package]] name = "kube-client" -version = "0.85.0" +version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98989b6e1f27695afe22aa29c94136fa06be5e8d28b91222e6dfbe5a460c803f" +checksum = "af8952521f3e8ce11920229e5f2965fef70525aecd9efc7b65e39bf9e2c6f66d" dependencies = [ "base64 0.20.0", "bytes", @@ -1059,18 +968,19 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-openssl", + "hyper-rustls", "hyper-timeout", "jsonpath_lib", "k8s-openapi", "kube-core", - "openssl", "pem", "pin-project", + "rustls", + "rustls-pemfile", "secrecy", "serde", "serde_json", - "serde_yaml 0.9.25", + "serde_yaml", "thiserror", "tokio", "tokio-util", @@ -1081,9 +991,9 @@ dependencies = [ [[package]] name = "kube-core" -version = "0.85.0" +version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c24d23bf764ec9a5652f943442ff062b91fd52318ea6d2fc11115f19d8c84d13" +checksum = "7608a0cd05dfa36167d2da982bb70f17feb5450f73ec601f6d428bbcf991c5b9" dependencies = [ "chrono", "form_urlencoded", @@ -1099,9 +1009,9 @@ dependencies = [ [[package]] name = "kube-derive" -version = "0.85.0" +version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bbec4da219dcb02bb32afd762a7ac4dffd47ed92b7e35ac9a7b961d21327117" +checksum = "a8dd623cf49cd632da4727a70e05d9cb948d5ea1098a1af49b1fd3bc9ec60b3c" dependencies = [ "darling 0.14.4", "proc-macro2", @@ -1112,9 +1022,9 @@ dependencies = [ [[package]] name = "kube-runtime" -version = "0.85.0" +version = "0.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381224caa8a6fc16f8251cf1fd6d8678cdf5366f33000a923e4c54192e4b25b5" +checksum = "fde2bd0b2d248be72f30c658b728f87e84c68495bec2c689dff7a3479eb29afd" dependencies = [ "ahash", "async-trait", @@ -1144,9 +1054,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libgit2-sys" @@ -1172,27 +1082,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linked_hash_set" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" - [[package]] name = "lock_api" version = "0.4.10" @@ -1205,9 +1094,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matchers" @@ -1220,9 +1109,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "mime" @@ -1281,9 +1170,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1295,42 +1184,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "openssl" -version = "0.10.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.28", -] - -[[package]] -name = "openssl-sys" -version = "0.9.91" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "opentelemetry" @@ -1395,7 +1252,7 @@ dependencies = [ "futures-util", "once_cell", "opentelemetry_api", - "ordered-float 3.7.0", + "ordered-float 3.9.1", "percent-encoding", "rand", "regex", @@ -1415,9 +1272,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "3.7.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc2dbde8f8a79f2102cc474ceb0ad68e3b80b85289ea62389b60e66777e4213" +checksum = "2a54938017eacd63036332b4ae5c8a49fc8c0c1d6d629893057e4f13609edd06" dependencies = [ "num-traits", ] @@ -1453,11 +1310,12 @@ dependencies = [ [[package]] name = "pem" -version = "1.1.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +checksum = "3163d2912b7c3b52d651a055f2c7eec9ba5cd22d26ef75b8dd3a59980b185923" dependencies = [ - "base64 0.13.1", + "base64 0.21.4", + "serde", ] [[package]] @@ -1483,14 +1341,14 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] name = "pin-project-lite" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1512,17 +1370,17 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] [[package]] name = "product-config" -version = "0.4.0" -source = "git+https://github.com/stackabletech/product-config.git?tag=0.4.0#e1e5938b4f6120f85a088194e86d22433fdba731" +version = "0.5.0" +source = "git+https://github.com/stackabletech/product-config.git?tag=0.5.0#439869d9e6a72fb6d912f6e494649a2f74f41d25" dependencies = [ "fancy-regex", "java-properties", @@ -1530,16 +1388,16 @@ dependencies = [ "semver", "serde", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "thiserror", "xml-rs", ] [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1585,14 +1443,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.3" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.6", - "regex-syntax 0.7.4", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -1606,13 +1464,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -1623,9 +1481,59 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "relative-path" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rstest" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "97eeab2f3c0a199bc4be135c36c924b6590b88c377d416494288c14f2db30199" +dependencies = [ + "futures 0.3.28", + "futures-timer", + "rstest_macros", + "rustc_version", +] + +[[package]] +name = "rstest_macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605" +dependencies = [ + "cfg-if", + "glob", + "proc-macro2", + "quote", + "regex", + "relative-path", + "rustc_version", + "syn 2.0.37", + "unicode-ident", +] [[package]] name = "rustc-demangle" @@ -1634,16 +1542,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] -name = "rustix" -version = "0.38.7" +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "bitflags 2.3.3", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", + "semver", +] + +[[package]] +name = "rustls" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.4", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -1658,11 +1605,20 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys", +] + [[package]] name = "schemars" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" dependencies = [ "dyn-clone", "schemars_derive", @@ -1672,9 +1628,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.12" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" dependencies = [ "proc-macro2", "quote", @@ -1688,6 +1644,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "secrecy" version = "0.8.0" @@ -1698,20 +1664,43 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -1728,13 +1717,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -1750,9 +1739,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "indexmap 2.0.0", "itoa", @@ -1769,18 +1758,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" -dependencies = [ - "indexmap 1.9.3", - "ryu", - "serde", - "yaml-rust", -] - [[package]] name = "serde_yaml" version = "0.9.25" @@ -1814,9 +1791,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -1829,9 +1806,9 @@ checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "snafu" @@ -1865,10 +1842,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "stackable-operator" -version = "0.46.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.46.0#c88fbe2c5692b773af23b9680d42df00099cf074" +version = "0.51.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.51.1#042642c1e7dac1fdc616de66106e9190478994b8" dependencies = [ "chrono", "clap", @@ -1888,7 +1881,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "serde_yaml 0.9.25", + "serde_yaml", "snafu", "stackable-operator-derive", "strum", @@ -1901,13 +1894,13 @@ dependencies = [ [[package]] name = "stackable-operator-derive" -version = "0.46.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.46.0#c88fbe2c5692b773af23b9680d42df00099cf074" +version = "0.51.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.51.1#042642c1e7dac1fdc616de66106e9190478994b8" dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -1916,7 +1909,7 @@ version = "0.0.0-dev" dependencies = [ "serde", "serde_json", - "serde_yaml 0.9.25", + "serde_yaml", "snafu", "stackable-operator", "strum", @@ -1934,6 +1927,7 @@ dependencies = [ "fnv", "futures 0.3.28", "pin-project", + "rstest", "semver", "serde", "snafu", @@ -1970,7 +1964,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -1986,9 +1980,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -2009,22 +2003,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -2076,11 +2070,10 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", @@ -2089,7 +2082,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.4", "tokio-macros", "windows-sys", ] @@ -2112,18 +2105,16 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] -name = "tokio-openssl" -version = "0.6.3" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08f9ffb7809f1b20c1b398d92acf4cc719874b3b2b2d9ea2f09b4a80350878a" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "futures-util", - "openssl", - "openssl-sys", + "rustls", "tokio", ] @@ -2140,9 +2131,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -2171,9 +2162,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -2192,9 +2183,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", "serde", @@ -2222,12 +2213,12 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "base64 0.21.2", - "bitflags 2.3.3", + "base64 0.21.4", + "bitflags 2.4.0", "bytes", "futures-core", "futures-util", @@ -2274,7 +2265,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", ] [[package]] @@ -2300,12 +2291,14 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc09e402904a5261e42cf27aea09ccb7d5318c6717a9eec3d8e2e65c56b18f19" +checksum = "75327c6b667828ddc28f5e3f169036cb793c3f588d83bf0f262a7f062ffed3c8" dependencies = [ "once_cell", "opentelemetry", + "opentelemetry_sdk", + "smallvec", "tracing", "tracing-core", "tracing-log", @@ -2353,9 +2346,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -2378,11 +2371,17 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -2455,7 +2454,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -2477,7 +2476,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2488,6 +2487,16 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2530,9 +2539,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -2545,69 +2554,60 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.4" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] [[package]] name = "xml-rs" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "zeroize" diff --git a/Cargo.toml b/Cargo.toml index 3c625d88..85f872af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" snafu = "0.7" -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.46.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.51.1" } strum = { version = "0.25", features = ["derive"] } tokio = { version = "1.29", features = ["full"] } tokio-zookeeper = "0.2" diff --git a/deploy/helm/zookeeper-operator/templates/roles.yaml b/deploy/helm/zookeeper-operator/templates/roles.yaml index 69d1edfb..11c0b82b 100644 --- a/deploy/helm/zookeeper-operator/templates/roles.yaml +++ b/deploy/helm/zookeeper-operator/templates/roles.yaml @@ -66,6 +66,19 @@ rules: - jobs verbs: - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - create + - delete - get - list - patch diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 21d2609e..507687f7 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -29,7 +29,7 @@ use stackable_operator::{ memory::{BinaryMultiple, MemoryQuantity}, product_config_utils::{ConfigError, Configuration}, product_logging::{self, spec::Logging}, - role_utils::{Role, RoleGroup, RoleGroupRef}, + role_utils::{Role, RoleConfig, RoleGroup, RoleGroupRef}, schemars::{self, JsonSchema}, status::condition::{ClusterCondition, HasStatusCondition}, }; @@ -519,6 +519,21 @@ impl ZookeeperCluster { } } + pub fn role_config(&self, role: &ZookeeperRole) -> Option<&RoleConfig> { + match role { + ZookeeperRole::Server => self.spec.servers.as_ref().map(|s| &s.role_config), + } + } + + pub fn num_servers(&self) -> u16 { + self.spec + .servers + .iter() + .flat_map(|s| s.role_groups.values()) + .map(|rg| rg.replicas.unwrap_or(1)) + .sum() + } + /// List all pods expected to form the cluster /// /// We try to predict the pods here rather than looking at the current cluster state in order to diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index fb5bfb44..fde120dd 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -27,5 +27,8 @@ tracing.workspace = true pin-project.workspace = true stackable-operator.workspace = true +[dev-dependencies] +rstest.workspace = true + [build-dependencies] built.workspace = true diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index f033d480..0b8ffb56 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,5 +1,6 @@ mod command; mod discovery; +mod operations; mod product_logging; mod utils; mod zk_controller; diff --git a/rust/operator-binary/src/operations/mod.rs b/rust/operator-binary/src/operations/mod.rs new file mode 100644 index 00000000..d3cf6e9c --- /dev/null +++ b/rust/operator-binary/src/operations/mod.rs @@ -0,0 +1 @@ +pub mod pdb; diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs new file mode 100644 index 00000000..3b6513d2 --- /dev/null +++ b/rust/operator-binary/src/operations/pdb.rs @@ -0,0 +1,105 @@ +use std::cmp::max; + +use snafu::{ResultExt, Snafu}; +use stackable_operator::{ + builder::pdb::PodDisruptionBudgetBuilder, client::Client, cluster_resources::ClusterResources, + commons::pdb::PdbConfig, kube::ResourceExt, +}; +use stackable_zookeeper_crd::{ZookeeperCluster, ZookeeperRole, APP_NAME, OPERATOR_NAME}; + +use crate::zk_controller::ZK_CONTROLLER_NAME; + +#[derive(Snafu, Debug)] +pub enum Error { + #[snafu(display("Cannot create PodDisruptionBudget for role [{role}]"))] + CreatePdb { + source: stackable_operator::error::Error, + role: String, + }, + #[snafu(display("Cannot apply role group PodDisruptionBudget [{name}]"))] + ApplyPdb { + source: stackable_operator::error::Error, + name: String, + }, +} + +pub async fn add_pdbs( + pdb: &PdbConfig, + zookeeper: &ZookeeperCluster, + role: &ZookeeperRole, + client: &Client, + cluster_resources: &mut ClusterResources, +) -> Result<(), Error> { + if !pdb.enabled { + return Ok(()); + } + let max_unavailable = pdb.max_unavailable.unwrap_or(match role { + ZookeeperRole::Server => max_unavailable_servers(zookeeper.num_servers()), + }); + let pdb = PodDisruptionBudgetBuilder::new_with_role( + zookeeper, + APP_NAME, + &role.to_string(), + OPERATOR_NAME, + ZK_CONTROLLER_NAME, + ) + .with_context(|_| CreatePdbSnafu { + role: role.to_string(), + })? + .with_max_unavailable(max_unavailable) + .build(); + let pdb_name = pdb.name_any(); + cluster_resources + .add(client, pdb) + .await + .with_context(|_| ApplyPdbSnafu { name: pdb_name })?; + + Ok(()) +} + +fn max_unavailable_servers(num_servers: u16) -> u16 { + // Minimum required amount of servers to form quorum. + let quorum_size = quorum_size(num_servers); + + // Subtract once to not cause a single point of failure + let max_unavailable = num_servers.saturating_sub(quorum_size).saturating_sub(1); + + // Clamp to at least a single node allowed to being, to not block Kubernetes nodes from draining. + max(max_unavailable, 1) +} + +fn quorum_size(num_servers: u16) -> u16 { + max((num_servers as f32 / 2.0).ceil() as u16, 1) +} + +#[cfg(test)] +mod test { + use super::*; + use rstest::rstest; + + #[rstest] + #[case(0, 1, 1)] + #[case(1, 1, 1)] + #[case(2, 1, 1)] + #[case(3, 2, 1)] + #[case(4, 2, 1)] + #[case(5, 3, 1)] + #[case(6, 3, 2)] + #[case(7, 4, 2)] + #[case(8, 4, 3)] + #[case(9, 5, 3)] + #[case(10, 5, 4)] + #[case(20, 10, 9)] + #[case(100, 50, 49)] + + fn test_max_unavailable_servers( + #[case] num_servers: u16, + #[case] expected_quorum_size: u16, + #[case] expected_max_unavailable: u16, + ) { + let quorum_size = quorum_size(num_servers); + let max_unavailable = max_unavailable_servers(num_servers); + assert_eq!(quorum_size, expected_quorum_size); + assert_eq!(max_unavailable, expected_max_unavailable); + } +} diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index d54b4862..4ded8c05 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -2,6 +2,7 @@ use crate::{ command::create_init_container_command_args, discovery::{self, build_discovery_configmaps}, + operations::pdb::add_pdbs, product_logging::{extend_role_group_config_map, resolve_vector_aggregator_address}, utils::build_recommended_labels, ObjectRef, APP_NAME, OPERATOR_NAME, @@ -45,7 +46,7 @@ use stackable_operator::{ CustomContainerLogConfig, }, }, - role_utils::RoleGroupRef, + role_utils::{RoleConfig, RoleGroupRef}, status::condition::{ compute_conditions, operations::ClusterOperationsConditionBuilder, statefulset::StatefulSetConditionBuilder, @@ -188,7 +189,12 @@ pub enum Error { FailedToResolveConfig { source: stackable_zookeeper_crd::Error, }, + #[snafu(display("failed to create PodDisruptionBudget"))] + FailedToCreatePdb { + source: crate::operations::pdb::Error, + }, } + type Result = std::result::Result; impl ReconcilerError for Error { @@ -224,6 +230,7 @@ impl ReconcilerError for Error { Error::InvalidLoggingConfig { .. } => None, Error::FailedToInitializeSecurityContext { .. } => None, Error::FailedToResolveConfig { .. } => None, + Error::FailedToCreatePdb { .. } => None, } } } @@ -361,6 +368,16 @@ pub async fn reconcile_zk(zk: Arc, ctx: Arc) -> Result Date: Wed, 27 Sep 2023 12:07:37 +0200 Subject: [PATCH 2/7] add docs --- .../operations/cluster-operations.adoc | 4 + .../operations/graceful-shutdown.adoc | 7 ++ .../pages/usage_guide/operations/index.adoc | 5 ++ .../operations/pod-disruptions.adoc | 78 +++++++++++++++++++ .../pod-placement.adoc} | 4 +- docs/modules/zookeeper/partials/nav.adoc | 9 ++- rust/operator-binary/src/operations/pdb.rs | 2 +- 7 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 docs/modules/zookeeper/pages/usage_guide/operations/cluster-operations.adoc create mode 100644 docs/modules/zookeeper/pages/usage_guide/operations/graceful-shutdown.adoc create mode 100644 docs/modules/zookeeper/pages/usage_guide/operations/index.adoc create mode 100644 docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc rename docs/modules/zookeeper/pages/usage_guide/{pod_placement.adoc => operations/pod-placement.adoc} (69%) diff --git a/docs/modules/zookeeper/pages/usage_guide/operations/cluster-operations.adoc b/docs/modules/zookeeper/pages/usage_guide/operations/cluster-operations.adoc new file mode 100644 index 00000000..c73f91cc --- /dev/null +++ b/docs/modules/zookeeper/pages/usage_guide/operations/cluster-operations.adoc @@ -0,0 +1,4 @@ + += Cluster Operation + +The managed ZooKeeper instances can be configured with different cluster operations like pausing reconciliation or stopping the cluster. See xref:concepts:operations/cluster_operations.adoc[cluster operations] for more details. diff --git a/docs/modules/zookeeper/pages/usage_guide/operations/graceful-shutdown.adoc b/docs/modules/zookeeper/pages/usage_guide/operations/graceful-shutdown.adoc new file mode 100644 index 00000000..fb9689f5 --- /dev/null +++ b/docs/modules/zookeeper/pages/usage_guide/operations/graceful-shutdown.adoc @@ -0,0 +1,7 @@ += Graceful shutdown + +Graceful shutdown of Zookeeper nodes is either not supported by the product itself +or we have not implemented it yet. + +The efforts of implementing graceful shutdown for all products that have this functionality is tracked in +https://github.com/stackabletech/issues/issues/357 diff --git a/docs/modules/zookeeper/pages/usage_guide/operations/index.adoc b/docs/modules/zookeeper/pages/usage_guide/operations/index.adoc new file mode 100644 index 00000000..e73f5be4 --- /dev/null +++ b/docs/modules/zookeeper/pages/usage_guide/operations/index.adoc @@ -0,0 +1,5 @@ += Operations + +This section of the documentation is intended for the operations teams that maintain a Stackable Data Platform installation. + +Please read on the xref:concepts:operations/index.adoc[Concepts page on Operations] with the necessary details to operate the platform in a production environment. diff --git a/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc b/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc new file mode 100644 index 00000000..79371875 --- /dev/null +++ b/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc @@ -0,0 +1,78 @@ += Allowed Pod disruptions + +You can configure the allowed Pod disruptions for Zookeeper nodes as described in xref:concepts:operations/pod_disruptions.adoc[]. + +Unless you configure something else or disable our PodDisruptionBudgets (PDBs), we write the following PDBs: + +== Servers + +Zookeeper servers need a certain number of nodes to be available to form a quorum to serve client requests. + +Taking this into consideration, our operator uses the following algorithm to determine the maximum number of servers allowed to be unavailable at the same time: + +`num_servers` is the number of server in the Zookeeper cluster, summed over all `roleGroups`. + +[source,rust] +---- +// Minimum required amount of servers to form quorum. +let quorum_size = quorum_size(num_servers); + +// Subtract once to not cause a single point of failure +let max_unavailable = num_servers.saturating_sub(quorum_size).saturating_sub(1); + +// Clamp to at least a single node allowed to be offline, so we don't block Kubernetes nodes from draining. +let max_unavailable = max(max_unavailable, 1) +---- + +This results e.g. in the following numbers: + +[cols="1,1,1"] +|=== +|Number of servers +|Quorum size +|Maximum unavailable servers + +|1 +|1 +|1 + +|2 +|1 +|1 + +|3 +|2 +|1 + +|4 +|2 +|1 + +|5 +|3 +|1 + +|6 +|3 +|2 + +|7 +|4 +|2 + +|8 +|4 +|3 + +|9 +|5 +|3 + +|10 +|5 +|4 + +|20 +|10 +|9 +|=== diff --git a/docs/modules/zookeeper/pages/usage_guide/pod_placement.adoc b/docs/modules/zookeeper/pages/usage_guide/operations/pod-placement.adoc similarity index 69% rename from docs/modules/zookeeper/pages/usage_guide/pod_placement.adoc rename to docs/modules/zookeeper/pages/usage_guide/operations/pod-placement.adoc index 43bcc3c5..b9797339 100644 --- a/docs/modules/zookeeper/pages/usage_guide/pod_placement.adoc +++ b/docs/modules/zookeeper/pages/usage_guide/operations/pod-placement.adoc @@ -1,6 +1,6 @@ -= Pod Placement += Pod placement -You can configure the Pod placement of the ZooKeeper pods as described in xref:concepts:pod_placement.adoc[]. +You can configure the Pod placement of the ZooKeeper pods as described in xref:concepts:operations/pod_placement.adoc[]. The default affinities created by the operator are: diff --git a/docs/modules/zookeeper/partials/nav.adoc b/docs/modules/zookeeper/partials/nav.adoc index 2d658ef5..3f59fd7c 100644 --- a/docs/modules/zookeeper/partials/nav.adoc +++ b/docs/modules/zookeeper/partials/nav.adoc @@ -1,11 +1,11 @@ * xref:zookeeper:getting_started/index.adoc[] ** xref:zookeeper:getting_started/installation.adoc[] ** xref:zookeeper:getting_started/first_steps.adoc[] +* xref:zookeeper:configuration.adoc[] * Concepts ** xref:zookeeper:znodes.adoc[] ** xref:zookeeper:discovery.adoc[] * xref:zookeeper:usage_guide/index.adoc[] -** xref:zookeeper:usage_guide/pod_placement.adoc[] ** xref:zookeeper:usage_guide/listenerclass.adoc[] ** xref:zookeeper:usage_guide/encryption.adoc[] ** xref:zookeeper:usage_guide/authentication.adoc[] @@ -15,5 +15,8 @@ ** xref:zookeeper:usage_guide/using_multiple_role_groups.adoc[] ** xref:zookeeper:usage_guide/isolating_clients_with_znodes.adoc[] ** xref:zookeeper:usage_guide/configuration_environment_overrides.adoc[] -** xref:zookeeper:usage_guide/cluster_operations.adoc[] -* xref:zookeeper:configuration.adoc[] +** xref:zookeeper:usage_guide/operations/index.adoc[] +*** xref:zookeeper:usage_guide/operations/cluster-operations.adoc[] +*** xref:zookeeper:usage_guide/operations/pod-placement.adoc[] +*** xref:zookeeper:usage_guide/operations/pod-disruptions.adoc[] +*** xref:zookeeper:usage_guide/operations/graceful-shutdown.adoc[] diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index 3b6513d2..7e5aa947 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -64,7 +64,7 @@ fn max_unavailable_servers(num_servers: u16) -> u16 { // Subtract once to not cause a single point of failure let max_unavailable = num_servers.saturating_sub(quorum_size).saturating_sub(1); - // Clamp to at least a single node allowed to being, to not block Kubernetes nodes from draining. + // Clamp to at least a single node allowed to be offline, so we don't block Kubernetes nodes from draining. max(max_unavailable, 1) } From 3b9ead098ee5b6219d3dbcd8f7372ac33d9a8622 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 27 Sep 2023 12:16:45 +0200 Subject: [PATCH 3/7] changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4d56028..5999e370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,18 +8,19 @@ All notable changes to this project will be documented in this file. - Default stackableVersion to operator version ([#711]). - Configuration overrides for the JVM security properties, such as DNS caching ([#715]). -- Support PodDisruptionBudgets ([#XXX]). +- Support PodDisruptionBudgets ([#730]). ### Changed - `vector` `0.26.0` -> `0.31.0` ([#709]). -- `operator-rs` `0.44.0` -> `0.51.1` ([#711], [#XXX]). +- `operator-rs` `0.44.0` -> `0.51.1` ([#711], [#730]). - Let secret-operator handle certificate conversion ([#695]). [#695]: https://github.com/stackabletech/zookeeper-operator/pull/695 [#709]: https://github.com/stackabletech/zookeeper-operator/pull/709 [#711]: https://github.com/stackabletech/zookeeper-operator/pull/711 [#715]: https://github.com/stackabletech/zookeeper-operator/pull/715 +[#730]: https://github.com/stackabletech/zookeeper-operator/pull/730 ## [23.7.0] - 2023-07-14 From 2c343d762b22e09613f264c519a101df59d00a7a Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 27 Sep 2023 13:21:58 +0200 Subject: [PATCH 4/7] fix calculation --- .../operations/pod-disruptions.adoc | 28 ++++++++++++------- rust/operator-binary/src/operations/pdb.rs | 18 ++++++------ 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc b/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc index 79371875..90e0361d 100644 --- a/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc +++ b/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc @@ -14,6 +14,12 @@ Taking this into consideration, our operator uses the following algorithm to det [source,rust] ---- +fn quorum_size(num_servers: u16) -> u16 { + // Same as max((num_servers / 2) + 1, 1), but without the need for floating point arithmetics, + // which are subject to rounding errors. + max((num_servers + 2) / 2, 1) +} + // Minimum required amount of servers to form quorum. let quorum_size = quorum_size(num_servers); @@ -26,6 +32,8 @@ let max_unavailable = max(max_unavailable, 1) This results e.g. in the following numbers: +TIP: It is strongly recommended to use a odd number of servers (e.g. 3, 5 or 7). + [cols="1,1,1"] |=== |Number of servers @@ -37,7 +45,7 @@ This results e.g. in the following numbers: |1 |2 -|1 +|2 |1 |3 @@ -45,7 +53,7 @@ This results e.g. in the following numbers: |1 |4 -|2 +|3 |1 |5 @@ -53,26 +61,26 @@ This results e.g. in the following numbers: |1 |6 -|3 -|2 +|4 +|1 |7 |4 |2 |8 -|4 -|3 +|5 +|2 |9 |5 |3 |10 -|5 -|4 +|6 +|3 |20 -|10 -|9 +|11 +|8 |=== diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index 7e5aa947..780d5152 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -69,7 +69,9 @@ fn max_unavailable_servers(num_servers: u16) -> u16 { } fn quorum_size(num_servers: u16) -> u16 { - max((num_servers as f32 / 2.0).ceil() as u16, 1) + // Same as max((num_servers / 2) + 1, 1), but without the need for floating point arithmetics, + // which are subject to rounding errors. + max((num_servers + 2) / 2, 1) } #[cfg(test)] @@ -80,17 +82,17 @@ mod test { #[rstest] #[case(0, 1, 1)] #[case(1, 1, 1)] - #[case(2, 1, 1)] + #[case(2, 2, 1)] #[case(3, 2, 1)] - #[case(4, 2, 1)] + #[case(4, 3, 1)] #[case(5, 3, 1)] - #[case(6, 3, 2)] + #[case(6, 4, 1)] #[case(7, 4, 2)] - #[case(8, 4, 3)] + #[case(8, 5, 2)] #[case(9, 5, 3)] - #[case(10, 5, 4)] - #[case(20, 10, 9)] - #[case(100, 50, 49)] + #[case(10, 6, 3)] + #[case(20, 11, 8)] + #[case(100, 51, 48)] fn test_max_unavailable_servers( #[case] num_servers: u16, From ec02f63e4bb85524ce97d374624bf510008207c5 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 27 Sep 2023 14:04:27 +0200 Subject: [PATCH 5/7] fix error message --- rust/operator-binary/src/operations/pdb.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index 780d5152..e7e3a658 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -16,7 +16,7 @@ pub enum Error { source: stackable_operator::error::Error, role: String, }, - #[snafu(display("Cannot apply role group PodDisruptionBudget [{name}]"))] + #[snafu(display("Cannot apply PodDisruptionBudget [{name}]"))] ApplyPdb { source: stackable_operator::error::Error, name: String, From 9406191258f1c66181b58529f2c089907a6dfa1e Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 27 Sep 2023 14:05:17 +0200 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Malte Sander --- .../pages/usage_guide/operations/pod-disruptions.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc b/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc index 90e0361d..204524a3 100644 --- a/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc +++ b/docs/modules/zookeeper/pages/usage_guide/operations/pod-disruptions.adoc @@ -23,7 +23,7 @@ fn quorum_size(num_servers: u16) -> u16 { // Minimum required amount of servers to form quorum. let quorum_size = quorum_size(num_servers); -// Subtract once to not cause a single point of failure +// Subtract one to not cause a single point of failure let max_unavailable = num_servers.saturating_sub(quorum_size).saturating_sub(1); // Clamp to at least a single node allowed to be offline, so we don't block Kubernetes nodes from draining. @@ -32,7 +32,7 @@ let max_unavailable = max(max_unavailable, 1) This results e.g. in the following numbers: -TIP: It is strongly recommended to use a odd number of servers (e.g. 3, 5 or 7). +TIP: It is strongly recommended to use an odd number of servers (e.g. 3, 5 or 7). [cols="1,1,1"] |=== From b337a932430ecd74edb874c297feb62d3cbf5af0 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 27 Sep 2023 14:10:06 +0200 Subject: [PATCH 7/7] charts --- deploy/helm/zookeeper-operator/crds/crds.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/deploy/helm/zookeeper-operator/crds/crds.yaml b/deploy/helm/zookeeper-operator/crds/crds.yaml index 4c943517..a168bf0a 100644 --- a/deploy/helm/zookeeper-operator/crds/crds.yaml +++ b/deploy/helm/zookeeper-operator/crds/crds.yaml @@ -1549,6 +1549,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -2076,6 +2078,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -2609,6 +2613,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -3616,6 +3622,29 @@ spec: type: array type: object type: object + roleConfig: + default: + podDisruptionBudget: + enabled: true + maxUnavailable: null + properties: + podDisruptionBudget: + default: + enabled: true + maxUnavailable: null + properties: + enabled: + default: true + description: Whether a PodDisruptionBudget should be written out for this role. Disabling this enables you to specify your own - custom - one. Defaults to true. + type: boolean + maxUnavailable: + description: The number of Pods that are allowed to be down because of voluntary disruptions. If you don't explicitly set this, the operator will use a sane default based upon knowledge about the individual product. + format: uint16 + minimum: 0.0 + nullable: true + type: integer + type: object + type: object roleGroups: additionalProperties: properties: @@ -5014,6 +5043,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -5541,6 +5572,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -6074,6 +6107,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: