Skip to content

Commit

Permalink
add new test CRD to replace kruise API
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvindthiru committed Jun 21, 2024
1 parent a9c1d6c commit af1c036
Show file tree
Hide file tree
Showing 57 changed files with 988 additions and 3,007 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ CRD_OPTIONS ?= "crd"
.PHONY: manifests
manifests: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) \
$(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./apis/..." output:crd:artifacts:config=config/crd/bases

# Generate code
generate: $(CONTROLLER_GEN)
Expand Down
2 changes: 1 addition & 1 deletion examples/test-cro1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
clusterResourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
overrideRules:
Expand Down
2 changes: 1 addition & 1 deletion examples/test-crp1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
resourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
placementType: PickN
Expand Down
2 changes: 1 addition & 1 deletion examples/test-crp2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
resourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
placementType: PickN
Expand Down
2 changes: 1 addition & 1 deletion examples/test-crp3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
resourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
placementType: PickN
Expand Down
2 changes: 1 addition & 1 deletion examples/test-crp4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
resourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
placementType: PickN
Expand Down
2 changes: 1 addition & 1 deletion examples/test-crp5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
resourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
placementType: PickN
Expand Down
2 changes: 1 addition & 1 deletion examples/test-crp6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
resourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
placementType: PickAll
Expand Down
2 changes: 1 addition & 1 deletion examples/test-crp8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spec:
resourceSelectors:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
name: clonesets.apps.kruise.io
name: testresources.test.kubernetes-fleet.io
version: v1
policy:
placementType: PickN
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/google/go-cmp v0.6.0
github.com/onsi/ginkgo/v2 v2.17.2
github.com/onsi/gomega v1.33.1
github.com/openkruise/kruise v1.4.0
github.com/prometheus/client_golang v1.19.1
github.com/prometheus/client_model v0.6.1
github.com/spf13/cobra v1.8.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g
github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc=
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
github.com/openkruise/kruise v1.4.0 h1:1OTosvEat+2sE59jaj3sqicdkHqMkTrafq0mSaHBLYs=
github.com/openkruise/kruise v1.4.0/go.mod h1:b6DHo7c3d8pDyIoT13/dCDiuAn6F8fZR1644c9Dui1I=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
Expand Down
4 changes: 2 additions & 2 deletions hack/loadtest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Create any resources you would like to place and/or a crp file to use.
>
> group: apiextensions.k8s.io
> kind: CustomResourceDefinition
> name: clonesets.apps.kruise.io
> name: testresources.test.kubernetes-fleet.io
> version: v1
- `max-current-placement`: The number of current placement load. Default value is `20`.
Expand All @@ -36,7 +36,7 @@ Create any resources you would like to place and/or a crp file to use.
- `poll-interval-millisecond`: The poll interval for verification (in milli-second). Default value is `250`.
- `use-test-resources`: Boolean to include all test resources in the test. Default value is `false`.
> **_NOTE:_** If this option is true, the test will create resources and add them to the crp for them to be placed. The following resources are added:
> `Namespace` that contains all the resources, `PodDisruptionBudget`, 2 `ConfigMap`'s, `Secret`, `Service`, `Cloneset`, `Role`, and `RoleBinding`.
> `Namespace` that contains all the resources, `PodDisruptionBudget`, 2 `ConfigMap`'s, `Secret`, `Service`, `TestResource`, `Role`, and `RoleBinding`.
> If this option is false, the test will only use the resources specified in the crp file.
### Run the Load Test:
Expand Down
25 changes: 0 additions & 25 deletions hack/loadtest/manifests/test-cloneset.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions hack/loadtest/manifests/test-resource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: test.kubernetes-fleet.io/v1alpha1
kind: TestResource
metadata:
name: random-test-resource
namespace: app
spec:
foo: foo1
items:
- a
- b
Loading

0 comments on commit af1c036

Please sign in to comment.