简体   繁体   中英

How can I get MINIO access and secret key?

I'm new to minio and I want to use it in a Django app, I read the documentation of minio python library and there is fields for MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY. I read the Quickstart documentation of minio but I didn't figure out how to find these parameters.

Go to your minio console and find Users page. You can create a new user and set it MINIO_ACCESS_KEY and MINIO_SECRET_KEY or can view user credentials.

AccessKey is similar to username and should be minimum of 5 characters. SecretKey is similar to password, it should be randomly generated and kept secure.

Its called Service Accounts, Go to Users menu, then Service Accounts sub menu. create a new MINIO_ACCESS_KEY, MINIO_SECRET_KEY

If you use docker:

environment:
            MINIO_ROOT_USER: ${MINIO_ROOT_USER}
            MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}

They are equivalent:

MINIO_ACCESS_KEY=MINIO_ROOT_USER

MINIO_SECRET_KEY=MINIO_ROOT_PASSWORD

From the cluster

kubectl get secrets
NAME                              TYPE                                  DATA   AGE
default-token-hxzsv               kubernetes.io/service-account-token   3      5h34m
minio-sa-token-nxdpt              kubernetes.io/service-account-token   3      14m
mino-test-minio                   Opaque                                2      14m
my-s3-keys                        Opaque                                2      3h33m
mypostgres-secret                 Opaque                                2      5h20m
sh.helm.release.v1.mino-test.v1   helm.sh/release.v1                    1      14m
alex@pop-os:~/coding/preso_hive$ kubectl get secret mino-test-minio -o yaml
apiVersion: v1
data:
  rootPassword: bWluaW8xMjM=
  rootUser: bWluaW8=
kind: Secret
metadata:
  annotations:
    meta.helm.sh/release-name: mino-test
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2022-06-14T10:15:14Z"
  labels:
    app: minio
    app.kubernetes.io/managed-by: Helm
    chart: minio-4.0.2
    heritage: Helm
    release: mino-test
  name: mino-test-minio
  namespace: default
  resourceVersion: "58285"
  uid: c23ce2d4-657e-4feb-adea-df83bba489c5
type: Opaque

Note the rootUser and rootPassword from the secret and you can use base64 to decode

$ echo bWluaW8= | base64 --decode
minioalex

$ echo bWluaW8xMjM= | base64 --decode
minio123

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM