mirror of
https://github.com/rubenhensen/k8scd.git
synced 2026-11-16 22:29:09 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7daae80fd |
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
# k3s in Docker, to prove the backups can be restored. Nothing on the NAS
|
# k3s in Docker, to prove the backups can be restored. Nothing on the NAS
|
||||||
# changes:
|
# changes:
|
||||||
# - one backup (backups/<name>/) and the kopia repositories of the chosen
|
# - one backup (backups/<name>/) and the kopia repositories of the chosen
|
||||||
# namespaces (kopia/<namespace>/) are copied read-only from the NAS with
|
# namespaces (kopia/<namespace>/) are copied read-only from MinIO with
|
||||||
# rclone into a Docker volume. A second Velero on the real bucket could
|
# rclone into a Docker volume. A second Velero on the real bucket could
|
||||||
# run kopia maintenance on the same repositories as the cluster's own
|
# run kopia maintenance on the same repositories as the cluster's own
|
||||||
# - `rclone serve s3` serves that copy to a Velero 1.18.2 in k3s, with a
|
# - `rclone serve s3` serves that copy to a Velero 1.18.2 in k3s, with a
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
# Defaults: the newest Completed daily-backup, and ntfy freshrss
|
# Defaults: the newest Completed daily-backup, and ntfy freshrss
|
||||||
# actual-budget. Not gatus: a restored Gatus would start sending alerts.
|
# actual-budget. Not gatus: a restored Gatus would start sending alerts.
|
||||||
#
|
#
|
||||||
# It reads Velero's S3 key from the cluster (velero/velero-s3-credentials)
|
# It reads Velero's MinIO key from the cluster (velero/cloud-credentials)
|
||||||
# into a temporary directory, and the copied backup holds every Secret of
|
# into a temporary directory, and the copied backup holds every Secret of
|
||||||
# the cluster; all of it is deleted at the end. KEEP=1 keeps the test
|
# the cluster; all of it is deleted at the end. KEEP=1 keeps the test
|
||||||
# cluster (kubeconfig in the printed directory) until you run it with
|
# cluster (kubeconfig in the printed directory) until you run it with
|
||||||
@@ -71,14 +71,14 @@ wait_for() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Endpoint, region and bucket as Velero itself uses them. The NAS rejects a
|
# Endpoint, region and bucket as Velero itself uses them. MinIO answers a
|
||||||
# request signed for the wrong region (rclone defaults to us-east-1); MinIO
|
# request signed for the wrong region (rclone defaults to us-east-1) with a
|
||||||
# did so with a bare 400 on HEAD.
|
# bare 400 on HEAD.
|
||||||
if [[ -n ${FROM_VOLUME:-} ]]; then
|
if [[ -n ${FROM_VOLUME:-} ]]; then
|
||||||
BUCKET=${BUCKET:-velero-backups}
|
BUCKET=${BUCKET:-velero-backups}
|
||||||
else
|
else
|
||||||
bsl=$(pk -n velero get backupstoragelocations default -o json)
|
bsl=$(pk -n velero get backupstoragelocations default -o json)
|
||||||
S3URL=${S3URL:-$(jq -r '.spec.config.s3Url' <<<"$bsl")}
|
MINIO=${MINIO:-$(jq -r '.spec.config.s3Url' <<<"$bsl")}
|
||||||
REGION=${REGION:-$(jq -r '.spec.config.region // "us-east-1"' <<<"$bsl")}
|
REGION=${REGION:-$(jq -r '.spec.config.region // "us-east-1"' <<<"$bsl")}
|
||||||
BUCKET=${BUCKET:-$(jq -r '.spec.objectStorage.bucket' <<<"$bsl")}
|
BUCKET=${BUCKET:-$(jq -r '.spec.objectStorage.bucket' <<<"$bsl")}
|
||||||
fi
|
fi
|
||||||
@@ -101,10 +101,10 @@ if [[ -n ${FROM_VOLUME:-} ]]; then
|
|||||||
docker run --rm -v "$FROM_VOLUME:/from:ro" -v "$VOL:/data" alpine:3.22 cp -a /from/. /data/
|
docker run --rm -v "$FROM_VOLUME:/from:ro" -v "$VOL:/data" alpine:3.22 cp -a /from/. /data/
|
||||||
else
|
else
|
||||||
echo "== copy from the NAS (read-only)"
|
echo "== copy from the NAS (read-only)"
|
||||||
(umask 077; pk -n velero get secret velero-s3-credentials -o jsonpath='{.data.cloud}' | base64 -d |
|
(umask 077; pk -n velero get secret cloud-credentials -o jsonpath='{.data.cloud}' | base64 -d |
|
||||||
awk -F' *= *' '/aws_access_key_id/ {print "RCLONE_CONFIG_NAS_ACCESS_KEY_ID="$2}
|
awk -F' *= *' '/aws_access_key_id/ {print "RCLONE_CONFIG_NAS_ACCESS_KEY_ID="$2}
|
||||||
/aws_secret_access_key/ {print "RCLONE_CONFIG_NAS_SECRET_ACCESS_KEY="$2}' > "$WORK/nas.env"
|
/aws_secret_access_key/ {print "RCLONE_CONFIG_NAS_SECRET_ACCESS_KEY="$2}' > "$WORK/nas.env"
|
||||||
printf 'RCLONE_CONFIG_NAS_TYPE=s3\nRCLONE_CONFIG_NAS_PROVIDER=Other\nRCLONE_CONFIG_NAS_ENDPOINT=%s\nRCLONE_CONFIG_NAS_REGION=%s\n' "$S3URL" "$REGION" >> "$WORK/nas.env")
|
printf 'RCLONE_CONFIG_NAS_TYPE=s3\nRCLONE_CONFIG_NAS_PROVIDER=Minio\nRCLONE_CONFIG_NAS_ENDPOINT=%s\nRCLONE_CONFIG_NAS_REGION=%s\n' "$MINIO" "$REGION" >> "$WORK/nas.env")
|
||||||
copy() { docker run --rm --env-file "$WORK/nas.env" -v "$VOL:/data" "$RCLONE" copy --stats-one-line "nas:$BUCKET/$1" "/data/$BUCKET/$1"; }
|
copy() { docker run --rm --env-file "$WORK/nas.env" -v "$VOL:/data" "$RCLONE" copy --stats-one-line "nas:$BUCKET/$1" "/data/$BUCKET/$1"; }
|
||||||
copy "backups/$backup"
|
copy "backups/$backup"
|
||||||
for ns in "${namespaces[@]}"; do copy "kopia/$ns"; done
|
for ns in "${namespaces[@]}"; do copy "kopia/$ns"; done
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ spec:
|
|||||||
value: Europe/Amsterdam
|
value: Europe/Amsterdam
|
||||||
# 1.30.3 ships PHP 8.4.27, which fixes CVE-2026-109618 and
|
# 1.30.3 ships PHP 8.4.27, which fixes CVE-2026-109618 and
|
||||||
# CVE-2026-109619.
|
# CVE-2026-109619.
|
||||||
image: freshrss/freshrss:1.30.3
|
image: freshrss/freshrss:1.30.4
|
||||||
name: freshrss
|
name: freshrss
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
|
|||||||
+3
-14
@@ -127,9 +127,6 @@ spec:
|
|||||||
TRANSFORMERS_CACHE: /cache
|
TRANSFORMERS_CACHE: /cache
|
||||||
HF_XET_CACHE: /cache/huggingface-xet
|
HF_XET_CACHE: /cache/huggingface-xet
|
||||||
MPLCONFIGDIR: /cache/matplotlib-config
|
MPLCONFIGDIR: /cache/matplotlib-config
|
||||||
# The optimized models of v3.3.0: faster, less memory,
|
|
||||||
# and the same results, so no jobs to run again.
|
|
||||||
MACHINE_LEARNING_MODEL_REVISION: v2
|
|
||||||
# Trust store without the compromised eMudhra
|
# Trust store without the compromised eMudhra
|
||||||
# intermediates; requests would otherwise use certifi.
|
# intermediates; requests would otherwise use certifi.
|
||||||
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
|
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
|
||||||
@@ -142,19 +139,11 @@ spec:
|
|||||||
globalMounts:
|
globalMounts:
|
||||||
- path: /etc/ssl/certs
|
- path: /etc/ssl/certs
|
||||||
readOnly: true
|
readOnly: true
|
||||||
# The models and their one-off preparation, kept across restarts.
|
|
||||||
# Downloaded again if lost, so no backups: the no-backup group
|
|
||||||
# keeps it out of Longhorn's default one (backup-daily), and
|
|
||||||
# Velero skips that label too (velero/skip-emptydir-policy.yaml).
|
|
||||||
cache:
|
cache:
|
||||||
enabled: true
|
enabled: true
|
||||||
type: persistentVolumeClaim
|
# Optional: to avoid downloading the ML models every start, use
|
||||||
storageClass: longhorn
|
# a persistentVolumeClaim with size, accessMode and storageClass
|
||||||
accessMode: ReadWriteOnce
|
type: emptyDir
|
||||||
size: 10Gi
|
|
||||||
labels:
|
|
||||||
recurring-job.longhorn.io/source: enabled
|
|
||||||
recurring-job-group.longhorn.io/no-backup: enabled
|
|
||||||
|
|
||||||
destination:
|
destination:
|
||||||
server: https://kubernetes.default.svc
|
server: https://kubernetes.default.svc
|
||||||
|
|||||||
@@ -8,17 +8,8 @@ spec:
|
|||||||
name: mbgwp-mariadb-credentials
|
name: mbgwp-mariadb-credentials
|
||||||
key: root-password
|
key: root-password
|
||||||
|
|
||||||
image: mariadb:11.8.9
|
image: mariadb:11.4.5
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
# Every X.Y is a major MariaDB release (11.4 to 11.8 too) and needs
|
|
||||||
# mariadb-upgrade on the datadir, or queries on mysql.proc fail. With this
|
|
||||||
# the image's entrypoint runs it on start; a no-op when there is nothing
|
|
||||||
# to migrate, so it stays. Operator 26.10.1 sets the same variable through
|
|
||||||
# updateStrategy.mariadbAutoUpgradeEnabled, but CI's MariaDB schema (datree
|
|
||||||
# catalog) doesn't know that field yet.
|
|
||||||
env:
|
|
||||||
- name: MARIADB_AUTO_UPGRADE
|
|
||||||
value: "true"
|
|
||||||
|
|
||||||
port: 3306
|
port: 3306
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: nas-minio-external
|
||||||
|
spec:
|
||||||
|
type: ExternalName
|
||||||
|
externalName: 192.168.1.99
|
||||||
|
ports:
|
||||||
|
- port: 9000
|
||||||
|
protocol: TCP
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
# Volume policy for the backup schedules. emptyDir volumes hold nothing
|
# Volume policy for the backup schedules. emptyDir volumes hold nothing
|
||||||
# worth keeping, and backing them up fails when the pod is gone before its
|
# worth keeping, and backing them up fails when the pod is gone before its
|
||||||
# volume is read, as happens with Velero's own repository maintenance jobs.
|
# volume is read, as happens with Velero's own repository maintenance jobs.
|
||||||
# PVCs in Longhorn's no-backup group (caches, such as immich's ML models)
|
|
||||||
# are skipped too.
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
@@ -16,8 +14,3 @@ data:
|
|||||||
- emptyDir
|
- emptyDir
|
||||||
action:
|
action:
|
||||||
type: skip
|
type: skip
|
||||||
- conditions:
|
|
||||||
pvcLabels:
|
|
||||||
recurring-job-group.longhorn.io/no-backup: enabled
|
|
||||||
action:
|
|
||||||
type: skip
|
|
||||||
@@ -27,22 +27,20 @@ spec:
|
|||||||
- mountPath: /target
|
- mountPath: /target
|
||||||
name: plugins
|
name: plugins
|
||||||
configuration:
|
configuration:
|
||||||
# Garage on the NAS (nas/garage). Until 2026-10-25 this was MinIO on
|
|
||||||
# the same NAS; the bucket was copied over with rclone, so the
|
|
||||||
# existing backups and kopia repositories carried on.
|
|
||||||
backupStorageLocation:
|
backupStorageLocation:
|
||||||
- name: default
|
- name: default
|
||||||
bucket: velero-backups
|
bucket: velero-backups
|
||||||
provider: aws
|
provider: aws
|
||||||
config:
|
config:
|
||||||
region: garage
|
region: minio
|
||||||
s3ForcePathStyle: true
|
s3ForcePathStyle: true
|
||||||
s3Url: http://192.168.1.99:3900
|
s3Url: http://192.168.1.99:9000
|
||||||
|
insecureSkipTLSVerify: "true"
|
||||||
volumeSnapshotLocation:
|
volumeSnapshotLocation:
|
||||||
- name: default
|
- name: default
|
||||||
provider: aws
|
provider: aws
|
||||||
config:
|
config:
|
||||||
region: garage
|
region: minio
|
||||||
features: EnableCSI
|
features: EnableCSI
|
||||||
# Kopia maintenance ran every hour for each of the 15 repositories,
|
# Kopia maintenance ran every hour for each of the 15 repositories,
|
||||||
# and once a day as a full run of several minutes that writes its
|
# and once a day as a full run of several minutes that writes its
|
||||||
@@ -61,8 +59,11 @@ spec:
|
|||||||
memoryRequest: 256Mi
|
memoryRequest: 256Mi
|
||||||
memoryLimit: 2Gi
|
memoryLimit: 2Gi
|
||||||
credentials:
|
credentials:
|
||||||
# From Vault, velero/external-secret.yaml
|
# Use existing secret created by External Secrets Operator
|
||||||
existingSecret: velero-s3-credentials
|
# existingSecret: velero-minio-credentials
|
||||||
|
# extraEnvVars:
|
||||||
|
# AWS_SHARED_CREDENTIALS_FILE: /credentials/cloud
|
||||||
|
existingSecret: cloud-credentials
|
||||||
deployNodeAgent: true
|
deployNodeAgent: true
|
||||||
nodeAgent:
|
nodeAgent:
|
||||||
containerSecurityContext:
|
containerSecurityContext:
|
||||||
|
|||||||
Reference in new issue
Block a user