Home > OS >  ephemeral-storage limits for volumes
ephemeral-storage limits for volumes

Time:07-08

I have deployment with volumes and limits presented above. The problem is that kubernetes reject create pod with such error:

    pods "app-app-96d5dc969-2g6zp" is forbidden:
     exceeded quota: general-resourcequota, requested: limits.ephemeral-storage=1280Mi, 
     used: limits.ephemeral-storage=0, limited: limits.ephemeral-storage=1Gi

As I've understood nodes have limit 1Gi for ephemeral-storage, but what is 1280Mi? Is it correct, that kubernetes allocate some amount of memory for each volume?

...
  spec:
    containers:
      resources:
        limits:
          cpu: 1
          memory: 3Gi
          ephemeral-storage: "1Gi"
        requests:
          cpu: 1
          memory: 3Gi
          ephemeral-storage: "1Gi"
      volumeMounts:
        - name: app-logs
          mountPath: /app/log
        - name: app-tmp
          mountPath: /tmp
        - name: app-backups
          mountPath: /app/backups
        - name: app-logback
          mountPath: /app/config/logback.xml
          subPath: logback.xml
        - name: app-mdc
          mountPath: /app/config/mdc.properties
          subPath: mdc.properties
    volumes:
      - name: app-logs
        emptyDir: {}
      - name: app-tmp
        emptyDir: {}
      - name: app-backups
        emptyDir: {}
      - name: app-logback
        configMap:
          name: "{{ include "app.fullname" . }}-app-logback"
      - name: app-mdc
        configMap:
          name: "{{ include "app.fullname" . }}-app-mdc"

Resource quotes for namespace:

kubectl describe quota
Name:                     general-resourcequota
Namespace:                app
Resource                  Used  Hard
--------                  ----  ----
configmaps                5     15
limits.cpu                0     4
limits.ephemeral-storage  0     1Gi
limits.memory             0     8Gi
pods                      0     10
requests.cpu              0     2
requests.memory           0     4Gi
requests.storage          0     50Gi
services                  1     20
services.loadbalancers    1     5
services.nodeports        2     5

CodePudding user response:

You namespace has a quota set to cap at 1Gi:

limits.ephemeral-storage 0 1Gi

The messaging said that the namespace will exceed the limit and reach 1.28Gi (1280Mi) with your deployment.

Reduce your limit to 700Mi to stay within the 1Gi limit and your pod will be schedule accordingly. Note that quota aggregates resource consumption in the namespace, not per pod basis.

CodePudding user response:

You need to check resource quota set at the namespace level where you are running the ephemeral pod.

  • Related