From 7d7de9e3b419fd03bd5c52fd13894923abc9139c Mon Sep 17 00:00:00 2001 From: Jean-Gabriel Gill-Couture Date: Tue, 6 Jun 2023 07:58:43 -0400 Subject: [PATCH] wip: Writing elasticsearch storageClass blog --- Cargo.toml | 2 +- src/app.rs | 3 ++- src/routes/blog/page.rs | 35 ++++++++++++++++++++++++++++++++++- src/routes/home/page.rs | 10 +++++----- src/routes/whymdc/page.rs | 6 ++++-- 5 files changed, 46 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8dbec6e..064a9ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ style-file = "target/style/main.css" # Optional. Env: LEPTOS_ASSETS_DIR. assets-dir = "assets" # The IP and port (ex: 127.0.0.1:3000) where the server serves the content. Use it in your server setup. -site-addr = "127.0.0.1:3000" +site-addr = "0.0.0.0:3000" # The port to use for automatic reload monitoring reload-port = 3001 # [Optional] Command to use when running end2end tests. It will run in the end2end dir. diff --git a/src/app.rs b/src/app.rs index 712bbe7..dbc5981 100644 --- a/src/app.rs +++ b/src/app.rs @@ -23,11 +23,12 @@ pub fn App(cx: Scope) -> impl IntoView { // content for this welcome page
-
+
+
}/> }/> diff --git a/src/routes/blog/page.rs b/src/routes/blog/page.rs index 8b512ea..920820e 100644 --- a/src/routes/blog/page.rs +++ b/src/routes/blog/page.rs @@ -3,13 +3,46 @@ use leptos_meta::*; #[component] pub fn Blog(cx: Scope) -> impl IntoView { + let es_health_green = concat!( + "{", + "kubectl exec -n -it -- curl localhost:9200/_cluster/health?pretty", + r#""cluster_name" : "elastic","#, + r#""status" : "green", # <<<<< Make sure this is green <<<<<"#, + r#""timed_out" : false,"#, + r#""number_of_nodes" : 7,"#, + r#""number_of_data_nodes" : 2,"#, + r#""active_primary_shards" : 202,"#, + r#""active_shards" : 404,"#, + r#""relocating_shards" : 0,"#, + r#""initializing_shards" : 0,"#, + r#""unassigned_shards" : 0,"#, + r#""delayed_unassigned_shards" : 0,"#, + r#""number_of_pending_tasks" : 0,"#, + r#""number_of_in_flight_fetch" : 0,"#, + r#""task_max_waiting_in_queue_millis" : 0,"#, + r#""active_shards_percent_as_number" : 100.0"#, + "}", + ); view! { cx, <div class="text-white bg-indigo-950 min-h-screen"> <div class="flex space-y-4 flex-col max-w-3xl container mx-auto"> <h1 class="text-6xl text-orange-400 font-extrabold pt-12">"Blog"</h1> <h2 class="text-3xl">"Modifying storageClass of kubernetes bitnami ElasticSearch cluster without downtime"</h2> - <p class="text-xl">"Thanks Percona"</p> + <p class="text-lg">"Thanks Percona for this excellent article " + <a class="underline text-orange-400" href="https://www.percona.com/blog/change-storage-class-on-kubernetes-on-the-fly/">"Change Storage Class on Kubernetes on the Fly."</a> + </p> + <p>"It inspired most of this procedure. Here is the summary" + <ol class="list-decimal list-inside"> + <li class="pb-2">"Delete the statefulset with "<code class="inline-block">"kubectl delete -n <namespace> statefulset --cascade=orphan <statefulset_name>"</code>" the "<code class="">"orphan"</code>" option is key here and will allow Kubernetes to delete the statefulset without deleting the pods."</li> + <li class="pb-2">"Change the storage class in the helm chart to the new one"</li> + <li class="pb-2">"Upgrade the deployment with "<code>"helm upgrade"</code></li> + <li class="pb-2">"Make sure your cluster is green " + <pre>{es_health_green}</pre> + </li> + <li class="pb-2">"Make sure your cluster is green "<code>"kubectl exec -n <namespace> <elasticsearch-pod> -it -- curl localhost:9200/_cluster/health?pretty"</code></li> + </ol> + </p> </div> </div> } diff --git a/src/routes/home/page.rs b/src/routes/home/page.rs index c7ca648..9da2b55 100644 --- a/src/routes/home/page.rs +++ b/src/routes/home/page.rs @@ -10,11 +10,11 @@ pub fn HomePage(cx: Scope) -> impl IntoView { <div class="flex space-y-4 flex-col max-w-3xl container mx-auto"> <h1 class="text-6xl text-orange-400 font-extrabold pt-8">"NationTech"</h1> <h2 class="text-3xl">"Unconventional team for extraordinary challenges"</h2> - <p class="text-xl">"We love working with small teams to tackle hard tasks. We are passionate about maximizing the value we bring to the company and project, while taking care of the people we work with."</p> - <p class="text-xl">"We are experienced in a wide array of technologies, projects and companies."</p> - <p class="text-xl">"We are eternal learners that feel a visceral need to deeply understand a problem or subject once it is on their plate."</p> - <p class="text-xl">"We don't cheap out, we always give our all, we always try to balance all the factors to find the best possible solution to any situation."</p> - <p class="text-xl">"The status quo does not exist, we always improve, automate, look for exponential gains across the stack."</p> + <p class="text-lg">"We love working with small teams to tackle hard tasks. We are passionate about maximizing the value we bring to the company and project, while taking care of the people we work with."</p> + <p class="">"We are experienced in a wide array of technologies, projects and companies."</p> + <p class="text-lg">"We are eternal learners that feel a visceral need to deeply understand a problem or subject once it is on their plate."</p> + <p class="text-lg">"We don't cheap out, we always give our all, we always try to balance all the factors to find the best possible solution to any situation."</p> + <p class="text-lg">"The status quo does not exist, we always improve, automate, look for exponential gains across the stack."</p> </div> </div> } diff --git a/src/routes/whymdc/page.rs b/src/routes/whymdc/page.rs index 2f460c6..870afb2 100644 --- a/src/routes/whymdc/page.rs +++ b/src/routes/whymdc/page.rs @@ -205,12 +205,14 @@ pub fn WhyMicroDatacenters(cx: Scope) -> impl IntoView { </div> <div class="flex flex-col justify-center pl-40 pr-40 max-[1460px]:pl-16 max-[1460px]:pr-16"> <img src="/img/water-icon.png" class="transform mx-auto"/> - <h4 class="font-Lato mx-auto text-center w-64 p-4 text-blue-950 text-3xl font-bold"> "Consommation d'eau démesurrée" + <h4 class="font-Lato mx-auto text-center w-64 p-4 text-blue-950 text-3xl font-bold"> + "Consommation d'eau démesurrée" </h4> </div> <div class="flex flex-col justify-center pl-40 pr-40 max-[1460px]:pl-16 max-[1460px]:pr-16"> <img src="/img/tree-icon.png" class="transform mx-auto"/> - <h4 class="font-Lato mx-auto text-center w-64 p-4 text-blue-950 text-3xl font-bold"> "Impact environnemental majeur" + <h4 class="font-Lato mx-auto text-center w-64 p-4 text-blue-950 text-3xl font-bold"> + "Impact environnemental majeur" </h4> </div> </div>