在运行时如何限制kuberntes中的PV容量存储

时间:2019-02-12 11:54:41

标签: kubernetes kubectl google-kubernetes-engine

我无法限制kuberntes中HOST路径上的PV量。

YAML:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ include "go-log.fullname" . }}
  namespace: {{ default "test" .Values.namespace  }}
spec:
  storageClassName: v1
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Mi

apiVersion: v1
kind: LimitRange
metadata:
  name: {{ include "go-log.fullname" . }}
  namespace: {{ default "test" .Values.namespace  }}
spec:
  limits:
  - type: PersistentVolumeClaim
    max:
      storage: 100Mi
    min:
      storage: 20Mi

kind: PersistentVolume
apiVersion: v1
metadata:
  name: {{ include "go-log.fullname" . }}
namespace: {{ default "test" .Values.namespace  }}
labels:
  type: local
spec:
   storageClassName: v1
   persistentVolumeReclaimPolicy: Recycle
capacity:
   storage: 50Mi

accessModes:
  - ReadWriteOnce
hostPath:
    path: {{ default "/home/app_data" .Values.go_pv.path  }}

但是我需要在Runtime Like期间限制pv(如果POD超过一定限制或在HOSTPATH中存储在PV或PVC中,则POD应该Evit

我已经编写了go-application,它将写入日志文件以挂载dir / home / app_data。我无法在运行时控制kubernetes中的卷存储

0 个答案:

没有答案