Hello, I want to upload pg data backup to r2 at k8s, and I wrote manifest, but r2 status return Inte
Hello, I want to upload pg data backup to r2 at k8s, and I wrote manifest, but r2 status return InternalError.
This is manifest:
This is log file:
kind: CronJob
metadata:
name: database-backup
spec:
schedule: 0 0 * * *
jobTemplate:
spec:
template:
spec:
initContainers:
- name: pgdumper
image: postgres
command:
- "pg_dump"
- "--dbname=misskey"
- "--host=database.misskey.svc"
- "--user=misskey"
- "--password"
- "--file=/backup/backup.sql"
env:
- name: PGPASSWORD
value: misskey
volumeMounts:
- name: data
mountPath: /backup
restartPolicy: OnFailure
containers:
- name: upload
image: amazon/aws-cli
command:
- "aws"
- "s3"
- "cp"
- "/backup/backup.sql"
- "s3://misskey/backup/backup.sql"
- "--endpoint-url=https://5aaa5369426edda5aff32cc4d275826e.r2.cloudflarestorage.com"
- "--region=auto"
- "--debug"
env:
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: database-backup
key: access_key_id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: database-backup
key: secret_access_key
volumeMounts:
- name: data
mountPath: /backup
volumes:
- name: data
emptyDir: {}
kind: CronJob
metadata:
name: database-backup
spec:
schedule: 0 0 * * *
jobTemplate:
spec:
template:
spec:
initContainers:
- name: pgdumper
image: postgres
command:
- "pg_dump"
- "--dbname=misskey"
- "--host=database.misskey.svc"
- "--user=misskey"
- "--password"
- "--file=/backup/backup.sql"
env:
- name: PGPASSWORD
value: misskey
volumeMounts:
- name: data
mountPath: /backup
restartPolicy: OnFailure
containers:
- name: upload
image: amazon/aws-cli
command:
- "aws"
- "s3"
- "cp"
- "/backup/backup.sql"
- "s3://misskey/backup/backup.sql"
- "--endpoint-url=https://5aaa5369426edda5aff32cc4d275826e.r2.cloudflarestorage.com"
- "--region=auto"
- "--debug"
env:
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: database-backup
key: access_key_id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: database-backup
key: secret_access_key
volumeMounts:
- name: data
mountPath: /backup
volumes:
- name: data
emptyDir: {}
0 Replies