Skip to content

Commit 81c0981

Browse files
committed
Add : job for bacup from the redis cluster
Signed-off-by: Shubham Gupta <iamshubhamgupta2001@gmail.com>
1 parent 323dc40 commit 81c0981

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: env-secrets
5+
namespace: default
6+
type: Opaque
7+
stringData:
8+
CLUSTER_NAME: redis-cluster
9+
CLUSTER_NAMESPACE: default
10+
RESTIC_PASSWORD: abc@123
11+
RESTIC_CACHE_DIR: "/tmp/restic_cache"
12+
REDIS_PORT: "6379"
13+
REDIS_PASSWORD: ""
14+
BACKUP_DESTINATION: AWS_S3
15+
AWS_S3_BUCKET: shubham-redis
16+
AWS_DEFAULT_REGION: ap-south-1
17+
AWS_ACCESS_KEY_ID: "AKIA4C3B4OYHOLOWCGMB"
18+
AWS_SECRET_ACCESS_KEY: "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"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: redis-operator-backup-job
5+
namespace: default
6+
spec:
7+
template:
8+
metadata:
9+
name: redis-operator-backup-pod
10+
spec:
11+
serviceAccountName: backup-service-account
12+
containers:
13+
- name: redis-operator-backup-container
14+
image: "quay.io/opstree/redis-operator-backup:v0.15.1"
15+
command: ["/bin/bash", "-c", "/backup/backup.bash"]
16+
imagePullPolicy: Always
17+
envFrom:
18+
- secretRef:
19+
name: env-secrets
20+
restartPolicy: Never
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: RoleBinding
3+
metadata:
4+
name: backup-role-binding
5+
subjects:
6+
- kind: ServiceAccount
7+
name: backup-service-account
8+
roleRef:
9+
kind: Role
10+
name: modify-pods
11+
apiGroup: rbac.authorization.k8s.io
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
name: modify-pods
5+
rules:
6+
- apiGroups: ["*"]
7+
resources: ["*"]
8+
verbs: ["*"]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: backup-service-account

0 commit comments

Comments
 (0)