Skip to content

Commit d7ae734

Browse files
sbernauerTechassi
andauthored
feat: Implement KubeClient::get_cluster_info (#90)
* refactor: Refactor kube.rs and move to utils * feat: Implement KubeClient::get_cluster_info * WIP. Filter to worker nodes is still missing * Improve CLusterInfo * Only count untainted nodes. Improve errror handling * cleanup * cleanup * fix: docs * Apply suggestions from code review Co-authored-by: Techassi <git@techassi.dev> * Update rust/stackable-cockpit/Cargo.toml Co-authored-by: Techassi <git@techassi.dev> * Update rust/helm-sys/Cargo.toml Co-authored-by: Techassi <git@techassi.dev> * Update rust/stackable-cockpit/src/platform/cluster.rs Co-authored-by: Techassi <git@techassi.dev> * improve docs * bump op-rs --------- Co-authored-by: Techassi <git@techassi.dev>
1 parent 581ebad commit d7ae734

File tree

34 files changed

+695
-663
lines changed

34 files changed

+695
-663
lines changed

Cargo.lock

Lines changed: 286 additions & 392 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,50 @@ members = ["rust/*", "web", "."]
33

44
[workspace.package]
55
version = "0.0.0-dev"
6+
authors = ["Stackable GmbH <info@stackable.tech>"]
7+
license = "OSL-3.0"
8+
edition = "2021"
9+
repository = "https://github.com/stackabletech/stackable-cockpit/"
610

711
[workspace.dependencies]
8-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.42.2" }
9-
kube = { version = "0.82.2", default-features = false, features = [
10-
"client",
11-
"openssl-tls",
12-
] }
13-
k8s-openapi = { version = "0.18.0", default-features = false, features = [
14-
"v1_26",
15-
] }
16-
tokio = { version = "1.27.0", features = ["rt-multi-thread", "macros", "fs"] }
12+
async-trait = "0.1"
13+
axum = { version = "0.6", features = ["http2", "headers"] }
14+
bcrypt = "0.15"
15+
clap = { version = "4.2.1", features = ["derive", "env"] }
16+
clap_complete = "4.2"
17+
comfy-table = { version = "7.0", features = ["custom_styling"] }
18+
dotenvy = "0.15"
19+
futures = "0.3"
20+
gobuild = "0.1.0-alpha.1"
21+
indexmap = { version = "2.0", features = ["serde"] }
22+
k8s-openapi = { version = "0.19", default-features = false, features = ["v1_27"] }
23+
kube = { version = "0.85", default-features = false, features = ["client", "openssl-tls"] }
24+
lazy_static = "1.4"
25+
nu-ansi-term = "0.49"
26+
phf = "0.11"
27+
phf_codegen = "0.11"
28+
rand = "0.8"
1729
reqwest = { version = "0.11.16", features = ["native-tls"] }
18-
serde = { version = "1.0.160", features = ["derive"] }
19-
indexmap = { version = "1.9.3", features = ["serde"] }
20-
clap = { version = "4.2.1", features = ["derive"] }
21-
tracing-subscriber = "0.3.17"
22-
utoipa-swagger-ui = "3.1.3"
23-
clap_complete = "4.2.0"
24-
phf_codegen = "0.11.1"
25-
async-trait = "0.1.68"
26-
lazy_static = "1.4.0"
27-
serde_json = "1.0.96"
28-
serde_yaml = "0.9.21"
29-
dotenvy = "0.15.7"
30-
tracing = "0.1.37"
31-
semver = "1.0.17"
32-
bcrypt = "0.14.0"
33-
utoipa = "3.3.0"
34-
axum = "0.6.18"
35-
snafu = "0.7.4"
36-
which = "4.4.0"
37-
tera = "1.18.1"
38-
sha2 = "0.10.7"
39-
rand = "0.8.5"
40-
phf = "0.11.1"
41-
url = "2.3.1"
42-
xdg = "2.4.1"
30+
semver = "1.0"
31+
serde = { version = "1.0", features = ["derive"] }
32+
serde_json = "1.0"
33+
serde_yaml = "0.9"
34+
sha2 = "0.10"
35+
snafu = "0.7"
36+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.46.0" }
37+
tera = "1.18"
38+
tokio = { version = "1.29.0", features = ["rt-multi-thread", "macros", "fs", "process"] }
39+
tower-http = "0.4"
40+
tracing = "0.1"
41+
tracing-subscriber = "0.3"
42+
url = "2.3"
43+
utoipa = "3.3"
44+
utoipa-swagger-ui = {version = "3.1", features = ["axum"] }
45+
uuid = { version = "1.4.0", features = ["v4"] }
46+
which = "4.4"
47+
xdg = "2.4"
48+
49+
[patch."https://github.com/stackabletech/operator-rs.git"]
50+
# TODO: Switch to released version
51+
# We did not want to draw a release of operator-rs just for https://github.com/stackabletech/operator-rs/pull/634
52+
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", ref = "0e1a60e16151048f7abade3e9733ff196a2b7e4d" }

extra/man/stackablectl.1

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/helm-sys/Cargo.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
[package]
22
name = "helm-sys"
3-
version = "0.0.0-dev"
4-
edition = "2021"
3+
description = "Rust wrapper around Helm Go library"
4+
version.workspace = true
5+
authors.workspace = true
6+
license.workspace = true
7+
edition.workspace = true
8+
repository.workspace = true
59
publish = false
6-
links = "helm"
710

8-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
11+
links = "helm"
912

1013
[build-dependencies]
11-
gobuild = "0.1.0-alpha.1"
14+
gobuild.workspace = true

rust/stackable-cockpit/Cargo.toml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
[package]
22
name = "stackable-cockpit"
3+
description = "Shared library which powers cockpitd and stackablectl"
34
version.workspace = true
4-
edition = "2021"
5+
authors.workspace = true
6+
license.workspace = true
7+
edition.workspace = true
8+
repository.workspace = true
59
publish = false
610

711
[features]
812
full = ["openapi"]
913
openapi = ["dep:utoipa"]
1014

1115
[dependencies]
12-
tokio = { workspace = true, features = ["process"] }
13-
utoipa = { workspace = true, optional = true }
14-
stackable-operator = { workspace = true }
1516
helm-sys = { path = "../helm-sys" }
16-
k8s-openapi = { workspace = true }
17-
serde_json = { workspace = true }
18-
serde_yaml = { workspace = true }
19-
indexmap = { workspace = true }
20-
reqwest = { workspace = true }
21-
tracing = { workspace = true }
22-
bcrypt = { workspace = true }
23-
snafu = { workspace = true }
24-
which = { workspace = true }
25-
serde = { workspace = true }
26-
tera = { workspace = true }
27-
kube = { workspace = true }
28-
rand = { workspace = true }
29-
sha2 = { workspace = true }
30-
url = { workspace = true }
17+
18+
bcrypt.workspace = true
19+
indexmap.workspace = true
20+
k8s-openapi.workspace = true
21+
kube.workspace = true
22+
rand.workspace = true
23+
reqwest.workspace = true
24+
serde_json.workspace = true
25+
serde_yaml.workspace = true
26+
serde.workspace = true
27+
sha2.workspace = true
28+
snafu.workspace = true
29+
stackable-operator.workspace = true
30+
tera.workspace = true
31+
tokio.workspace = true
32+
tracing.workspace = true
33+
url.workspace = true
34+
utoipa = { workspace = true, optional = true }
35+
which.workspace = true

rust/stackable-cockpit/src/cluster/kind/config.rs renamed to rust/stackable-cockpit/src/engine/kind/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use serde::Serialize;
22

3-
use crate::cluster::NodeRole;
3+
use crate::engine::NodeRole;
44

55
#[derive(Debug, Serialize)]
66
#[serde(rename_all = "camelCase")]

rust/stackable-cockpit/src/cluster/kind/mod.rs renamed to rust/stackable-cockpit/src/engine/kind/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use tokio::{io::AsyncWriteExt, process::Command};
55
use tracing::{debug, info, instrument};
66

77
use crate::{
8-
cluster::{check_if_docker_is_running, kind::config::KindClusterConfig, DockerError},
98
constants::DEFAULT_LOCAL_CLUSTER_NAME,
9+
engine::{check_if_docker_is_running, kind::config::KindClusterConfig, DockerError},
1010
utils::check::binaries_present_with_name,
1111
};
1212

rust/stackable-cockpit/src/cluster/minikube/mod.rs renamed to rust/stackable-cockpit/src/engine/minikube/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use tokio::process::Command;
33
use tracing::{debug, info, instrument};
44

55
use crate::{
6-
cluster::{check_if_docker_is_running, DockerError},
76
constants::DEFAULT_LOCAL_CLUSTER_NAME,
7+
engine::{check_if_docker_is_running, DockerError},
88
utils::check::binaries_present,
99
};
1010

0 commit comments

Comments
 (0)