diff --git a/ai/langflow.yaml b/ai/langflow.yaml index 5dbba58..224b94a 100644 --- a/ai/langflow.yaml +++ b/ai/langflow.yaml @@ -33,7 +33,7 @@ spec: spec: containers: - name: langflow - image: langflowai/langflow:1.2.0 + image: mirror.gcr.io/langflowai/langflow:1.2.0 imagePullPolicy: IfNotPresent ports: - containerPort: 7860 diff --git a/archive/adguard.yaml b/archive/adguard.yaml index 3c461f0..5a8e642 100644 --- a/archive/adguard.yaml +++ b/archive/adguard.yaml @@ -39,7 +39,7 @@ spec: - name: regcred containers: - name: adguard - image: adguard/adguardhome:v0.108.0-b.33 + image: mirror.gcr.io/adguard/adguardhome:v0.108.0-b.33 imagePullPolicy: IfNotPresent ports: - containerPort: 80 diff --git a/backup-jobs/backup-cronjobs.yaml b/backup-jobs/backup-cronjobs.yaml index fe3b9b7..fc24342 100644 --- a/backup-jobs/backup-cronjobs.yaml +++ b/backup-jobs/backup-cronjobs.yaml @@ -63,7 +63,7 @@ spec: containers: - name: backup # Same image as in /etc/kubernetes/manifests/etcd.yaml - image: postgres:11 + image: mirror.gcr.io/postgres:11 env: - name: DB_PASSWORD valueFrom: diff --git a/db/mysql.yaml b/db/mysql.yaml index 814c357..71fbbeb 100644 --- a/db/mysql.yaml +++ b/db/mysql.yaml @@ -29,7 +29,7 @@ spec: effect: NoSchedule containers: - name: mysql - image: mysql:8.2 + image: mirror.gcr.io/mysql:8.2 ports: - containerPort: 3306 env: diff --git a/es/es.yaml b/es/es.yaml index 49356cd..e2276af 100644 --- a/es/es.yaml +++ b/es/es.yaml @@ -57,7 +57,7 @@ spec: value: "-Xms1200m -Xmx1200m" initContainers: - name: fix-permissions - image: alpine + image: mirror.gcr.io/alpine command: ["sh", "-c", "chown -R 1000:1000 /usr/share/elasticsearch/data"] securityContext: privileged: true @@ -65,12 +65,12 @@ spec: - name: data mountPath: /usr/share/elasticsearch/data - name: increase-vm-max-map - image: alpine + image: mirror.gcr.io/alpine command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true - name: increase-fd-ulimit - image: alpine + image: mirror.gcr.io/alpine command: ["sh", "-c", "ulimit -n 65536"] securityContext: privileged: true diff --git a/home-apps/ddns.yaml b/home-apps/ddns.yaml index b54f58a..22589f4 100644 --- a/home-apps/ddns.yaml +++ b/home-apps/ddns.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: ddns-toozhao-com - image: oznu/cloudflare-ddns + image: mirror.gcr.io/oznu/cloudflare-ddns env: - name: API_KEY valueFrom: @@ -57,7 +57,7 @@ spec: spec: containers: - name: ddns-junv-cc - image: oznu/cloudflare-ddns + image: mirror.gcr.io/oznu/cloudflare-ddns env: - name: API_KEY valueFrom: @@ -98,7 +98,7 @@ spec: spec: containers: - name: ddns-m-junv-cc - image: oznu/cloudflare-ddns + image: mirror.gcr.io/oznu/cloudflare-ddns env: - name: API_KEY valueFrom: diff --git a/home-apps/home-proxy.yaml b/home-apps/home-proxy.yaml index 5552040..b1e9c77 100644 --- a/home-apps/home-proxy.yaml +++ b/home-apps/home-proxy.yaml @@ -22,7 +22,7 @@ spec: path: Caddyfile containers: - name: home-proxy - image: caddy:2 + image: mirror.gcr.io/caddy:2 args: [ "caddy", diff --git a/home-apps/n8n.yaml b/home-apps/n8n.yaml index 0853fcd..03488bb 100644 --- a/home-apps/n8n.yaml +++ b/home-apps/n8n.yaml @@ -33,7 +33,7 @@ spec: spec: containers: - name: n8n - image: n8nio/n8n:1.80.2 + image: mirror.gcr.io/n8nio/n8n:1.80.2 imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 diff --git a/home-apps/searxng.yaml b/home-apps/searxng.yaml index 4561ce6..6d2659f 100644 --- a/home-apps/searxng.yaml +++ b/home-apps/searxng.yaml @@ -43,7 +43,7 @@ spec: spec: containers: - name: searxng - image: docker.io/searxng/searxng:2025.2.20-28d1240fc + image: mirror.gcr.io/searxng/searxng:2025.2.20-28d1240fc env: - name: TZ value: Australia/Melbourne diff --git a/media/alist.yaml b/media/alist.yaml index 4ca748a..ca7cad0 100644 --- a/media/alist.yaml +++ b/media/alist.yaml @@ -27,7 +27,7 @@ spec: claimName: books-nfs containers: - name: alist - image: xhofe/alist + image: mirror.gcr.io/xhofe/alist securityContext: runAsUser: 0 runAsGroup: 0 diff --git a/media/jackett.yaml b/media/jackett.yaml index 1613aa2..2bdaf0a 100644 --- a/media/jackett.yaml +++ b/media/jackett.yaml @@ -30,7 +30,7 @@ spec: path: password containers: - name: jackett - image: linuxserver/jackett:0.22.1615 + image: mirror.gcr.io/linuxserver/jackett:0.22.1615 securityContext: runAsUser: 0 imagePullPolicy: IfNotPresent diff --git a/media/media.yaml b/media/media.yaml index 6e46b9e..0b2f271 100644 --- a/media/media.yaml +++ b/media/media.yaml @@ -469,7 +469,7 @@ spec: # - name: SERVER_HOSTNAME # value: au-sydney.privacy.network - name: files - image: wahyd4/aria2-ui:edge + image: mirror.gcr.io/wahyd4/aria2-ui:edge imagePullPolicy: Always ports: - containerPort: 80 diff --git a/media/static-file.yaml b/media/static-file.yaml index 7ec0c07..b99ee77 100644 --- a/media/static-file.yaml +++ b/media/static-file.yaml @@ -21,7 +21,7 @@ spec: claimName: downloads-nfs containers: - name: static-file-server - image: caddy:2 + image: mirror.gcr.io/caddy:2 args: ["caddy", "file-server", "--listen", ":8080", "--root", "/www", "--browse"] securityContext: runAsUser: 1000 diff --git a/on-demand/once-postgres-backjobs.yaml b/on-demand/once-postgres-backjobs.yaml index cfa62ee..9a05edb 100644 --- a/on-demand/once-postgres-backjobs.yaml +++ b/on-demand/once-postgres-backjobs.yaml @@ -11,7 +11,7 @@ spec: containers: - name: backup # Same image as in /etc/kubernetes/manifests/etcd.yaml - image: postgres:11 + image: mirror.gcr.io/postgres:11 env: - name: DB_PASSWORD valueFrom: diff --git a/recovery.sh b/recovery.sh index a42ad19..5fd8da5 100644 --- a/recovery.sh +++ b/recovery.sh @@ -30,6 +30,42 @@ docker run --rm -it \ --env ETCDCTL_API=3 \ 'k8s.gcr.io/etcd:3.2.24' sh +# Etcd recover a failed cluster + +1. Stop the etcd service on the crashed node +systemctl stop etcd +2. Clean up the existing etcd data +rm -rf /var/lib/etcd/* +3. Get the member list from a healthy etcd node +On one of the working nodes, run: + + +# remove old member + +ETCDCTL_API=3 etcdctl member remove 6c10765e571d3ce8 \ + --endpoints=https://192.168.1.10:2379 \ + --cacert=/etc/etcd/ca.pem \ + --cert=/etc/etcd/etcd.pem \ + --key=/etc/etcd/etcd-key.pem + +# then add it back, both do it from a healthy node + +ETCDCTL_API=3 etcdctl member add server-3 \ + --peer-urls=https://192.168.1.2:2380 \ + --endpoints=https://192.168.1.10:2379 \ + --cacert=/etc/etcd/ca.pem \ + --cert=/etc/etcd/etcd.pem \ + --key=/etc/etcd/etcd-key.pem +# Backup existing config +sudo cp /etc/kubernetes/admin.conf /etc/kubernetes/admin.conf.backup + +# Generate new admin.conf +sudo kubeadm init phase kubeconfig admin + +# Copy to user's home directory +mkdir -p $HOME/.kube +sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config +sudo chown $(id -u):$(id -g) $HOME/.kube/config # 1 reset cluster @@ -185,3 +221,10 @@ sudo apt install kubeadm=1.27.6-00 ### Restore files from nas rsync -chavzP --stats rsync://junv@192.168.1.4/backups/192.168.1.2/redis /mnt/k8s + + +# Disk full + + +# check large files +sudo du -xh --max-depth=1 /mnt/k8s | sort -hr | head -n 15