postgres> SELECT active_pid, slot_name,
active,
restart_lsn,
confirmed_flush_lsn,
ROUND(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) / 1024 / 1024, 2) AS lag_mb,
ROUND(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) / 1024 / 1024 / 1024, 2) AS lag_gb
FROM pg_replication_slots;
+------------+------------------------+--------+-------------+---------------------+----------+--------+
| active_pid | slot_name | active | restart_lsn | confirmed_flush_lsn | lag_mb | lag_gb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "NAMESPACE PVC PV ZONE"; kubectl get pvc -A -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.spec.volumeName}{"\n"}{end}' | while read ns pvc pv; do echo -n "$ns $pvc $pv "; kubectl get pv "$pv" -o jsonpath='{.spec.nodeAffinity.required.nodeSelectorTerms[*].matchExpressions[?(@.key=="topology.kubernetes.io/zone")].values[*]}' 2>/dev/null; echo; done | column -t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: docker-dind | |
| namespace: docker | |
| labels: | |
| app: docker-dind | |
| spec: | |
| replicas: 1 | |
| selector: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kubectl get pods --all-namespaces -o jsonpath="{..image}" | tr -s '[[:space:]]' '\n' | sort -u | grep -i bitnami |
-
Check TimescaleDB/Postgres Config in Kubernetes
kubectl exec -it <pod-name> -- psql -U <username> -d <database>
-
Run this
SHOW statement_timeout;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Good reading: https://medium.com/code-and-coffee |
jps -lvm
jhsdb jmap --heap --pid 8
Reference: https://stackoverflow.com/a/74901369
Context: rancher-sandbox/rancher-desktop#797
$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash | |
| kubectl debug -it thanos-storegateway-0 -n thanos --image=ubuntu:latest --share-processes --copy-to=thanos-debug --same-node |
NewerOlder