Minio Object Store CRD

Minio object stores can be created and configured using the objectstores.minio.rook.io custom resource definition (CRD). Complete instructions can be found in the Rook Minio Documentation.

Sample

  1. apiVersion: minio.rook.io/v1alpha1
  2. kind: ObjectStore
  3. metadata:
  4. name: my-store
  5. namespace: rook-minio
  6. spec:
  7. scope:
  8. nodeCount: 4
  9. # You can have multiple PersistentVolumeClaims in the volumeClaimTemplates list.
  10. # Be aware though that all PersistentVolumeClaim Templates will be used for each intance (see nodeCount).
  11. volumeClaimTemplates:
  12. - metadata:
  13. name: rook-minio-data1
  14. spec:
  15. accessModes: [ "ReadWriteOnce" ]
  16. # Uncomment and specify your StorageClass, otherwise
  17. # the cluster admin defined default StorageClass will be used.
  18. #storageClassName: "your-cluster-storageclass"
  19. resources:
  20. requests:
  21. storage: "8Gi"
  22. #- metadata:
  23. # name: rook-minio-data2
  24. # spec:
  25. # accessModes: [ "ReadWriteOnce" ]
  26. # # Uncomment and specify your StorageClass, otherwise
  27. # # the cluster admin defined default StorageClass will be used.
  28. # #storageClassName: "my-storage-class"
  29. # resources:
  30. # requests:
  31. # storage: "8Gi"
  32. placement:
  33. tolerations:
  34. nodeAffinity:
  35. podAffinity:
  36. podAnyAffinity:
  37. credentials:
  38. name: minio-my-store-access-keys
  39. namespace: rook-minio
  40. clusterDomain:
  41. # A key/value list of annotations
  42. annotations:
  43. # key: value

Cluster Settings

Minio accessKey and secretKey

It is recommended to update the values of accessKey and secretKey in the object-store.yaml to a secure key pair, which is described in the Minio client quickstart guide

The default kubernetes secret resource will look like:

  1. ---
  2. apiVersion: v1
  3. kind: Secret
  4. metadata:
  5. name: access-keys
  6. namespace: rook-minio
  7. type: Opaque
  8. data:
  9. # Base64 encoded string: "TEMP_DEMO_ACCESS_KEY"
  10. username: VEVNUF9ERU1PX0FDQ0VTU19LRVk=
  11. # Base64 encoded string: "TEMP_DEMO_SECRET_KEY"
  12. password: VEVNUF9ERU1PX1NFQ1JFVF9LRVk=

You can use any mechanism to generate the new secure key pair, but you need to be sure the values are base64 encoded when being entered into kubernetes. It is recommended to do the following in order to prevent new line feeds and carriage returns from being added into the base64 encoded value:

  1. $ cat minio-object-store.yaml
  2. ---
  3. apiVersion: v1
  4. kind: Secret
  5. metadata:
  6. name: access-keys
  7. namespace: rook-minio
  8. type: Opaque
  9. data:
  10. username: #1
  11. password: #2
  12. $ MINIO_ACCESS_KEY=$(echo -n "minio" | base64 -w0)
  13. $ MINIO_SECRET_KEY=$(echo -n "minio123" | base64 -w0)
  14. $ sed -i "s/#1/$MINIO_ACCESS_KEY/g" minio-object-store.yaml
  15. $ sed -i "s/#2/$MINIO_SECRET_KEY/g" minio-object-store.yaml
  16. $ cat minio-object-store.yaml
  17. ---
  18. apiVersion: v1
  19. kind: Secret
  20. metadata:
  21. name: access-keys
  22. namespace: rook-minio
  23. type: Opaque
  24. data:
  25. username: bWluaW8K
  26. password: bWluaW8xMjMK

For further information in regards to this, please refer to the following related GitHub issues: minio/minio and rook/minio

Minio Specific Settings

The settings below are specific to Minio object stores:

  • scope: See Storage Scope.
  • credentials: This accepts the name and namespace strings of an existing Secret to specify the access credentials for the object store.
  • clusterDomain: The local cluster domain for this cluster. This should be set if an alternative cluster domain is in use. If not set, then the default of cluster.local will be assumed. This field is needed to workaround https://github.com/minio/minio/issues/6775, and is expected to be removed in the future.
  • annotations: Key value pair list of annotations to add.

Storage Scope

Under the scope field, a StorageScopeSpec can be specified to influence the scope or boundaries of storage that the cluster will use for its underlying storage. These properties are currently supported:

  • nodeCount: The number of Minio instances to create. Some of these instances may be scheduled on the same nodes, but exactly this many instances will be created and included in the cluster.
  • volumeClaimTemplates: A list of one or more PersistentVolumeClaim templates to use for each Minio repliace. For an example of how the list should look like, please look at the above sample.