-
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.
implement MaxAllocatedResources and MaxReplicas in Tortoise
- Loading branch information
1 parent
7ae0c8b
commit d1e4959
Showing
18 changed files
with
1,438 additions
and
553 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
24 changes: 24 additions & 0 deletions
24
controllers/testdata/reconcile-for-the-single-container-pod-too-big/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,24 @@ | ||
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: "4" | ||
memory: 4Gi | ||
status: {} |
44 changes: 44 additions & 0 deletions
44
controllers/testdata/reconcile-for-the-single-container-pod-too-big/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,44 @@ | ||
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: 10 | ||
metrics: | ||
- external: | ||
metric: | ||
name: hoge-kept-metric | ||
target: | ||
type: Value | ||
value: "1" | ||
type: External | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
target: | ||
averageUtilization: 75 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 5 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
currentMetrics: null | ||
desiredReplicas: 0 |
110 changes: 110 additions & 0 deletions
110
controllers/testdata/reconcile-for-the-single-container-pod-too-big/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,110 @@ | ||
metadata: | ||
finalizers: | ||
- tortoise.autoscaling.mercari.com/finalizer | ||
name: mercari | ||
namespace: default | ||
spec: | ||
maxReplicas: 10 | ||
resourcePolicy: | ||
- containerName: app | ||
maxAllocatedResources: | ||
cpu: "1" | ||
memory: 1Gi | ||
targetRefs: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
status: | ||
autoscalingPolicy: | ||
- containerName: app | ||
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" | ||
containerResourceRequests: | ||
- containerName: app | ||
resource: | ||
cpu: "1" | ||
memory: 1Gi | ||
tortoiseConditions: | ||
- lastTransitionTime: "2023-01-01T00:00:00Z" | ||
lastUpdateTime: "2023-01-01T00:00:00Z" | ||
message: the current number of replicas is not bigger than the preferred max | ||
replica number | ||
reason: ScaledUpBasedOnPreferredMaxReplicas | ||
status: "False" | ||
type: ScaledUpBasedOnPreferredMaxReplicas | ||
- 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 | ||
recommendations: | ||
horizontal: | ||
maxReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
value: 20 | ||
minReplicas: | ||
- from: 0 | ||
timezone: Local | ||
to: 24 | ||
updatedAt: "2023-01-01T00:00:00Z" | ||
value: 5 | ||
targetUtilizations: | ||
- containerName: app | ||
targetUtilization: | ||
cpu: 75 | ||
vertical: | ||
containerResourceRecommendation: | ||
- RecommendedResource: | ||
cpu: "1" | ||
memory: 1Gi | ||
containerName: app | ||
targets: | ||
horizontalPodAutoscaler: tortoise-hpa-mercari | ||
scaleTargetRef: | ||
kind: "" | ||
name: "" | ||
verticalPodAutoscalers: | ||
- name: tortoise-monitor-mercari | ||
role: Monitor | ||
tortoisePhase: Working |
29 changes: 29 additions & 0 deletions
29
controllers/testdata/reconcile-for-the-single-container-pod-too-big/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,29 @@ | ||
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 |
22 changes: 22 additions & 0 deletions
22
controllers/testdata/reconcile-for-the-single-container-pod-too-big/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,22 @@ | ||
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: "4" | ||
memory: 4Gi | ||
replicas: 10 |
49 changes: 49 additions & 0 deletions
49
controllers/testdata/reconcile-for-the-single-container-pod-too-big/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,49 @@ | ||
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: 100 | ||
metrics: | ||
- external: | ||
metric: | ||
name: hoge-kept-metric | ||
target: | ||
type: Value | ||
value: "1" | ||
type: External | ||
- external: | ||
metric: | ||
name: hoge-exclude-metric | ||
target: | ||
type: Value | ||
value: "1" | ||
type: External | ||
- containerResource: | ||
container: app | ||
name: cpu | ||
target: | ||
averageUtilization: 50 | ||
type: Utilization | ||
type: ContainerResource | ||
minReplicas: 1 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: mercari-app | ||
|
Oops, something went wrong.