popeye icon indicating copy to clipboard operation
popeye copied to clipboard

Add minio scheme for S3-style storage if you're not using Amazon S3

Open PeterGrace opened this issue 4 years ago • 3 comments

This PR adds a new scheme for the s3-bucket argument, minio://, which allows you to specify a custom endpoint for your s3 connection rather than using the AWS defaults. This allows you to use S3-compatible storage systems such as MinIO.

I am an extreme novice at Go programming, so if I've done anything weird here that might break other things, I apologize in advance. I wanted to provide this as a proof of concept to indicate how easy it is to support third-party S3-compatible endpoints. If this is close to mergable, please feel free to suggest any amendments.

PeterGrace avatar Jul 21 '20 16:07 PeterGrace

Would be really nice, if this feature will be finalized and integrated Edit: I just found out that minio is already working. I just had to use the parameters as follows (k8s):

  • --s3-bucket=""
  • --s3-endpoint={serveradress}/{bucketname}
  • --s3-region={regionname}

OllowainT avatar Jun 15 '22 14:06 OllowainT

@OllowainT did you manage to upload anything to a non s3 bucket?

rbjorklin avatar Feb 09 '23 18:02 rbjorklin

@OllowainT did you manage to upload anything to a non s3 bucket?

@rbjorklin: Yes, as I pointed out, I had to add the three args:

  • --s3-bucket=""
  • --s3-endpoint={serveradress}/{bucketname}
  • --s3-region={regionname}

Its just a workaround, but for me its ok for now. You need to add --s3-bucket option with quotes. Unfortunately it also creates the directory in the bucket with quotes...

Here the Spec part of my CronJob

        spec:
          serviceAccountName: {{ .Values.popeye.accountname }}
          restartPolicy: Never
          containers:
          - name: popeye
            image: "{{ .Values.popeye.image.name }}:{{ .Values.popeye.image.tag }}"
            ports:
            - containerPort: 9216
              protocol: TCP
            imagePullPolicy: IfNotPresent
            command: ["/bin/popeye"]
            args:
              - --cluster-name
              - {{.Values.global.clusterName}}
              - -f
              - /etc/config/popeye/spinach.yml
              - --force-exit-zero=true
              - --all-namespaces
              - -o
              - html
              - --pushgateway-address
              - prometheus-pushgateway.prometheus.svc.cluster.local:9091
              # because of a popeye bug, we cannot use --s3-bucket without quotations - in the bucket the directory has also quotations
              - --s3-bucket="{{.Values.global.squadKey}}"
              - --s3-endpoint={{ template "s3.endpoint" . }}
              - --s3-region={{.Values.popeye.cronjob.s3.region}}
            env:
              - name: AWS_SHARED_CREDENTIALS_FILE
                value: "/creds/credentials"
            resources:
              limits:
                memory: 96Mi
              requests:
                cpu: 100m
                memory: 32Mi
            volumeMounts:
              - name: spinach
                mountPath: /etc/config/popeye

Hope this helps

OllowainT avatar Feb 10 '23 09:02 OllowainT