From 700e4466f0ad5993080009291deff30145946b17 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 09:05:18 +0200 Subject: [PATCH 01/13] feat: Support PodDisruptionBudgets --- CHANGELOG.md | 3 +- Cargo.lock | 536 +++++++++--------- Cargo.toml | 2 +- deploy/helm/hbase-operator/crds/crds.yaml | 105 ++++ .../helm/hbase-operator/templates/roles.yaml | 12 + .../{ => concepts}/cluster-operations.adoc | 4 +- .../concepts/graceful-shutdown.adoc | 7 + .../pages/usage-guide/concepts/index.adoc | 5 + .../usage-guide/concepts/pod-disruptions.adoc | 3 + .../{ => concepts}/pod-placement.adoc | 2 +- docs/modules/hbase/partials/nav.adoc | 7 +- rust/crd/src/lib.rs | 10 +- rust/operator-binary/src/hbase_controller.rs | 29 +- rust/operator-binary/src/main.rs | 1 + rust/operator-binary/src/operations/mod.rs | 1 + rust/operator-binary/src/operations/pdb.rs | 75 +++ 16 files changed, 514 insertions(+), 288 deletions(-) rename docs/modules/hbase/pages/usage-guide/{ => concepts}/cluster-operations.adoc (53%) create mode 100644 docs/modules/hbase/pages/usage-guide/concepts/graceful-shutdown.adoc create mode 100644 docs/modules/hbase/pages/usage-guide/concepts/index.adoc create mode 100644 docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc rename docs/modules/hbase/pages/usage-guide/{ => concepts}/pod-placement.adoc (98%) 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 09f73b25..f627c289 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,12 @@ - Default stackableVersion to operator version ([#385]). - Configuration overrides for the JVM security properties, such as DNS caching ([#389]). +- Support PodDisruptionBudgets ([#XXX]). ### Changed - `vector` `0.26.0` -> `0.31.0` ([#382]). -- `operator-rs` `0.44.0` -> `0.45.1` ([#385]). +- `operator-rs` `0.44.0` -> `0.51.1` ([#385], [#XXX]). ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 2cee95df..c8ad5514 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -75,9 +75,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] name = "anstyle-parse" @@ -121,7 +121,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -156,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" @@ -214,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" @@ -260,9 +254,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", @@ -273,9 +267,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.2" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +checksum = "824956d0dca8334758a5b7f7e50518d66ea319330cbceedcf76905c2f6ab30e3" dependencies = [ "clap_builder", "clap_derive", @@ -283,9 +277,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "122ec64120a49b4563ccaedcbea7818d069ed8e9aa6d829b82d8a4128936b2ab" dependencies = [ "anstream", "anstyle", @@ -302,7 +296,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -337,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" @@ -407,7 +411,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -429,7 +433,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -451,9 +455,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" [[package]] name = "either" @@ -462,69 +466,14 @@ 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" @@ -533,9 +482,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[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", @@ -547,21 +496,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" @@ -633,7 +567,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -733,9 +667,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" @@ -810,21 +744,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]] @@ -890,9 +822,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" dependencies = [ "equivalent", "hashbrown 0.14.0", @@ -921,11 +853,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", ] @@ -950,9 +882,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", @@ -973,9 +905,9 @@ 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.4", "bytes", @@ -988,9 +920,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", @@ -1001,9 +933,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", @@ -1014,18 +946,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", @@ -1036,9 +969,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", @@ -1054,9 +987,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", @@ -1067,9 +1000,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", @@ -1099,9 +1032,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" @@ -1127,21 +1060,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 = "lock_api" version = "0.4.10" @@ -1244,42 +1162,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "openssl" -version = "0.10.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" -dependencies = [ - "bitflags 2.4.0", - "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.32", -] - -[[package]] -name = "openssl-sys" -version = "0.9.93" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "opentelemetry" @@ -1402,11 +1288,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]] @@ -1432,7 +1319,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -1461,17 +1348,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", @@ -1479,7 +1366,7 @@ dependencies = [ "semver", "serde", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "thiserror", "xml-rs", ] @@ -1582,6 +1469,21 @@ 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" @@ -1607,7 +1509,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.32", + "syn 2.0.37", "unicode-ident", ] @@ -1626,6 +1528,49 @@ dependencies = [ "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]] name = "rustversion" version = "1.0.14" @@ -1638,11 +1583,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.13" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" +checksum = "1f7b0ce13155372a76ee2e1c5ffba1fe61ede73fbea5630d61eee6fac4929c0c" dependencies = [ "dyn-clone", "schemars_derive", @@ -1652,9 +1606,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.13" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" +checksum = "e85e2a16b12bdb763244c69ab79363d71db2b4b918a2def53f80b02e0574b13c" dependencies = [ "proc-macro2", "quote", @@ -1668,6 +1622,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" @@ -1678,20 +1642,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", ] @@ -1708,13 +1695,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.32", + "syn 2.0.37", ] [[package]] @@ -1730,11 +1717,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.1", "itoa", "ryu", "serde", @@ -1749,25 +1736,13 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.1", "itoa", "ryu", "serde", @@ -1776,9 +1751,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" dependencies = [ "lazy_static", ] @@ -1803,9 +1778,9 @@ dependencies = [ [[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" @@ -1841,14 +1816,20 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +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-hbase-crd" version = "0.0.0-dev" @@ -1856,7 +1837,7 @@ dependencies = [ "rstest", "serde", "serde_json", - "serde_yaml 0.9.25", + "serde_yaml", "snafu", "stackable-operator", "strum", @@ -1883,8 +1864,8 @@ dependencies = [ [[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", @@ -1904,7 +1885,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "serde_yaml 0.9.25", + "serde_yaml", "snafu", "stackable-operator-derive", "strum", @@ -1917,13 +1898,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.32", + "syn 2.0.37", ] [[package]] @@ -1951,7 +1932,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -1967,9 +1948,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.32" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -1978,22 +1959,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -2057,7 +2038,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys", ] @@ -2080,18 +2061,16 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "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", ] @@ -2108,9 +2087,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", @@ -2148,7 +2127,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.1", "serde", "serde_spanned", "toml_datetime", @@ -2226,7 +2205,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", ] [[package]] @@ -2252,12 +2231,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", @@ -2305,9 +2286,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" @@ -2330,6 +2311,12 @@ 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.1" @@ -2407,7 +2394,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -2429,7 +2416,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2440,6 +2427,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" @@ -2548,18 +2545,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab77e97b50aee93da431f2cee7cd0f43b4d1da3c408042f2d7d164187774f0a" - -[[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 f3b8084e..df92cf54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,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"] } tracing = "0.1" diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index fbb0900d..c2030665 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -1451,6 +1451,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -1978,6 +1980,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -2511,6 +2515,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -3518,6 +3524,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: @@ -4856,6 +4885,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -5383,6 +5414,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -5916,6 +5949,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -8302,6 +8337,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -8829,6 +8866,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -9362,6 +9401,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -10369,6 +10410,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: @@ -11707,6 +11771,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -12234,6 +12300,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -12767,6 +12835,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -15153,6 +15223,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -15680,6 +15752,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -16213,6 +16287,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -17220,6 +17296,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: @@ -18558,6 +18657,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -19085,6 +19186,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: @@ -19618,6 +19721,8 @@ spec: type: string type: object type: object + restartPolicy: + type: string securityContext: properties: allowPrivilegeEscalation: diff --git a/deploy/helm/hbase-operator/templates/roles.yaml b/deploy/helm/hbase-operator/templates/roles.yaml index be9d1cf8..d3741d0b 100644 --- a/deploy/helm/hbase-operator/templates/roles.yaml +++ b/deploy/helm/hbase-operator/templates/roles.yaml @@ -50,6 +50,18 @@ rules: - patch - update - watch + - apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - apiextensions.k8s.io resources: diff --git a/docs/modules/hbase/pages/usage-guide/cluster-operations.adoc b/docs/modules/hbase/pages/usage-guide/concepts/cluster-operations.adoc similarity index 53% rename from docs/modules/hbase/pages/usage-guide/cluster-operations.adoc rename to docs/modules/hbase/pages/usage-guide/concepts/cluster-operations.adoc index 698ed5fc..ceb065d3 100644 --- a/docs/modules/hbase/pages/usage-guide/cluster-operations.adoc +++ b/docs/modules/hbase/pages/usage-guide/concepts/cluster-operations.adoc @@ -1,4 +1,4 @@ = Cluster operation -:page-aliases: cluster_operations.adoc +:page-aliases: ../cluster_operations.adoc -HBase installations can be configured with different cluster operations like pausing reconciliation or stopping the cluster. See xref:concepts:cluster_operations.adoc[cluster operations] for more details. +HBase installations 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/hbase/pages/usage-guide/concepts/graceful-shutdown.adoc b/docs/modules/hbase/pages/usage-guide/concepts/graceful-shutdown.adoc new file mode 100644 index 00000000..523a2ef8 --- /dev/null +++ b/docs/modules/hbase/pages/usage-guide/concepts/graceful-shutdown.adoc @@ -0,0 +1,7 @@ += Graceful shutdown + +Graceful shutdown of HBase 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/hbase/pages/usage-guide/concepts/index.adoc b/docs/modules/hbase/pages/usage-guide/concepts/index.adoc new file mode 100644 index 00000000..e73f5be4 --- /dev/null +++ b/docs/modules/hbase/pages/usage-guide/concepts/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/hbase/pages/usage-guide/concepts/pod-disruptions.adoc b/docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc new file mode 100644 index 00000000..e874aca0 --- /dev/null +++ b/docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc @@ -0,0 +1,3 @@ += Allowed Pod disruptions + +TODO diff --git a/docs/modules/hbase/pages/usage-guide/pod-placement.adoc b/docs/modules/hbase/pages/usage-guide/concepts/pod-placement.adoc similarity index 98% rename from docs/modules/hbase/pages/usage-guide/pod-placement.adoc rename to docs/modules/hbase/pages/usage-guide/concepts/pod-placement.adoc index ece4a2b8..4a293b90 100644 --- a/docs/modules/hbase/pages/usage-guide/pod-placement.adoc +++ b/docs/modules/hbase/pages/usage-guide/concepts/pod-placement.adoc @@ -1,7 +1,7 @@ = Pod placement :page-aliases: pod_placement.adoc -You can configure Pod placement for HDFS nodes as described in xref:concepts:pod_placement.adoc[]. +You can configure Pod placement for HDFS nodes as described in xref:concepts:operations/pod_placement.adoc[]. Default Pod placement constraints for master nodes: diff --git a/docs/modules/hbase/partials/nav.adoc b/docs/modules/hbase/partials/nav.adoc index acd5884b..812d7b06 100644 --- a/docs/modules/hbase/partials/nav.adoc +++ b/docs/modules/hbase/partials/nav.adoc @@ -3,8 +3,6 @@ ** xref:hbase:getting_started/first_steps.adoc[] * xref:hbase:configuration.adoc[] * xref:hbase:usage-guide/index.adoc[] -** xref:hbase:usage-guide/cluster-operations.adoc[] -** xref:hbase:usage-guide/pod-placement.adoc[] ** xref:hbase:usage-guide/listenerclass.adoc[] ** xref:hbase:usage-guide/resource-requests.adoc[] ** xref:hbase:usage-guide/phoenix.adoc[] @@ -12,3 +10,8 @@ ** xref:hbase:usage-guide/logging.adoc[] ** xref:hbase:usage-guide/monitoring.adoc[] ** xref:hbase:usage-guide/overrides.adoc[] +** xref:hbase:usage-guide/operations/index.adoc[] +*** xref:hbase:usage-guide/operations/cluster-operations.adoc[] +*** xref:hbase:usage-guide/operations/pod-placement.adoc[] +*** xref:hbase:usage-guide/operations/pod-disruptions.adoc[] +*** xref:hbase:usage-guide/operations/graceful-shutdown.adoc[] diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 8b502b5b..44bdd221 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -18,7 +18,7 @@ use stackable_operator::{ kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt}, 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}, }; @@ -441,6 +441,14 @@ impl HbaseCluster { }) } + pub fn role_config(&self, role: &HbaseRole) -> Option<&RoleConfig> { + match role { + HbaseRole::Master => self.spec.masters.as_ref().map(|m| &m.role_config), + HbaseRole::RegionServer => self.spec.region_servers.as_ref().map(|rs| &rs.role_config), + HbaseRole::RestServer => self.spec.rest_servers.as_ref().map(|rs| &rs.role_config), + } + } + /// Retrieve and merge resource configs for role and role groups pub fn merged_config( &self, diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index db2b218f..cc71f629 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -2,6 +2,7 @@ use crate::{ discovery::build_discovery_configmap, + operations::pdb::add_pdbs, product_logging::{ extend_role_group_config_map, resolve_vector_aggregator_address, LOG4J_CONFIG_FILE, }, @@ -54,7 +55,7 @@ use stackable_operator::{ CustomContainerLogConfig, }, }, - role_utils::{Role, RoleGroupRef}, + role_utils::{Role, RoleConfig, RoleGroupRef}, status::condition::{ compute_conditions, operations::ClusterOperationsConditionBuilder, statefulset::StatefulSetConditionBuilder, @@ -214,6 +215,10 @@ pub enum Error { source: stackable_operator::product_config::writer::PropertiesWriterError, rolegroup: RoleGroupRef, }, + #[snafu(display("failed to create PodDisruptionBudget"))] + FailedToCreatePdb { + source: crate::operations::pdb::Error, + }, } type Result = std::result::Result; @@ -352,6 +357,16 @@ pub async fn reconcile_hbase(hbase: Arc, ctx: Arc) -> Result< })?, ); } + + let role_config = hbase.role_config(&hbase_role); + if let Some(RoleConfig { + pod_disruption_budget: pdb, + }) = role_config + { + add_pdbs(pdb, &hbase, &hbase_role, client, &mut cluster_resources) + .await + .context(FailedToCreatePdbSnafu)?; + } } let cluster_operation_cond_builder = @@ -821,15 +836,18 @@ fn build_rolegroup_statefulset( }) } -type RoleConfig = HashMap, Role)>; -fn build_roles(hbase: &HbaseCluster) -> Result { +// The result type is only defined once, there is no value in extracting it into a type definition. +#[allow(clippy::type_complexity)] +fn build_roles( + hbase: &HbaseCluster, +) -> Result, Role)>> { let config_types = vec![ PropertyNameKind::File(HBASE_ENV_SH.to_string()), PropertyNameKind::File(HBASE_SITE_XML.to_string()), PropertyNameKind::File(JVM_SECURITY_PROPERTIES_FILE.to_string()), ]; - let mut roles: RoleConfig = [ + let mut roles = HashMap::from([ ( HbaseRole::Master.to_string(), ( @@ -850,8 +868,7 @@ fn build_roles(hbase: &HbaseCluster) -> Result { .context(NoRegionServerRoleSnafu)?, ), ), - ] - .into(); + ]); if let Some(rest_servers) = hbase.get_role(&HbaseRole::RestServer) { roles.insert( diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 9a508861..095ead8c 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,5 +1,6 @@ mod discovery; mod hbase_controller; +mod operations; mod product_logging; mod zookeeper; 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..2729e469 --- /dev/null +++ b/rust/operator-binary/src/operations/pdb.rs @@ -0,0 +1,75 @@ +use snafu::{ResultExt, Snafu}; +use stackable_hbase_crd::{HbaseCluster, HbaseRole, APP_NAME}; +use stackable_operator::{ + builder::pdb::PodDisruptionBudgetBuilder, client::Client, cluster_resources::ClusterResources, + commons::pdb::PdbConfig, kube::ResourceExt, +}; + +use crate::{hbase_controller::HBASE_CONTROLLER_NAME, OPERATOR_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 PodDisruptionBudget [{name}]"))] + ApplyPdb { + source: stackable_operator::error::Error, + name: String, + }, +} + +pub async fn add_pdbs( + pdb: &PdbConfig, + zookeeper: &HbaseCluster, + role: &HbaseRole, + client: &Client, + cluster_resources: &mut ClusterResources, +) -> Result<(), Error> { + if !pdb.enabled { + return Ok(()); + } + let max_unavailable = pdb.max_unavailable.unwrap_or(match role { + HbaseRole::Master => max_unavailable_masters(), + HbaseRole::RegionServer => max_unavailable_region_servers(), + HbaseRole::RestServer => max_unavailable_rest_servers(), + }); + let pdb = PodDisruptionBudgetBuilder::new_with_role( + zookeeper, + APP_NAME, + &role.to_string(), + OPERATOR_NAME, + HBASE_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_masters() -> u16 { + 1 +} + +fn max_unavailable_region_servers() -> u16 { + // TODO: Let our expert Lars decide :) + 1 +} + +fn max_unavailable_rest_servers() -> u16 { + // RestServers are stateless, we only need to make sure we have two available, so we don't have a single point of failure. + // However, users probably deploy multiple rest servers for both - availability and performance. As there is the use-case + // of having multiple RestServers for availability reasons, we need to be restrictive and stick to our `maxUnavailable: 0` + // for `Multiple replicas to increase availability` rolegroups guideline. + 1 +} From e0d25dbfb4a05da055bff0edf65a26a5cc651d42 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 09:06:16 +0200 Subject: [PATCH 02/13] changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f627c289..5fbe3134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,12 @@ - Default stackableVersion to operator version ([#385]). - Configuration overrides for the JVM security properties, such as DNS caching ([#389]). -- Support PodDisruptionBudgets ([#XXX]). +- Support PodDisruptionBudgets ([#399]). ### Changed - `vector` `0.26.0` -> `0.31.0` ([#382]). -- `operator-rs` `0.44.0` -> `0.51.1` ([#385], [#XXX]). +- `operator-rs` `0.44.0` -> `0.51.1` ([#385], [#399]). ### Fixed @@ -21,6 +21,7 @@ [#385]: https://github.com/stackabletech/hbase-operator/pull/385 [#389]: https://github.com/stackabletech/hbase-operator/pull/389 [#394]: https://github.com/stackabletech/hbase-operator/pull/394 +[#399]: https://github.com/stackabletech/hbase-operator/pull/399 ## [23.7.0] - 2023-07-14 From 76d26104e5854bcf4ebbe347336bcac4891c35eb Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 09:07:47 +0200 Subject: [PATCH 03/13] docs --- .../pages/usage-guide/concepts/pod-disruptions.adoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc b/docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc index e874aca0..6308b9dd 100644 --- a/docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc +++ b/docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc @@ -1,3 +1,14 @@ = Allowed Pod disruptions +You can configure the allowed Pod disruptions for HBase 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: + +== Master +We only allow a single Master to be offline at any given time, regardless of the number of replicas or `roleGroups`. + +== RegionServer TODO + +== RestServer +We only allow a single RestServer to be offline at any given time, regardless of the number of replicas or `roleGroups`. From a458bd4509a78c20830baf851a4d6d9464a6f04c Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 09:10:29 +0200 Subject: [PATCH 04/13] typo --- 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 2729e469..3c06f337 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -69,7 +69,7 @@ fn max_unavailable_region_servers() -> u16 { fn max_unavailable_rest_servers() -> u16 { // RestServers are stateless, we only need to make sure we have two available, so we don't have a single point of failure. // However, users probably deploy multiple rest servers for both - availability and performance. As there is the use-case - // of having multiple RestServers for availability reasons, we need to be restrictive and stick to our `maxUnavailable: 0` + // of having multiple RestServers for availability reasons, we need to be restrictive and stick to our `maxUnavailable: 1` // for `Multiple replicas to increase availability` rolegroups guideline. 1 } From c40ba5cc0fa332690120b69e436ec4416a13f17f Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 09:14:47 +0200 Subject: [PATCH 05/13] fix docs --- .../usage-guide/{concepts => operations}/cluster-operations.adoc | 0 .../usage-guide/{concepts => operations}/graceful-shutdown.adoc | 0 .../hbase/pages/usage-guide/{concepts => operations}/index.adoc | 0 .../usage-guide/{concepts => operations}/pod-disruptions.adoc | 0 .../pages/usage-guide/{concepts => operations}/pod-placement.adoc | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename docs/modules/hbase/pages/usage-guide/{concepts => operations}/cluster-operations.adoc (100%) rename docs/modules/hbase/pages/usage-guide/{concepts => operations}/graceful-shutdown.adoc (100%) rename docs/modules/hbase/pages/usage-guide/{concepts => operations}/index.adoc (100%) rename docs/modules/hbase/pages/usage-guide/{concepts => operations}/pod-disruptions.adoc (100%) rename docs/modules/hbase/pages/usage-guide/{concepts => operations}/pod-placement.adoc (100%) diff --git a/docs/modules/hbase/pages/usage-guide/concepts/cluster-operations.adoc b/docs/modules/hbase/pages/usage-guide/operations/cluster-operations.adoc similarity index 100% rename from docs/modules/hbase/pages/usage-guide/concepts/cluster-operations.adoc rename to docs/modules/hbase/pages/usage-guide/operations/cluster-operations.adoc diff --git a/docs/modules/hbase/pages/usage-guide/concepts/graceful-shutdown.adoc b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc similarity index 100% rename from docs/modules/hbase/pages/usage-guide/concepts/graceful-shutdown.adoc rename to docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc diff --git a/docs/modules/hbase/pages/usage-guide/concepts/index.adoc b/docs/modules/hbase/pages/usage-guide/operations/index.adoc similarity index 100% rename from docs/modules/hbase/pages/usage-guide/concepts/index.adoc rename to docs/modules/hbase/pages/usage-guide/operations/index.adoc diff --git a/docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc b/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc similarity index 100% rename from docs/modules/hbase/pages/usage-guide/concepts/pod-disruptions.adoc rename to docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc diff --git a/docs/modules/hbase/pages/usage-guide/concepts/pod-placement.adoc b/docs/modules/hbase/pages/usage-guide/operations/pod-placement.adoc similarity index 100% rename from docs/modules/hbase/pages/usage-guide/concepts/pod-placement.adoc rename to docs/modules/hbase/pages/usage-guide/operations/pod-placement.adoc From 38e609f32dbe46417ef71fa234c40c2166c46841 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 09:18:24 +0200 Subject: [PATCH 06/13] more doc fixes --- docs/modules/hbase/pages/usage-guide/index.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/hbase/pages/usage-guide/index.adoc b/docs/modules/hbase/pages/usage-guide/index.adoc index 2cb45fc8..298862cb 100644 --- a/docs/modules/hbase/pages/usage-guide/index.adoc +++ b/docs/modules/hbase/pages/usage-guide/index.adoc @@ -1,8 +1,8 @@ = Usage guide -Learn about xref:usage-guide/cluster-operations.adoc[starting, stopping and pausing] your cluster. +Learn about xref:usage-guide/operations/cluster-operations.adoc[starting, stopping and pausing] your cluster. -Learn about xref:usage-guide/pod-placement.adoc[configuring where Pods are scheduled] and xref:usage-guide/resource-requests.adoc[how many CPU and memory resources] your Pods consume. +Learn about xref:usage-guide/operations/pod-placement.adoc[configuring where Pods are scheduled] and xref:usage-guide/resource-requests.adoc[how many CPU and memory resources] your Pods consume. You can observe what's happening with your HBase using xref:usage-guide/logging.adoc[logging] and xref:usage-guide/monitoring.adoc[monitoring]. From f367ac4c84b9ed9239ab37af93cdcdf46030dcf0 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 09:52:28 +0200 Subject: [PATCH 07/13] remove page alias --- .../hbase/pages/usage-guide/operations/cluster-operations.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/modules/hbase/pages/usage-guide/operations/cluster-operations.adoc b/docs/modules/hbase/pages/usage-guide/operations/cluster-operations.adoc index ceb065d3..85228316 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/cluster-operations.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/cluster-operations.adoc @@ -1,4 +1,3 @@ = Cluster operation -:page-aliases: ../cluster_operations.adoc HBase installations 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. From 1b375b4c91207a83647a701b875f123a5031164f Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 29 Sep 2023 10:52:37 +0200 Subject: [PATCH 08/13] add test --- rust/operator-binary/src/operations/pdb.rs | 4 ++-- tests/templates/kuttl/smoke/30-assert.yaml | 27 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index 3c06f337..db532019 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -23,7 +23,7 @@ pub enum Error { pub async fn add_pdbs( pdb: &PdbConfig, - zookeeper: &HbaseCluster, + hbase: &HbaseCluster, role: &HbaseRole, client: &Client, cluster_resources: &mut ClusterResources, @@ -37,7 +37,7 @@ pub async fn add_pdbs( HbaseRole::RestServer => max_unavailable_rest_servers(), }); let pdb = PodDisruptionBudgetBuilder::new_with_role( - zookeeper, + hbase, APP_NAME, &role.to_string(), OPERATOR_NAME, diff --git a/tests/templates/kuttl/smoke/30-assert.yaml b/tests/templates/kuttl/smoke/30-assert.yaml index c50ea9af..c3b9f698 100644 --- a/tests/templates/kuttl/smoke/30-assert.yaml +++ b/tests/templates/kuttl/smoke/30-assert.yaml @@ -28,3 +28,30 @@ metadata: status: readyReplicas: 1 replicas: 1 +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: test-hbase-master +status: + expectedPods: 1 + currentHealthy: 1 + disruptionsAllowed: 1 +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: test-hbase-regionserver +status: + expectedPods: 1 + currentHealthy: 1 + disruptionsAllowed: 1 +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: test-hbase-restserver +status: + expectedPods: 1 + currentHealthy: 1 + disruptionsAllowed: 1 From f0190e9a128f02232ed71b135314c6897539cdac Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 4 Oct 2023 09:26:57 +0200 Subject: [PATCH 09/13] Adopt to Lars review --- .../hbase/pages/usage-guide/operations/pod-disruptions.adoc | 2 +- rust/operator-binary/src/operations/pdb.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc b/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc index 6308b9dd..2e2df804 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc @@ -8,7 +8,7 @@ Unless you configure something else or disable our PodDisruptionBudgets (PDBs), We only allow a single Master to be offline at any given time, regardless of the number of replicas or `roleGroups`. == RegionServer -TODO +We only allow a single RegionServer to be offline at any given time, regardless of the number of replicas or `roleGroups`, to have as little data unavailable as possible at any given time. == RestServer We only allow a single RestServer to be offline at any given time, regardless of the number of replicas or `roleGroups`. diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index db532019..ccee1546 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -62,7 +62,6 @@ fn max_unavailable_masters() -> u16 { } fn max_unavailable_region_servers() -> u16 { - // TODO: Let our expert Lars decide :) 1 } From b0f8dd45ff4b7530cbb4c45835812aa9266ebb1e Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 5 Oct 2023 13:35:09 +0200 Subject: [PATCH 10/13] bump: operator-rs 0.52.0 --- CHANGELOG.md | 2 +- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- rust/crd/src/lib.rs | 4 ++-- rust/operator-binary/src/hbase_controller.rs | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fbe3134..bc46975a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ ### Changed - `vector` `0.26.0` -> `0.31.0` ([#382]). -- `operator-rs` `0.44.0` -> `0.51.1` ([#385], [#399]). +- `operator-rs` `0.44.0` -> `0.52.0` ([#385], [#399]). ### Fixed diff --git a/Cargo.lock b/Cargo.lock index c8ad5514..90df9792 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1864,8 +1864,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.51.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.51.1#042642c1e7dac1fdc616de66106e9190478994b8" +version = "0.52.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.52.0#a6fdaf82c13d24765bf217a3a35b53683fc02fdc" dependencies = [ "chrono", "clap", @@ -1898,8 +1898,8 @@ dependencies = [ [[package]] name = "stackable-operator-derive" -version = "0.51.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.51.1#042642c1e7dac1fdc616de66106e9190478994b8" +version = "0.52.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.52.0#a6fdaf82c13d24765bf217a3a35b53683fc02fdc" dependencies = [ "darling 0.20.3", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index df92cf54..b29764e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,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.51.1" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.52.0" } strum = { version = "0.25", features = ["derive"] } tokio = { version = "1.29", features = ["full"] } tracing = "0.1" diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 44bdd221..0680946a 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -18,7 +18,7 @@ use stackable_operator::{ kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt}, product_config_utils::{ConfigError, Configuration}, product_logging::{self, spec::Logging}, - role_utils::{Role, RoleConfig, RoleGroup, RoleGroupRef}, + role_utils::{GenericRoleConfig, Role, RoleGroup, RoleGroupRef}, schemars::{self, JsonSchema}, status::condition::{ClusterCondition, HasStatusCondition}, }; @@ -441,7 +441,7 @@ impl HbaseCluster { }) } - pub fn role_config(&self, role: &HbaseRole) -> Option<&RoleConfig> { + pub fn role_config(&self, role: &HbaseRole) -> Option<&GenericRoleConfig> { match role { HbaseRole::Master => self.spec.masters.as_ref().map(|m| &m.role_config), HbaseRole::RegionServer => self.spec.region_servers.as_ref().map(|rs| &rs.role_config), diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index cc71f629..105156f5 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -55,7 +55,7 @@ use stackable_operator::{ CustomContainerLogConfig, }, }, - role_utils::{Role, RoleConfig, RoleGroupRef}, + role_utils::{GenericRoleConfig, Role, RoleGroupRef}, status::condition::{ compute_conditions, operations::ClusterOperationsConditionBuilder, statefulset::StatefulSetConditionBuilder, @@ -359,7 +359,7 @@ pub async fn reconcile_hbase(hbase: Arc, ctx: Arc) -> Result< } let role_config = hbase.role_config(&hbase_role); - if let Some(RoleConfig { + if let Some(GenericRoleConfig { pod_disruption_budget: pdb, }) = role_config { From 26453ff0c6599b8931c69fc5082e798cde57d8f8 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 5 Oct 2023 13:41:08 +0200 Subject: [PATCH 11/13] charts --- deploy/helm/hbase-operator/crds/crds.yaml | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index c2030665..fca35132 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -114,6 +114,12 @@ spec: type: string type: object masters: + description: |- + This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. + + `T` here is the `config` shared between role and roleGroup. + + `U` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], as this is sufficient for most products. There are some exceptions, where e.g. [`EmptyRoleConfig`] is used. However, product-operators can define their own - custom - struct and use that here. nullable: true properties: cliOverrides: @@ -3529,6 +3535,10 @@ spec: podDisruptionBudget: enabled: true maxUnavailable: null + description: |- + This is a product-agnostic RoleConfig, which fulfills the needs for most of the product. Currently it contains: + + 1. `podDisruptionBudget` to configure the created PDBs. properties: podDisruptionBudget: default: @@ -7000,6 +7010,12 @@ spec: - roleGroups type: object regionServers: + description: |- + This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. + + `T` here is the `config` shared between role and roleGroup. + + `U` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], as this is sufficient for most products. There are some exceptions, where e.g. [`EmptyRoleConfig`] is used. However, product-operators can define their own - custom - struct and use that here. nullable: true properties: cliOverrides: @@ -10415,6 +10431,10 @@ spec: podDisruptionBudget: enabled: true maxUnavailable: null + description: |- + This is a product-agnostic RoleConfig, which fulfills the needs for most of the product. Currently it contains: + + 1. `podDisruptionBudget` to configure the created PDBs. properties: podDisruptionBudget: default: @@ -13886,6 +13906,12 @@ spec: - roleGroups type: object restServers: + description: |- + This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. + + `T` here is the `config` shared between role and roleGroup. + + `U` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], as this is sufficient for most products. There are some exceptions, where e.g. [`EmptyRoleConfig`] is used. However, product-operators can define their own - custom - struct and use that here. nullable: true properties: cliOverrides: @@ -17301,6 +17327,10 @@ spec: podDisruptionBudget: enabled: true maxUnavailable: null + description: |- + This is a product-agnostic RoleConfig, which fulfills the needs for most of the product. Currently it contains: + + 1. `podDisruptionBudget` to configure the created PDBs. properties: podDisruptionBudget: default: From 9b6861ab430ab0dd94b90e9adbfc85c804cddb6c Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 5 Oct 2023 15:54:31 +0200 Subject: [PATCH 12/13] bump: operator-rs 0.52.1 --- CHANGELOG.md | 2 +- Cargo.lock | 8 ++--- Cargo.toml | 2 +- deploy/helm/hbase-operator/crds/crds.yaml | 39 ++++++----------------- 4 files changed, 15 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc46975a..b362cf1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ ### Changed - `vector` `0.26.0` -> `0.31.0` ([#382]). -- `operator-rs` `0.44.0` -> `0.52.0` ([#385], [#399]). +- `operator-rs` `0.44.0` -> `0.52.1` ([#385], [#399]). ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 90df9792..d29e5c69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1864,8 +1864,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.52.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.52.0#a6fdaf82c13d24765bf217a3a35b53683fc02fdc" +version = "0.52.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.52.1#18af9be0473cd6c30d7426e9ade74c90e4abce22" dependencies = [ "chrono", "clap", @@ -1898,8 +1898,8 @@ dependencies = [ [[package]] name = "stackable-operator-derive" -version = "0.52.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.52.0#a6fdaf82c13d24765bf217a3a35b53683fc02fdc" +version = "0.52.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.52.1#18af9be0473cd6c30d7426e9ade74c90e4abce22" dependencies = [ "darling 0.20.3", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index b29764e2..4c48e016 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,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.52.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.52.1" } strum = { version = "0.25", features = ["derive"] } tokio = { version = "1.29", features = ["full"] } tracing = "0.1" diff --git a/deploy/helm/hbase-operator/crds/crds.yaml b/deploy/helm/hbase-operator/crds/crds.yaml index fca35132..032082a3 100644 --- a/deploy/helm/hbase-operator/crds/crds.yaml +++ b/deploy/helm/hbase-operator/crds/crds.yaml @@ -114,12 +114,7 @@ spec: type: string type: object masters: - description: |- - This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. - - `T` here is the `config` shared between role and roleGroup. - - `U` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], as this is sufficient for most products. There are some exceptions, where e.g. [`EmptyRoleConfig`] is used. However, product-operators can define their own - custom - struct and use that here. + description: This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. nullable: true properties: cliOverrides: @@ -3535,15 +3530,13 @@ spec: podDisruptionBudget: enabled: true maxUnavailable: null - description: |- - This is a product-agnostic RoleConfig, which fulfills the needs for most of the product. Currently it contains: - - 1. `podDisruptionBudget` to configure the created PDBs. + description: This is a product-agnostic RoleConfig, which is sufficient for most of the products. properties: podDisruptionBudget: default: enabled: true maxUnavailable: null + description: 'This struct is used to configure: 1.) If PodDisruptionBudgets are created by the operator 2.) The allowed number of Pods to be unavailable (`maxUnavailable`)' properties: enabled: default: true @@ -7010,12 +7003,7 @@ spec: - roleGroups type: object regionServers: - description: |- - This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. - - `T` here is the `config` shared between role and roleGroup. - - `U` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], as this is sufficient for most products. There are some exceptions, where e.g. [`EmptyRoleConfig`] is used. However, product-operators can define their own - custom - struct and use that here. + description: This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. nullable: true properties: cliOverrides: @@ -10431,15 +10419,13 @@ spec: podDisruptionBudget: enabled: true maxUnavailable: null - description: |- - This is a product-agnostic RoleConfig, which fulfills the needs for most of the product. Currently it contains: - - 1. `podDisruptionBudget` to configure the created PDBs. + description: This is a product-agnostic RoleConfig, which is sufficient for most of the products. properties: podDisruptionBudget: default: enabled: true maxUnavailable: null + description: 'This struct is used to configure: 1.) If PodDisruptionBudgets are created by the operator 2.) The allowed number of Pods to be unavailable (`maxUnavailable`)' properties: enabled: default: true @@ -13906,12 +13892,7 @@ spec: - roleGroups type: object restServers: - description: |- - This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. - - `T` here is the `config` shared between role and roleGroup. - - `U` here is the `roleConfig` only available on the role. It defaults to [`GenericRoleConfig`], as this is sufficient for most products. There are some exceptions, where e.g. [`EmptyRoleConfig`] is used. However, product-operators can define their own - custom - struct and use that here. + description: This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a [`HashMap`] containing all the roleGroups that are part of this role. Additionally, there is a `config`, which is configurable at the role *and* roleGroup level. Everything at roleGroup level is merged on top of what is configured on role level using the [`Merge`] trait. There is also a second form of config, which can only be configured at role level, the `roleConfig`. nullable: true properties: cliOverrides: @@ -17327,15 +17308,13 @@ spec: podDisruptionBudget: enabled: true maxUnavailable: null - description: |- - This is a product-agnostic RoleConfig, which fulfills the needs for most of the product. Currently it contains: - - 1. `podDisruptionBudget` to configure the created PDBs. + description: This is a product-agnostic RoleConfig, which is sufficient for most of the products. properties: podDisruptionBudget: default: enabled: true maxUnavailable: null + description: 'This struct is used to configure: 1.) If PodDisruptionBudgets are created by the operator 2.) The allowed number of Pods to be unavailable (`maxUnavailable`)' properties: enabled: default: true From d274cf33304cfdc05330892cd0f3baf75ed55816 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 5 Oct 2023 15:55:55 +0200 Subject: [PATCH 13/13] Apply suggestions from code review Co-authored-by: Andrew Kenworthy --- .../hbase/pages/usage-guide/operations/graceful-shutdown.adoc | 2 +- docs/modules/hbase/pages/usage-guide/operations/index.adoc | 2 +- .../hbase/pages/usage-guide/operations/pod-disruptions.adoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc index 523a2ef8..37ee4a40 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc @@ -3,5 +3,5 @@ Graceful shutdown of HBase 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 +Outstanding implementation work for the graceful shutdowns of all products where this functionality is relevant is tracked in https://github.com/stackabletech/issues/issues/357 diff --git a/docs/modules/hbase/pages/usage-guide/operations/index.adoc b/docs/modules/hbase/pages/usage-guide/operations/index.adoc index e73f5be4..21d170f9 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/index.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/index.adoc @@ -2,4 +2,4 @@ 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. +Please read the xref:concepts:operations/index.adoc[Concepts page on Operations] that contains the necessary details to operate the platform in a production environment. diff --git a/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc b/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc index 2e2df804..a3103d2c 100644 --- a/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc +++ b/docs/modules/hbase/pages/usage-guide/operations/pod-disruptions.adoc @@ -1,6 +1,6 @@ = Allowed Pod disruptions -You can configure the allowed Pod disruptions for HBase nodes as described in xref:concepts:operations/pod_disruptions.adoc[]. +You can configure the permitted Pod disruptions for HBase 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: