Files
awoooi/k8s/velero/02-velero-install.yaml
OG T eea6e3acc3 feat(k8s): 新增 Velero 備份系統 (K1.1)
Phase K1 災難恢復:
- MinIO 部署在 192.168.0.188:9000/9001
- Velero v1.13.0 完整安裝 manifests
- velero-backups bucket 已建立
- README 含部署與使用指南

部署方式:
  ssh wooo@192.168.0.120
  sudo kubectl apply -f k8s/velero/velero-install-full.yaml

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 20:53:02 +08:00

118 lines
2.6 KiB
YAML

# Velero Full Installation
# 來源: velero install --dry-run -o yaml
# 建立者: Claude Code (首席架構師)
# 日期: 2026-03-28 (台北時間)
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: velero
namespace: velero
labels:
component: velero
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: velero
labels:
component: velero
subjects:
- kind: ServiceAccount
name: velero
namespace: velero
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
---
apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
name: default
namespace: velero
spec:
provider: aws
objectStorage:
bucket: velero-backups
config:
region: minio
s3ForcePathStyle: "true"
s3Url: http://192.168.0.188:9000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: velero
namespace: velero
labels:
component: velero
spec:
replicas: 1
selector:
matchLabels:
component: velero
template:
metadata:
labels:
component: velero
spec:
serviceAccountName: velero
containers:
- name: velero
image: velero/velero:v1.13.0
imagePullPolicy: IfNotPresent
ports:
- name: metrics
containerPort: 8085
command:
- /velero
args:
- server
- --features=
env:
- name: VELERO_SCRATCH_DIR
value: /scratch
- name: VELERO_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: LD_LIBRARY_PATH
value: /plugins
- name: AWS_SHARED_CREDENTIALS_FILE
value: /credentials/cloud
volumeMounts:
- name: plugins
mountPath: /plugins
- name: scratch
mountPath: /scratch
- name: cloud-credentials
mountPath: /credentials
resources:
requests:
cpu: 500m
memory: 128Mi
limits:
cpu: 1000m
memory: 512Mi
initContainers:
- name: velero-plugin-for-aws
image: velero/velero-plugin-for-aws:v1.9.0
imagePullPolicy: IfNotPresent
volumeMounts:
- name: plugins
mountPath: /target
volumes:
- name: cloud-credentials
secret:
secretName: velero-minio-credentials
- name: plugins
emptyDir: {}
- name: scratch
emptyDir: {}
restartPolicy: Always