From 8343eaf0a8bf75519bbb0f47706c9f3d5a835597 Mon Sep 17 00:00:00 2001 From: Shuting Zhao Date: Fri, 15 Nov 2019 18:32:24 -0800 Subject: [PATCH] add generate rule for default limitrange --- samples/best_practices/add_ns_quota.yaml | 18 ++++++++++++++++++ .../samples/best_practices/add_ns_quota.yaml | 3 +++ 2 files changed, 21 insertions(+) diff --git a/samples/best_practices/add_ns_quota.yaml b/samples/best_practices/add_ns_quota.yaml index 1e17ce4970..9ae66b6260 100644 --- a/samples/best_practices/add_ns_quota.yaml +++ b/samples/best_practices/add_ns_quota.yaml @@ -24,3 +24,21 @@ spec: requests.memory: '16Gi' limits.cpu: '4' limits.memory: '16Gi' + - name: generate-limitrange + match: + resources: + kinds: + - Namespace + generate: + kind: LimitRange + name: "default-limitrange" + data: + spec: + limits: + - default: + cpu: 500m + memory: 1Gi + defaultRequest: + cpu: 200m + memory: 256Mi + type: Container diff --git a/test/scenarios/samples/best_practices/add_ns_quota.yaml b/test/scenarios/samples/best_practices/add_ns_quota.yaml index 2e4102ade8..649deea2fe 100644 --- a/test/scenarios/samples/best_practices/add_ns_quota.yaml +++ b/test/scenarios/samples/best_practices/add_ns_quota.yaml @@ -19,3 +19,6 @@ expected: - name: generate-resourcequota type: Generation success: true + - name: generate-limitrange + type: Generation + success: true