| giolekva | 437ef07 | 2020-05-04 16:50:47 +0400 | [diff] [blame] | 1 | apiVersion: v1 |
| 2 | kind: Pod |
| 3 | metadata: |
| 4 | name: minio-importer-webhook |
| 5 | namespace: minio |
| 6 | labels: |
| 7 | app: minio-importer-webhook |
| 8 | spec: |
| 9 | volumes: |
| 10 | - name: minio-creds |
| 11 | secret: |
| 12 | secretName: minio-creds |
| 13 | initContainers: |
| 14 | - name: setup-arn |
| 15 | image: minio/mc:RELEASE.2020-04-04T05-28-55Z |
| 16 | imagePullPolicy: IfNotPresent |
| 17 | volumeMounts: |
| 18 | - name: minio-secrets |
| 19 | readOnly: true |
| 20 | mountPath: "/etc/minio" |
| 21 | command: ["/bin/sh", "-c"] |
| 22 | args: ["mc config host add pcloud http://minio.minio.svc:9000 $(cat /etc/minio-creds/accesskey) $(cat /etc/minio-creds/secretkey) && mc mb pcloud/images && mc admin config set pcloud notify_webhook:pcloud queue_limit=\"1000\" queue_dir=\"/data/events\" endpoint=\"http://minio-importer.app-minio-importer.svc:80/new_object\" && mc admin service restart pcloud"] |
| 23 | containers: |
| 24 | - name: setup-events |
| 25 | image: minio/mc:RELEASE.2020-04-04T05-28-55Z |
| 26 | imagePullPolicy: IfNotPresent |
| 27 | volumeMounts: |
| 28 | - name: minio-secrets |
| 29 | readOnly: true |
| 30 | mountPath: "/etc/minio" |
| 31 | command: ["/bin/sh", "-c"] |
| 32 | args: ["mc config host add pcloud http://minio.minio.svc:9000 $(cat /etc/minio-creds/accesskey) $(cat /etc/minio-creds/secretkey) && mc event add pcloud/images arn:minio:sqs::pcloud:webhook --event put && mc event list pcloud/images"] |
| 33 | restartPolicy: Never |
| 34 | |
| 35 | |
| 36 | |
| 37 | # mc admin config set mio notify_webhook:pcloud-controller queue_limit=\"1000\" queue_dir=\"/data/events\" endpoint=\"http://pcloud-controller-service.pcloud:1111/minio_webhook\" |
| 38 | # mc event add myminio/images arn:minio:sqs::pcloud-controller:webhook --event put |
| 39 | # args: ["mc config host add mio http://minio-hl-svc:9000 $(cat /etc/minio-secrets/accesskey) $(cat /etc/minio-secrets/secretkey) && mc mb mio/images && mc admin config set mio notify_webhook:pcloud queue_limit=\"1000\" queue_dir=\"/data/events\" endpoint=\"http://pcloud-controller-service.pcloud:1111/minio_webhook\" && mc event add mio/images arn:minio:sqs::pcloud:webhook --event put && mc event list mio/images"] |