From a560386d836c098bee7c26b76531cff4dc3f0296 Mon Sep 17 00:00:00 2001 From: Donal Byrne Date: Mon, 12 Aug 2024 21:21:26 +0200 Subject: [PATCH] Readme --- Cargo.toml | 4 ++-- README.md | 10 ++++++++++ src/logs.rs | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 65e8702..d9846bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0.75" -async-ssh2-tokio = { version = "0.8.1", features = ["openssl"]} +async-ssh2-tokio = { version = "0.8.2", features = ["openssl"] } async-trait = "0.1.74" clap = { version = "4.4.7", features = ["derive", "env"] } futures = "0.3.29" @@ -34,4 +34,4 @@ fs2 = "0.4.3" log = "0.4.20" handlebars = "5.1.2" cron = "0.12.1" -russh = "0.38.0" +russh = "=0.43.0" diff --git a/README.md b/README.md index bbc0c29..bfbee49 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,16 @@ skate create node --name foo --host bar This will ensure all hosts are provisioned with `skatelet`, the agent +## Healthchecks + +`podman kube play` supports `livenessProbe` in the pod manifest. +The best way to ensure that http traffic stops being routed to an unhealthy pod is to combine that with `restartPolicy` +of `Always` or `OnFailure`. + +NOTE: using the `httpGet` probe results in podman trying to run `curl` within the container. +With `tcpSocket` it looks for `nc`. + + ## Playing with objects ```shell diff --git a/src/logs.rs b/src/logs.rs index 5b4a86b..620f8e6 100644 --- a/src/logs.rs +++ b/src/logs.rs @@ -39,7 +39,7 @@ impl LogArgs { let tail = format!("--tail {}", &self.tail); cmd.push(tail); } - return cmd + return cmd; } } @@ -104,7 +104,7 @@ pub async fn log_pod(conns: &ssh::SshClients, name: &str, ns: String, args: &Log let result: Vec<_> = fut.collect().await; if result.iter().all(|r| r.is_err()) { - return Err(format!("{:?}", result.into_iter().map(|r| r.err().unwrap().to_string()).collect::>()).into()) + return Err(format!("{:?}", result.into_iter().map(|r| r.err().unwrap().to_string()).collect::>()).into()); } for res in result { @@ -130,7 +130,7 @@ pub async fn log_child_pods(conns: &ssh::SshClients, resource_type: ResourceType let result: Vec<_> = fut.collect().await; if result.iter().all(|r| r.is_err()) { - return Err(format!("{:?}", result.into_iter().map(|r| r.err().unwrap().to_string()).collect::>()).into()) + return Err(format!("{:?}", result.into_iter().map(|r| r.err().unwrap().to_string()).collect::>()).into()); } for res in result {