aboutsummaryrefslogtreecommitdiff
path: root/content/blog/kubernetes
diff options
context:
space:
mode:
authorJulien Dessaux2023-04-23 22:33:49 +0200
committerJulien Dessaux2023-04-23 22:34:10 +0200
commitea435049b3a3f5057b3a894040df3cf4f3256d9e (patch)
tree9046430870fa050e6568fcfbe409f8a8d295d0b3 /content/blog/kubernetes
parentDocument the second gotosocial backup job (diff)
downloadwww-ea435049b3a3f5057b3a894040df3cf4f3256d9e.tar.gz
www-ea435049b3a3f5057b3a894040df3cf4f3256d9e.tar.bz2
www-ea435049b3a3f5057b3a894040df3cf4f3256d9e.zip
Refactored syntax highlighting shortcodes into markdown
Diffstat (limited to 'content/blog/kubernetes')
-rw-r--r--content/blog/kubernetes/get_key_and_certificae.md4
-rw-r--r--content/blog/kubernetes/pg_dump_restore.md8
-rw-r--r--content/blog/kubernetes/single-node-cluster-taint.md8
3 files changed, 10 insertions, 10 deletions
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 >}}
+```