From ea435049b3a3f5057b3a894040df3cf4f3256d9e Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 23 Apr 2023 22:33:49 +0200 Subject: Refactored syntax highlighting shortcodes into markdown --- content/blog/kubernetes/get_key_and_certificae.md | 4 ++-- content/blog/kubernetes/pg_dump_restore.md | 8 ++++---- content/blog/kubernetes/single-node-cluster-taint.md | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'content/blog/kubernetes') diff --git a/content/blog/kubernetes/get_key_and_certificae.md b/content/blog/kubernetes/get_key_and_certificae.md index 30b60e5..29a7789 100644 --- a/content/blog/kubernetes/get_key_and_certificae.md +++ b/content/blog/kubernetes/get_key_and_certificae.md @@ -14,7 +14,7 @@ My use case is to deploy a wildcard certificate that was previously handled by a ## The solution Assuming we are working with a secret named `wild.adyxax.org-cert` and our namespace is named `legacy` : -{{< highlight sh >}} +```sh kubectl -n legacy get secret wild.adyxax.org-cert -o json -o=jsonpath="{.data.tls\.crt}" | base64 -d > fullchain.cer kubectl -n legacy get secret wild.adyxax.org-cert -o json -o=jsonpath="{.data.tls\.key}" | base64 -d > adyxax.org.key -{{< /highlight >}} +``` diff --git a/content/blog/kubernetes/pg_dump_restore.md b/content/blog/kubernetes/pg_dump_restore.md index 0251728..0fa09ac 100644 --- a/content/blog/kubernetes/pg_dump_restore.md +++ b/content/blog/kubernetes/pg_dump_restore.md @@ -11,21 +11,21 @@ tags: ## Dumping Assuming we are working with a postgresql statefulset, our namespace is named `miniflux` and our master pod is named `db-postgresql-0`, trying to dump a database named `miniflux`: -{{< highlight sh >}} +```sh export POSTGRES_PASSWORD=$(kubectl get secret --namespace miniflux db-postgresql \ -o jsonpath="{.data.postgresql-password}" | base64 --decode) kubectl run db-postgresql-client --rm --tty -i --restart='Never' --namespace miniflux \ --image docker.io/bitnami/postgresql:11.8.0-debian-10-r19 --env="PGPASSWORD=$POSTGRES_PASSWORD" \ --command -- pg_dump --host db-postgresql -U postgres -d miniflux > miniflux.sql-2020062501 -{{< /highlight >}} +``` ## Restoring Assuming we are working with a postgresql statefulset, our namespace is named `miniflux` and our master pod is named `db-postgresql-0`, trying to restore a database named `miniflux`: -{{< highlight sh >}} +```sh kubectl -n miniflux cp miniflux.sql-2020062501 db-postgresql-0:/tmp/miniflux.sql kubectl -n miniflux exec -ti db-postgresql-0 -- psql -U postgres -d miniflux miniflux=# \i /tmp/miniflux.sql kubectl -n miniflux exec -ti db-postgresql-0 -- rm /tmp/miniflux.sql -{{< /highlight >}} +``` diff --git a/content/blog/kubernetes/single-node-cluster-taint.md b/content/blog/kubernetes/single-node-cluster-taint.md index 5b80598..bd7ddb2 100644 --- a/content/blog/kubernetes/single-node-cluster-taint.md +++ b/content/blog/kubernetes/single-node-cluster-taint.md @@ -10,11 +10,11 @@ tags: ## The solution On a single node cluster, control plane nodes are tainted so that the cluster never schedules pods on them. To change that run : -{{< highlight sh >}} +```sh kubectl taint nodes --all node-role.kubernetes.io/master- -{{< /highlight >}} +``` Getting dns in your pods : -{{< highlight sh >}} +```sh add --cluster-dns=10.96.0.10 to /etc/conf.d/kubelet -{{< /highlight >}} +``` -- cgit v1.2.3