Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect PersistentVolumeClaim resources.requests.storage unit in MinIO Log (Postgres) StatefulSet #763

Closed
rtsp opened this issue Aug 12, 2021 · 2 comments
Labels

Comments

@rtsp
Copy link

rtsp commented Aug 12, 2021

Expected Behavior

After deploying a new tenant (named test in this case) using MinIO Operator (Web Console).

MinIO Operator created a test-log (StatefulSet) object that instruct the cluster to create a PostgreSQL test-log-0 (Pod) with test-log-test-log-0 (PersistentVolumeClaim).

Current Behavior

The problem is in the statefulset.apps/test-log StatefulSet, the value of spec.volumeClaimTemplates.spec.resources.requests.storage is 5 instead of 5Gi so the cluster allocated a very small 1 Mi volume instead of expected 5 Gi volume.

...
spec:
  ...
  ...
  volumeClaimTemplates:
    - kind: PersistentVolumeClaim
      apiVersion: v1
      metadata:
        name: test-log
        creationTimestamp: null
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: '5'   # <=== should be '5Gi'
        storageClassName: csi-rbd-sc
        volumeMode: Filesystem
  ...
  ...

Bound PV

NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS 
pvc-09f245b1-fcc3-44ef-8c46-e9f802fd90b6   1Mi        RWO            Delete           Bound

Logs from test-log-0 Pod

...
selecting default time zone ... Etc/UTC
creating configuration files ... ok
2021-08-12 21:45:25.601 UTC [38] FATAL:  could not write to file "pg_wal/xlogtemp.38": No space left on device
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/data"
...

Possible Solution

I'm not sure but the source of this problem may be around this line https://github.com/minio/operator/blob/master/pkg/resources/statefulsets/log.go#L150

Steps to Reproduce (for bugs)

  1. Deploy new MinIO tenant using Web Console
  2. Check for <TENANT-NAME>-log StatefulSet for spec.volumeClaimTemplates.spec.resources.requests.storage

Context

Regression

No

Your Environment

  • Version used (minio-operator): v4.1.3
  • Environment name and version (e.g. kubernetes v1.17.2): kubernetes v1.21.3
  • Server type and version:
  • Operating System and version (uname -a): Debian 10 buster | 4.19.0-17-amd64 Add Minio operator  #1 SMP Debian 4.19.194-1 (2021-06-10) x86_64 GNU/Linux
  • Link to your deployment file:
@rtsp rtsp changed the title Incorrect PersistentVolumeClaim resources.requests.storage unit in MinIO Log (Postgres) StatefulSets Incorrect PersistentVolumeClaim resources.requests.storage unit in MinIO Log (Postgres) StatefulSet Aug 12, 2021
@rtsp
Copy link
Author

rtsp commented Aug 12, 2021

Just found that statefulsets.apps/test-log is a result of tenants.minio.min.io/test (custom resource).

tenants.minio.min.io/test also has incorrect unit too

...
...
spec:
  console:
    consoleSecret:
      name: test-console-secret
    image: minio/console:v0.7.5
    replicas: 1
    resources:
      requests:
        memory: 64Mi
  credsSecret:
    name: test-secret
  env:
  - name: MINIO_STORAGE_CLASS_STANDARD
    value: EC:2
  exposeServices:
    console: true
    minio: true
  image: minio/minio:RELEASE.2021-08-05T22-01-19Z
  imagePullSecret: {}
  log:
    audit:
      diskCapacityGB: 10
    db:
      resources: {}
      volumeClaimTemplate:
        metadata:
          name: test-log
        spec:
          accessModes:
          - ReadWriteOnce
          resources:
            requests:
              storage: "5"  # <================== should be '5Gi'
          storageClassName: csi-rbd-sc
        status: {}
    resources: {}
...
...

@harshavardhana
Copy link
Member

This is fixed already in latest releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants