'Can we add ephemeral-storage in LimitRange?

in LimitRange in k8s we can simply limit the ram and the cpu and can we do that for ephemeral-storage as wella?



Solution 1:[1]

To set default requests and limits on ephemeral storage for each container in mytest namespace:

apiVersion: v1
kind: LimitRange
metadata:
  name: storage-limit
  namespace: mytest
spec:
  limits:
  - default:
      ephemeral-storage: 2Gi
    defaultRequest:
      ephemeral-storage: 1Gi 
    type: Container

To change scope to Pod simply change to type: Pod

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gleb Golubiatnikov