Skip to content

Commit

Permalink
feat: add sample and fix filename
Browse files Browse the repository at this point in the history
  • Loading branch information
allthatjazzleo committed Oct 28, 2024
1 parent 16cff42 commit fabd782
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func Compress(homeDir string, chainID string, backendType dbm.BackendType, block
if nodeType != "" {
nodeType = "_" + nodeType
}
filename := fmt.Sprintf("%s_%s%s_%d.lz4", chainID, backendType, nodeType, blockHeight)
filename := fmt.Sprintf("%s_%s%s_%d.tar.lz4", chainID, backendType, nodeType, blockHeight)

var outputFile *os.File
var err error
Expand Down
52 changes: 52 additions & 0 deletions sample/cosmos_v1alpha1_statefuljob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: cosmos.strange.love/v1alpha1
kind: StatefulJob
metadata:
name: statefuljob-sample
spec:
# optional
interval: 24h
# required
selector:
target: value
# optional
jobTemplate:
activeDeadlineSeconds: 3600
backoffLimit: 1
ttlSecondsAfterFinished: 30
# required
podTemplate:
spec:
containers:
- name: test
image: ghcr.io/allthatjazzleo/auto-snapshot:latest
# assuming you have iam role/credentials setup for the appropriate uploader
env:
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: mysecret
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: mysecret
key: AWS_SECRET_ACCESS_KEY
- name: AWS_S3_BUCKET
value: test123
- name: AWS_S3_API_ENDPOINT
value: https://xxxxxxxx.r2.cloudflarestorage.com
args:
- -chain-home
- /home/operator/cosmos
- -uploader
- s3
- -node-type
- archive
volumeMounts:
- mountPath: /home/operator/cosmos
name: snapshot # StatefulJob always injects volume "snapshot" into pod spec.
# required
volumeClaimTemplate:
storageClassName: premium-rwo
accessModes:
- ReadWriteOnce

0 comments on commit fabd782

Please sign in to comment.