-
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 controller test and fix checkHPAStatus function
- Loading branch information
1 parent
12c7b05
commit ed22342
Showing
16 changed files
with
583 additions
and
59 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
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
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
...ntroller/testdata/reconcile-automatic-emergency-mode-hpa-no-metrics/after/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: | ||
name: mercari-app | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mercari | ||
strategy: {} | ||
template: | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/restartedAt: "2023-01-01T00:00:00Z" | ||
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: {} |
61 changes: 61 additions & 0 deletions
61
...rnal/controller/testdata/reconcile-automatic-emergency-mode-hpa-no-metrics/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,61 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
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: 55 | ||
type: Utilization | ||
type: ContainerResource | ||
- containerResource: | ||
container: istio-proxy | ||
name: cpu | ||
target: | ||
averageUtilization: 55 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 20 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
conditions: | ||
- status: "True" | ||
type: AbleToScale | ||
message: "recommended size matches current size" | ||
- status: "True" | ||
type: ScalingActive | ||
message: "the HPA was able to compute the replica count" | ||
currentMetrics: | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
current: | ||
value: 0 | ||
- containerResource: | ||
container: istio-proxy | ||
name: cpu | ||
current: | ||
value: 0 | ||
desiredReplicas: 0 |
Oops, something went wrong.