-
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.
- Loading branch information
1 parent
7d07efd
commit 12c7b05
Showing
11 changed files
with
532 additions
and
31 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...ontroller/testdata/reconcile-automatic-emergency-mode-hpa-condition/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: {} |
51 changes: 51 additions & 0 deletions
51
internal/controller/testdata/reconcile-automatic-emergency-mode-hpa-condition/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,51 @@ | ||
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: 15 | ||
metrics: | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
target: | ||
averageUtilization: 30 | ||
type: Utilization | ||
type: ContainerResource | ||
- containerResource: | ||
container: istio-proxy | ||
name: cpu | ||
target: | ||
averageUtilization: 30 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 15 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
conditions: | ||
- status: "True" | ||
type: AbleToScale | ||
message: "recommended size matches current size" | ||
- status: "False" | ||
type: ScalingActive | ||
message: "the HPA was unable to compute the replica count: failed to get cpu utilization" | ||
currentMetrics: null | ||
desiredReplicas: 0 |
136 changes: 136 additions & 0 deletions
136
.../controller/testdata/reconcile-automatic-emergency-mode-hpa-condition/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,136 @@ | ||
metadata: | ||
finalizers: | ||
- tortoise.autoscaling.mercari.com/finalizer | ||
name: mercari | ||
namespace: default | ||
spec: | ||
targetRefs: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
updateMode: Emergency | ||
status: | ||
autoscalingPolicy: | ||
- containerName: app | ||
policy: | ||
cpu: Horizontal | ||
memory: Vertical | ||
- containerName: istio-proxy | ||
policy: | ||
cpu: Horizontal | ||
memory: Vertical | ||
conditions: | ||
containerRecommendationFromVPA: | ||
- containerName: app | ||
maxRecommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
recommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
- containerName: istio-proxy | ||
maxRecommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
recommendation: | ||
cpu: | ||
quantity: "3" | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
memory: | ||
quantity: 3Gi | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
containerResourceRequests: | ||
- containerName: app | ||
resource: | ||
cpu: "6" | ||
memory: 3Gi | ||
- containerName: istio-proxy | ||
resource: | ||
cpu: "4" | ||
memory: 3Gi | ||
tortoiseConditions: | ||
- lastTransitionTime: "2023-01-01T00:00:00Z" | ||
lastUpdateTime: "2023-01-01T00:00:00Z" | ||
message: HPA target utilization is updated | ||
reason: HPATargetUtilizationUpdated | ||
status: "True" | ||
type: HPATargetUtilizationUpdated | ||
- lastTransitionTime: "2023-01-01T00:00:00Z" | ||
lastUpdateTime: "2023-01-01T00:00:00Z" | ||
message: The recommendation is provided | ||
status: "True" | ||
type: VerticalRecommendationUpdated | ||
- lastTransitionTime: "2023-01-01T00:00:00Z" | ||
lastUpdateTime: "2023-01-01T00:00:00Z" | ||
status: "False" | ||
type: FailedToReconcile | ||
containerResourcePhases: | ||
- containerName: app | ||
resourcePhases: | ||
cpu: | ||
lastTransitionTime: null | ||
phase: Working | ||
memory: | ||
lastTransitionTime: "2023-01-01T00:00:00Z" | ||
phase: Working | ||
- containerName: istio-proxy | ||
resourcePhases: | ||
cpu: | ||
lastTransitionTime: null | ||
phase: Working | ||
memory: | ||
lastTransitionTime: "2023-01-01T00:00:00Z" | ||
phase: Working | ||
recommendations: | ||
horizontal: | ||
maxReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-10-06T01:15:47Z" | ||
value: 15 | ||
minReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-10-06T01:15:47Z" | ||
value: 3 | ||
targetUtilizations: | ||
- containerName: app | ||
targetUtilization: | ||
cpu: 30 | ||
- containerName: istio-proxy | ||
targetUtilization: | ||
cpu: 30 | ||
vertical: | ||
containerResourceRecommendation: | ||
- RecommendedResource: | ||
cpu: "6" | ||
memory: 3Gi | ||
containerName: app | ||
- RecommendedResource: | ||
cpu: "4" | ||
memory: 3Gi | ||
containerName: istio-proxy | ||
targets: | ||
horizontalPodAutoscaler: tortoise-hpa-mercari | ||
scaleTargetRef: | ||
kind: "" | ||
name: "" | ||
verticalPodAutoscalers: | ||
- name: tortoise-monitor-mercari | ||
role: Monitor | ||
tortoisePhase: Emergency |
39 changes: 39 additions & 0 deletions
39
...ntroller/testdata/reconcile-automatic-emergency-mode-hpa-condition/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,39 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
name: tortoise-monitor-mercari | ||
namespace: default | ||
spec: | ||
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 |
27 changes: 27 additions & 0 deletions
27
...ntroller/testdata/reconcile-automatic-emergency-mode-hpa-condition/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,27 @@ | ||
metadata: | ||
name: mercari-app | ||
namespace: default | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mercari | ||
strategy: {} | ||
template: | ||
metadata: | ||
annotations: | ||
sidecar.istio.io/inject: "true" | ||
sidecar.istio.io/proxyCPU: "4" | ||
sidecar.istio.io/proxyMemory: "4Gi" | ||
labels: | ||
app: mercari | ||
spec: | ||
containers: | ||
- name: istio-proxy # will be ignored. | ||
image: auto | ||
- image: awesome-mercari-app-image | ||
name: app | ||
resources: | ||
requests: | ||
cpu: "10" | ||
memory: 10Gi | ||
replicas: 10 |
50 changes: 50 additions & 0 deletions
50
...rnal/controller/testdata/reconcile-automatic-emergency-mode-hpa-condition/before/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,50 @@ | ||
metadata: | ||
annotations: | ||
tortoise.autoscaling.mercari.com/managed-by-tortoise: "true" | ||
name: tortoise-hpa-mercari | ||
namespace: default | ||
status: | ||
conditions: | ||
- status: "True" | ||
type: AbleToScale | ||
message: "recommended size matches current size" | ||
- status: "False" | ||
type: ScalingActive | ||
message: "the HPA was unable to compute the replica count: failed to get cpu utilization" | ||
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: 15 | ||
metrics: | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
target: | ||
averageUtilization: 30 | ||
type: Utilization | ||
type: ContainerResource | ||
- containerResource: | ||
container: istio-proxy | ||
name: cpu | ||
target: | ||
averageUtilization: 30 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 3 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
|
Oops, something went wrong.