1.vim ex280-quota.yaml编辑定额资源文件。cat ex280-quota.yaml 查看定额资源文件。
[student@workstation test]$ vim ex280-quota.yaml
[student@workstation test]$ cat ex280-quota.yaml
apiVersion: v1
kind: ResourceQuota
metadata:
name: ex280-quota
spec:
hard:
memory: "1Gi"
cpu: "2m"
replicationcontrollers: 3
pods: 3
services: 6
2.vim ex280-limits.yaml 编写限额资源文件。 cat ex280-limits.yaml查看限额资源文件。
[student@workstation test]$ vim ex280-limits.yaml
[student@workstation test]$ cat ex280-limits.yaml
apiVersion: v1
kind: LimitRange
metadata:
name: ex280-limits
spec:
limits:
- type: "Pod"
max:
cpu: "500m"
memory: "300Mi"
min:
cpu: "10m"
memory: "5Mi"