apiVersion: apps/v1
kind: Deployment
metadata:
  name: testCpuAndVolumes
  labels:
    app: testCpuAndVolumes
spec:
  replicas: 1
  template:
    spec:
      containers:
      - name: testCpuAndVolumes
        volumeMounts:
        - mountPath: "/opt/SpringCloud/logs"
          name: logs
        resources:
          requests: 
            memory: 2Gi        #内存最小使用量(默认值,可根据实际情况修改)
            cpu: "0.3"        #cpu最小使用率(默认值,可根据实际情况修改)
          limits:
            memory: 6Gi        #内存最大使用量(默认值,可根据实际情况修改)
            cpu: "6"        #cpu最大使用率(默认值,可根据实际情况修改)
      volumes:
        - name: logs
          hostPath:
             path: /opt/logs
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐