Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save prakashsvmx/a2be7038b9ca0337adf4191c87e3bdf1 to your computer and use it in GitHub Desktop.
Save prakashsvmx/a2be7038b9ca0337adf4191c87e3bdf1 to your computer and use it in GitHub Desktop.
MinIO Batch Job Configurations
replicate:
apiVersion: v1
# source of the objects to be replicated
source:
type: minio # valid values are "minio"
bucket: old-minio-versioned-bucket
prefix: "" # 'PREFIX' is optional
# NOTE: if source is remote then target must be "local"
# Source is an old version of MinIO
endpoint: "http://localhost:15000"
credentials:
accessKey: minio
secretKey: minio123
# sessionToken: SESSION-TOKEN # Optional only available when rotating credentials are used
# target where the objects must be replicated
target:
type: minio # valid values are "minio"
bucket: new-minio-versioned bucket
prefix: "" # 'PREFIX' is optional
# NOTE: if target is remote then source must be "local"
# Target is a new version of MinIO - This is where the objects would land.
endpoint: "http://localhost:22000"
credentials:
accessKey: minio
secretKey: minio123
# sessionToken: SESSION-TOKEN # Optional only available when rotating credentials are used
# NOTE: All flags are optional
# - filtering criteria only applies for all source objects match the criteria
# - configurable notification endpoints
# - configurable retries for the job (each retry skips successfully previously replaced objects)
#flags:
#filter:
#newerThan: "7d" # match objects newer than this value (e.g. 7d10h31s)
#olderThan: "7d" # match objects older than this value (e.g. 7d10h31s)
#createdAfter: "date" # match objects created after "date"
#createdBefore: "date" # match objects created before "date"
## NOTE: tags are not supported when "source" is remote.
# tags:
# - key: "name"
# value: "pick*" # match objects with tag 'name', with all values starting with 'pick'
## NOTE: metadata filter not supported when "source" is non MinIO.
# metadata:
# - key: "content-type"
# value: "image/*" # match objects with 'content-type', with all values starting with 'image/'
notify:
endpoint: "http://localhost:8080" # notification endpoint to receive job status events
#token: "Bearer xxxxx" # optional authentication token for the notification endpoint
retry:
attempts: 10 # number of retries for the job before giving up
delay: "500ms" # least amount of delay between each retry
# Running migration between 2 MinIO instances
# Create alias for both and note the API endpoints
# oldminio - 2022-01-08T03:11:54Z
# local22 - 2023-03-31T21:38:10Z
# run the commands on the local22 instance of MinIO
# mc version RELEASE.2023-03-23T20-03-04Z
# mc batch generate local22 replicate > replication.yaml
# Update as per the above configuration . comment un wanted blocks like filter
# mc batch start local22 ./replication.yaml
# Note the batch job id for checking status
# mc batch status local22 <jopbid>
# mc batch list local22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment