Cheatsheet
TrueNAS
Rename volume
Resize VM disk
Repair iSCSI share
Script
- Run the following script to start a interactive script that repair the iSCSI share
curl -sSL https://raw.githubusercontent.com/x-real-ip/infrastructure/refs/heads/main/scripts/repair_iscsi_volume.sh | bash
Manually
- Make sure that the container that uses the volume has stopped.
-
SSH into one of the nodes in the cluster and start discovery
-
Login to target
-
Create a local mount point & mount to replay logfile
-
Unmount the device
-
Run check / ncheck
-
If needed run xfs repair
-
Logout from target
Rsync
Run a Rsync exact copy
Bitnami Sealed Secret
Raw mode
Create TLS (unencrypted) secret
kubectl create secret tls cloudflare-tls --key origin-ca.pk --cert origin-ca.crt --dry-run=client -o yaml > cloudflare-tls.yaml
Encrypt secret with custom public certificate.
Add sealed secret to configfile secret
echo -n <mypassword_value> | kubectl create secret generic <secretname> --dry-run=client --from-file=<password_key>=/dev/stdin -o json | kubeseal --cert ./sealed-secret-tls-2.crt -o yaml \
-n democratic-csi --merge-into <secret>.yaml
Raw sealed secret
strict scope (default):
With the custom cert (useful when patching just one key of an existing SealedSecret, e.g. via a kustomize JSON6902 patch on encryptedData.<KEY>):
echo -n foo | kubeseal --cert ./sealed-secret-tls-2.crt --raw --from-file=/dev/stdin --namespace bar --name mysecret
AgBChHUWLMx...
Without a local cert file, fetch it live from the in-cluster controller instead. In this cluster the controller service is named sealed-secrets in kube-system, not the kubeseal default sealed-secrets-controller, so the name/namespace flags are required:
echo -n foo | kubeseal --raw \
--controller-name sealed-secrets \
--controller-namespace kube-system \
--namespace bar --name mysecret
AgBChHUWLMx...
namespace-wide scope:
echo -n foo | kubeseal --cert ./sealed-secret-tls-2.crt --raw --from-file=/dev/stdin --namespace bar --scope namespace-wide
AgAbbFNkM54...
cluster-wide scope:
echo -n foo | kubeseal --cert ./sealed-secret-tls-2.crt --raw --from-file=/dev/stdin --scope cluster-wide
AgAjLKpIYV+...
No --namespace/--name needed here — the ciphertext isn't bound to a specific namespace+name. But this only decrypts if the target SealedSecret actually carries the sealedsecrets.bitnami.com/cluster-wide: "true" annotation (see below); without it the controller expects strict-scope ciphertext and unsealing fails. Since cluster-wide ciphertext isn't bound to one Secret, avoid it for per-app values like a db password — stick to strict there.
Include the sealedsecrets.bitnami.com/namespace-wide annotation in the SealedSecret
Include the sealedsecrets.bitnami.com/cluster-wide annotation in the SealedSecret
Kubernetes
Drain and terminate all pods gracefully on the node while marking the node as unschedulable
Make the node unschedulable
Make the node schedulable
Convert to BASE64
Decode a secret with config file data
Create secret from file
kubectl create secret generic <secret name> --from-file=<secret filelocation> --dry-run=client --output=yaml > secrets.yaml
Restart Pod
Change PV reclaim policy
Shell into pod
Copy to or from pod
ArgoCD WebUI
Uptime Kuma
A sqlite query to find and replace a part in the monitor url.