mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
Add autoscaler for applications (#525)
- Transition to min/max instances instead of total instances
This commit is contained in:
committed by
GitHub
parent
52b8fd5549
commit
739e3d12e9
@@ -13,10 +13,10 @@ metadata:
|
||||
annotations:
|
||||
releaseTime: {% raw %}{{ dateInZone "2006-01-02 15:04:05Z" (now) "UTC"| quote }}{% endraw %}
|
||||
spec:
|
||||
replicas: {{ total_instances }}
|
||||
replicas: {{ min_instances }}
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
{% if total_instances == 1 %}
|
||||
{% if max_instances == 1 %}
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
{% endif %}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{%- if not is_storage and min_instances != max_instances %}
|
||||
apiVersion: autoscaling/v1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ sanitized_name }}
|
||||
namespace: {{ namespace }}
|
||||
labels:
|
||||
envId: {{ environment_id }}
|
||||
appId: {{ id }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ sanitized_name }}
|
||||
minReplicas: {{ min_instances }}
|
||||
maxReplicas: {{ max_instances }}
|
||||
targetCPUUtilizationPercentage: 60
|
||||
{%- endif %}
|
||||
|
||||
@@ -13,7 +13,7 @@ metadata:
|
||||
annotations:
|
||||
releaseTime: {% raw %}{{ dateInZone "2006-01-02 15:04:05Z" (now) "UTC"| quote }}{% endraw %}
|
||||
spec:
|
||||
replicas: {{ total_instances }}
|
||||
replicas: {{ min_instances }}
|
||||
serviceName: {{ sanitized_name }}
|
||||
selector:
|
||||
matchLabels:
|
||||
|
||||
Reference in New Issue
Block a user