Add a kubernetes client.

This commit is contained in:
Tom Alexander
2024-07-14 23:08:10 -04:00
parent 41cc65e7d3
commit 2a54401717
3 changed files with 1103 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ use axum::routing::get;
use axum::routing::post;
use axum::Json;
use axum::Router;
use kube::Client;
use serde::Serialize;
use tokio::signal;
use tower_http::timeout::TimeoutLayer;
@@ -28,6 +29,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
)
.with(tracing_subscriber::fmt::layer())
.init();
let kubernetes_client: Client = Client::try_default()
.await
.expect("Set KUBECONFIG to a valid kubernetes config.");
let app = Router::new()
.route("/health", get(health))
.route("/hook", post(hook))