Skip to content

配置资源请求和限制

您可以为各个Knative服务配置资源限制和请求,特别是CPU和内存。

下面的例子展示了如何为一个服务设置requestslimits字段:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: example-service
  namespace: default
spec:
  template:
    spec:
      containers:
        - image: docker.io/user/example-app
          resources:
            requests:
              cpu: 250m
              memory: 512Mi
            limits:
              cpu: 1

额外的资源

Back to top

We use analytics and cookies to understand site traffic. Information about your use of our site is shared with Google for that purpose. Learn more.

× OK