-
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.
refactor: file-based controller tests
- Loading branch information
1 parent
1753133
commit 54fe86f
Showing
78 changed files
with
3,549 additions
and
2,288 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
30 changes: 30 additions & 0 deletions
30
controllers/testdata/deletion-no-delete/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,30 @@ | ||
metadata: | ||
creationTimestamp: null | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
tortoises.autoscaling.mercari.com/tortoise-name: mercari | ||
creationTimestamp: null | ||
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: 100 | ||
metrics: | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
target: | ||
averageUtilization: 50 | ||
type: Utilization | ||
type: ContainerResource | ||
- containerResource: | ||
container: istio-proxy | ||
name: cpu | ||
target: | ||
averageUtilization: 50 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 1 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
currentMetrics: null | ||
desiredReplicas: 0 |
88 changes: 88 additions & 0 deletions
88
controllers/testdata/deletion-no-delete/before/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,88 @@ | ||
metadata: | ||
creationTimestamp: null | ||
name: mercari | ||
namespace: default | ||
spec: | ||
deletionPolicy: NoDelete | ||
resourcePolicy: | ||
- autoscalingPolicy: | ||
cpu: Horizontal | ||
memory: Vertical | ||
containerName: app | ||
- autoscalingPolicy: | ||
cpu: Horizontal | ||
memory: Vertical | ||
containerName: istio-proxy | ||
targetRefs: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
conditions: | ||
containerRecommendationFromVPA: | ||
- containerName: app | ||
maxRecommendation: | ||
cpu: | ||
quantity: "0" | ||
updatedAt: null | ||
memory: | ||
quantity: "0" | ||
updatedAt: null | ||
recommendation: | ||
cpu: | ||
quantity: "0" | ||
updatedAt: null | ||
memory: | ||
quantity: "0" | ||
updatedAt: null | ||
- containerName: istio-proxy | ||
maxRecommendation: | ||
cpu: | ||
quantity: "0" | ||
updatedAt: null | ||
memory: | ||
quantity: "0" | ||
updatedAt: null | ||
recommendation: | ||
cpu: | ||
quantity: "0" | ||
updatedAt: null | ||
memory: | ||
quantity: "0" | ||
updatedAt: null | ||
tortoiseConditions: null | ||
recommendations: | ||
horizontal: | ||
maxReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-10-06T01:32:21Z" | ||
value: 15 | ||
weekday: Friday | ||
minReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-10-06T01:32:21Z" | ||
value: 3 | ||
weekday: Friday | ||
targetUtilizations: | ||
- containerName: app | ||
targetUtilization: | ||
cpu: 50 | ||
- containerName: istio-proxy | ||
targetUtilization: | ||
cpu: 50 | ||
vertical: | ||
containerResourceRecommendation: null | ||
targets: | ||
deployment: "" | ||
horizontalPodAutoscaler: tortoise-hpa-mercari | ||
verticalPodAutoscalers: | ||
- name: tortoise-updater-mercari | ||
role: Updater | ||
- name: tortoise-monitor-mercari | ||
role: Monitor | ||
tortoisePhase: Working |
45 changes: 45 additions & 0 deletions
45
controllers/testdata/deletion-no-delete/before/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,45 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
tortoises.autoscaling.mercari.com/tortoise-name: mercari | ||
creationTimestamp: null | ||
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 |
21 changes: 21 additions & 0 deletions
21
controllers/testdata/deletion-no-delete/before/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,21 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
tortoises.autoscaling.mercari.com/tortoise-name: mercari | ||
creationTimestamp: null | ||
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: {} |
30 changes: 30 additions & 0 deletions
30
controllers/testdata/deletion-policy-all/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,30 @@ | ||
metadata: | ||
creationTimestamp: null | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
tortoises.autoscaling.mercari.com/tortoise-name: mercari | ||
creationTimestamp: null | ||
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: 100 | ||
metrics: | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
target: | ||
averageUtilization: 50 | ||
type: Utilization | ||
type: ContainerResource | ||
- containerResource: | ||
container: istio-proxy | ||
name: cpu | ||
target: | ||
averageUtilization: 50 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 1 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
currentMetrics: null | ||
desiredReplicas: 0 |
Oops, something went wrong.