-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test cases for mutating autoscaling policies (#159)
- Loading branch information
1 parent
49574ad
commit f05a469
Showing
35 changed files
with
1,415 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/hpa.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
tortoises.autoscaling.mercari.com/tortoise-name: mercari | ||
name: tortoise-hpa-mercari | ||
namespace: default | ||
spec: | ||
behavior: | ||
scaleDown: | ||
policies: | ||
- periodSeconds: 90 | ||
type: Percent | ||
value: 2 | ||
selectPolicy: Max | ||
scaleUp: | ||
policies: | ||
- periodSeconds: 60 | ||
type: Percent | ||
value: 100 | ||
selectPolicy: Max | ||
stabilizationWindowSeconds: 0 | ||
maxReplicas: 20 | ||
metrics: | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
target: | ||
averageUtilization: 50 | ||
type: Utilization | ||
type: ContainerResource | ||
- containerResource: | ||
container: istio-proxy | ||
name: cpu | ||
target: | ||
averageUtilization: 75 | ||
type: Utilization | ||
type: ContainerResource | ||
- containerResource: | ||
container: istio-proxy | ||
name: memory | ||
target: | ||
averageUtilization: 75 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 5 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
currentMetrics: null | ||
desiredReplicas: 0 |
93 changes: 93 additions & 0 deletions
93
controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/tortoise.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
metadata: | ||
name: mercari | ||
namespace: default | ||
spec: | ||
resourcePolicy: | ||
- autoscalingPolicy: | ||
cpu: Horizontal | ||
memory: Vertical | ||
containerName: app | ||
- autoscalingPolicy: | ||
cpu: Horizontal | ||
memory: Horizontal | ||
containerName: istio-proxy | ||
targetRefs: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
conditions: | ||
containerRecommendationFromVPA: | ||
- containerName: app | ||
maxRecommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: null | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: null | ||
recommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: null | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: null | ||
- containerName: istio-proxy | ||
maxRecommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: null | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: null | ||
recommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: null | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: null | ||
tortoiseConditions: null | ||
recommendations: | ||
horizontal: | ||
maxReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-10-06T01:15:46Z" | ||
value: 20 | ||
minReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-10-06T01:15:46Z" | ||
value: 5 | ||
targetUtilizations: | ||
- containerName: app | ||
targetUtilization: | ||
cpu: 50 | ||
- containerName: istio-proxy | ||
targetUtilization: | ||
cpu: 75 | ||
memory: 75 | ||
vertical: | ||
containerResourceRecommendation: | ||
- RecommendedResource: | ||
cpu: "6" | ||
memory: 3Gi | ||
containerName: app | ||
- RecommendedResource: | ||
cpu: "4" | ||
memory: 4Gi | ||
containerName: istio-proxy | ||
targets: | ||
deployment: "" | ||
horizontalPodAutoscaler: tortoise-hpa-mercari | ||
verticalPodAutoscalers: | ||
- name: tortoise-updater-mercari | ||
role: Updater | ||
- name: tortoise-monitor-mercari | ||
role: Monitor | ||
tortoisePhase: Working |
44 changes: 44 additions & 0 deletions
44
controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/vpa-Monitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
tortoises.autoscaling.mercari.com/tortoise-name: mercari | ||
name: tortoise-monitor-mercari | ||
namespace: default | ||
spec: | ||
resourcePolicy: | ||
containerPolicies: | ||
- containerName: app | ||
- containerName: istio-proxy | ||
targetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
updatePolicy: | ||
updateMode: "Off" | ||
status: | ||
conditions: | ||
- lastTransitionTime: null | ||
status: "True" | ||
type: RecommendationProvided | ||
recommendation: | ||
containerRecommendations: | ||
- containerName: app | ||
lowerBound: | ||
cpu: "3" | ||
memory: 3Gi | ||
target: | ||
cpu: "3" | ||
memory: 3Gi | ||
upperBound: | ||
cpu: "5" | ||
memory: 5Gi | ||
- containerName: istio-proxy | ||
lowerBound: | ||
cpu: "3" | ||
memory: 3Gi | ||
target: | ||
cpu: "3" | ||
memory: 3Gi | ||
upperBound: | ||
cpu: "5" | ||
memory: 5Gi |
48 changes: 48 additions & 0 deletions
48
controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/after/vpa-Updater.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
tortoises.autoscaling.mercari.com/tortoise-name: mercari | ||
name: tortoise-updater-mercari | ||
namespace: default | ||
spec: | ||
recommenders: | ||
- name: tortoise-controller | ||
resourcePolicy: | ||
containerPolicies: | ||
- containerName: app | ||
- containerName: istio-proxy | ||
targetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
updatePolicy: | ||
updateMode: Auto | ||
status: | ||
recommendation: | ||
containerRecommendations: | ||
- containerName: app | ||
lowerBound: | ||
cpu: "6" | ||
memory: 3Gi | ||
target: | ||
cpu: "6" | ||
memory: 3Gi | ||
uncappedTarget: | ||
cpu: "6" | ||
memory: 3Gi | ||
upperBound: | ||
cpu: "6" | ||
memory: 3Gi | ||
- containerName: istio-proxy | ||
lowerBound: | ||
cpu: "4" | ||
memory: 4Gi | ||
target: | ||
cpu: "4" | ||
memory: 4Gi | ||
uncappedTarget: | ||
cpu: "4" | ||
memory: 4Gi | ||
upperBound: | ||
cpu: "4" | ||
memory: 4Gi |
29 changes: 29 additions & 0 deletions
29
controllers/testdata/mutable-autoscalingpolicy-add-another-horizontal/before/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
metadata: | ||
name: mercari-app | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mercari | ||
strategy: {} | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: mercari | ||
spec: | ||
containers: | ||
- image: awesome-mercari-app-image | ||
name: app | ||
resources: | ||
requests: | ||
cpu: "10" | ||
memory: 10Gi | ||
- image: awesome-istio-proxy-image | ||
name: istio-proxy | ||
resources: | ||
requests: | ||
cpu: "4" | ||
memory: 4Gi | ||
status: | ||
replicas: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.