-
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.
reads an attached HPA and sets “Horizontal” to resources managed by t…
…he attached HPA (#215)
- Loading branch information
1 parent
c8694a7
commit a2f104b
Showing
14 changed files
with
255 additions
and
24 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
api/v1beta2/testdata/mutating/with-hpa-and-istio/after.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,26 @@ | ||
apiVersion: autoscaling.mercari.com/v1beta2 | ||
kind: Tortoise | ||
metadata: | ||
name: tortoise-sample | ||
namespace: default | ||
spec: | ||
updateMode: "Off" | ||
deletionPolicy: "NoDelete" | ||
targetRefs: | ||
horizontalPodAutoscalerName: sample-hpa | ||
scaleTargetRef: | ||
kind: Deployment | ||
name: sample | ||
resourcePolicy: | ||
- containerName: hoge | ||
autoscalingPolicy: | ||
cpu: Vertical | ||
memory: Horizontal | ||
- containerName: nginx | ||
autoscalingPolicy: | ||
cpu: Horizontal | ||
memory: Vertical | ||
- containerName: istio-proxy | ||
autoscalingPolicy: | ||
cpu: Horizontal | ||
memory: Vertical |
11 changes: 11 additions & 0 deletions
11
api/v1beta2/testdata/mutating/with-hpa-and-istio/before.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,11 @@ | ||
apiVersion: autoscaling.mercari.com/v1beta2 | ||
kind: Tortoise | ||
metadata: | ||
name: tortoise-sample | ||
namespace: default | ||
spec: | ||
targetRefs: | ||
horizontalPodAutoscalerName: sample-hpa | ||
scaleTargetRef: | ||
kind: Deployment | ||
name: sample |
28 changes: 28 additions & 0 deletions
28
api/v1beta2/testdata/mutating/with-hpa-and-istio/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,28 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: sample | ||
namespace: default | ||
labels: | ||
app: nginx | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
annotations: | ||
sidecar.istio.io/inject: "true" | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: hoge | ||
image: hoge:1.0.0 | ||
ports: | ||
- containerPort: 81 | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 |
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,34 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: sample-hpa | ||
namespace: default | ||
spec: | ||
maxReplicas: 10 | ||
metrics: | ||
- type: ContainerResource | ||
containerResource: | ||
name: cpu | ||
container: nginx | ||
target: | ||
type: Utilization | ||
averageUtilization: 60 | ||
- type: ContainerResource | ||
containerResource: | ||
name: memory | ||
container: hoge | ||
target: | ||
type: Utilization | ||
averageUtilization: 60 | ||
- type: ContainerResource | ||
containerResource: | ||
name: cpu | ||
container: istio-proxy | ||
target: | ||
type: Utilization | ||
averageUtilization: 60 | ||
minReplicas: 3 | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: sample |
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 @@ | ||
apiVersion: autoscaling.mercari.com/v1beta2 | ||
kind: Tortoise | ||
metadata: | ||
name: tortoise-sample | ||
namespace: default | ||
spec: | ||
updateMode: "Off" | ||
deletionPolicy: "NoDelete" | ||
targetRefs: | ||
horizontalPodAutoscalerName: sample-hpa | ||
scaleTargetRef: | ||
kind: Deployment | ||
name: sample | ||
resourcePolicy: | ||
- containerName: hoge | ||
autoscalingPolicy: | ||
cpu: Vertical | ||
memory: Horizontal | ||
- containerName: nginx | ||
autoscalingPolicy: | ||
cpu: Horizontal | ||
memory: Vertical |
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,11 @@ | ||
apiVersion: autoscaling.mercari.com/v1beta2 | ||
kind: Tortoise | ||
metadata: | ||
name: tortoise-sample | ||
namespace: default | ||
spec: | ||
targetRefs: | ||
horizontalPodAutoscalerName: sample-hpa | ||
scaleTargetRef: | ||
kind: Deployment | ||
name: sample |
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,26 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: sample | ||
namespace: default | ||
labels: | ||
app: nginx | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: hoge | ||
image: hoge:1.0.0 | ||
ports: | ||
- containerPort: 81 | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 |
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
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