-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add phase 1 of production deployment (#716)
* Add phase 1 of production deployment * Create ingress.tpl.yml
- Loading branch information
1 parent
b3ef297
commit 09606bc
Showing
6 changed files
with
137 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: intranet-production | ||
namespace: intranet-production | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: intranet-production | ||
minReplicas: 4 | ||
maxReplicas: 12 | ||
metrics: | ||
# fpm | ||
- type: ContainerResource | ||
containerResource: | ||
name: cpu | ||
container: fpm | ||
target: | ||
type: Utilization | ||
# If request is 500m let's early scale at 250m | ||
# Rely on CPU usage for scaling more than memory usage. | ||
# For scaling down, CPU settles quickly and memory is freed up slowly. | ||
averageUtilization: 50 | ||
- type: ContainerResource | ||
containerResource: | ||
name: memory | ||
container: fpm | ||
target: | ||
type: Utilization | ||
# If request is 640Mi and php max is 384Mi let's scale at 512Mi | ||
averageUtilization: 80 | ||
# nginx | ||
- type: ContainerResource | ||
containerResource: | ||
name: cpu | ||
container: nginx | ||
target: | ||
type: Utilization | ||
averageUtilization: 60 | ||
- type: ContainerResource | ||
containerResource: | ||
name: memory | ||
container: nginx | ||
target: | ||
type: Utilization | ||
averageUtilization: 70 |
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 @@ | ||
# Intentionally empty file. |
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,13 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PodMonitor | ||
metadata: | ||
name: intranet-production | ||
namespace: intranet-production | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: intranet-production | ||
podMetricsEndpoints: | ||
- port: http | ||
path: "/metrics/fpm" | ||
interval: 15s |
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,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nginx-service | ||
labels: | ||
app: intranet-production | ||
spec: | ||
ports: | ||
- port: 8080 | ||
name: http | ||
selector: | ||
app: intranet-production |
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