Skip to content

Commit 65c1d0f

Browse files
committed
feat(dashboard): add nodes
1 parent 6c18c98 commit 65c1d0f

21 files changed

+696
-197
lines changed

Cargo.lock

+25-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ categories = ["command-line-interface", "development-tools", "virtualization"]
2626
ansi-to-tui = "6.0.0"
2727
async-trait = "0.1.82"
2828
base64 = "0.22.1"
29-
bon = "2.2.1"
29+
bon = "2.3.0"
3030
cata = { version = "0.1.1" }
3131
chrono = { version = "0.4.38", features = ["serde"] }
3232
clap = { version = "4.5.17", features = ["derive", "env"] }
@@ -47,10 +47,10 @@ itertools = "0.13.0"
4747
json-patch = "2.0.0"
4848
json_value_merge = "2.0.0"
4949
jsonwebtoken = "9.3.0"
50-
k8s-openapi = { version = "0.22.0", features = ["earliest"] }
51-
kube = { version = "0.94.1", features = ["derive", "runtime", "ws"] }
50+
k8s-openapi = { version = "0.23.0", features = ["earliest"] }
51+
kube = { version = "0.95.0", features = ["derive", "runtime", "ws"] }
5252
lazy_static = "1.5.0"
53-
local-ip-address = "0.6.2"
53+
local-ip-address = "0.6.3"
5454
mio = "1.0.2"
5555
ndarray = "0.16.1"
5656
pkcs8 = "0.10.2"

TODO.md

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939

4040
## TUI
4141

42+
- Is it possible to get the kubelet logs?
43+
44+
- Use SSH forwarding to get into the nodes.
45+
46+
- Does it make sense to do the `nsenter` trick for some use cases? This
47+
requires privileged mode to work.
48+
4249
- There's some kind of lag happening when scrolling aggressively (aka, holding
4350
down a cursor). It goes fine for ~10 items and then has a hitch in the
4451
rendering.

src/cli/dev.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mod agent;
12
mod authz;
23
mod dashboard;
34
mod shell;
@@ -15,6 +16,7 @@ pub struct Dev {
1516

1617
#[derive(Subcommand, Container)]
1718
enum DevCmd {
19+
Agent(agent::Agent),
1820
Authz(authz::Authz),
1921
Dashboard(dashboard::Dashboard),
2022
Shell(shell::Shell),

src/cli/dev/agent.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
use cata::{Command, Container};
2+
use clap::Parser;
3+
use eyre::Result;
4+
5+
#[derive(Parser, Container)]
6+
pub struct Agent {}
7+
8+
#[async_trait::async_trait]
9+
impl Command for Agent {
10+
async fn run(&self) -> Result<()> {
11+
let mut agent = russh_keys::agent::client::AgentClient::connect_env()
12+
.await
13+
.unwrap();
14+
let mut identities = agent.request_identities().await.unwrap();
15+
assert_eq!(identities.len(), 1);
16+
let id = identities.pop().unwrap();
17+
18+
tracing::info!(key = ?id, "identity");
19+
20+
Ok(())
21+
}
22+
}

src/dashboard.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::time::Duration;
22

3-
use bon::builder;
3+
use bon::Builder;
44
use eyre::{eyre, Report, Result};
55
use futures::TryStreamExt;
66
use lazy_static::lazy_static;
@@ -42,7 +42,7 @@ lazy_static! {
4242
static FPS: u16 = 10;
4343
pub static RENDER_INTERVAL: Duration = Duration::from_millis(1000 / FPS as u64);
4444

45-
#[builder]
45+
#[derive(Builder)]
4646
pub struct Dashboard {
4747
client: kube::Client,
4848
}

src/resources.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pub mod age;
22
pub mod container;
33
pub mod file;
44
pub mod install;
5+
pub mod node;
56
pub mod pod;
67
pub mod status;
78
pub mod store;

0 commit comments

Comments
 (0)