Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Add autoscalers to k8s deployment #303

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
release: {{ quote .Release.Name }}
heritage: {{ quote .Release.Service }}
spec:
replicas: {{ .Values.input_reader.replicaCount }}
replicas: 3
selector:
matchLabels:
app: {{ quote $fullname }}
Expand All @@ -26,4 +26,17 @@ spec:
- configMapRef:
name: {{ .Release.Name }}-input-reader-config
{{ if .Values.registry }}imagePullSecrets:
- name: {{ .Values.imagePullSecret}}{{ end }}
- name: {{ .Values.imagePullSecret}}{{ end }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ $fullname }}
spec:
maxReplicas: 9
minReplicas: 3
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ $fullname }}
targetCPUUtilizationPercentage: 75
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
release: {{ quote $root.Release.Name }}
heritage: {{ quote $root.Release.Service }}
spec:
replicas: 1
replicas: 3
selector:
matchLabels:
app: {{ $root.Release.Name }}-{{ $appName | replace "_" "-" }}-slot1
Expand All @@ -40,5 +40,18 @@ spec:
{{ if $root.Values.registry }}imagePullSecrets:
- name: {{ $root.Values.imagePullSecret}}{{ end }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ $root.Release.Name }}-{{ $appName | replace "_" "-" }}-slot1
spec:
maxReplicas: 9
minReplicas: 3
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ $root.Release.Name }}-{{ $appName | replace "_" "-" }}-slot1
targetCPUUtilizationPercentage: 75
---
{{- end }}
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
release: {{ quote $root.Release.Name }}
heritage: {{ quote $root.Release.Service }}
spec:
replicas: 1
replicas: 3
selector:
matchLabels:
app: {{ $root.Release.Name }}-{{ $appName | replace "_" "-" }}-slot2
Expand All @@ -40,5 +40,18 @@ spec:
{{ if $root.Values.registry }}imagePullSecrets:
- name: {{ $root.Values.imagePullSecret}}{{ end }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ $root.Release.Name }}-{{ $appName | replace "_" "-" }}-slot2
spec:
maxReplicas: 9
minReplicas: 3
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ $root.Release.Name }}-{{ $appName | replace "_" "-" }}-slot2
targetCPUUtilizationPercentage: 75
---
{{- end }}
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ input_reader:
name: input_reader
# tag:
imagePullPolicy: IfNotPresent
replicaCount: 2
env:
MESSAGING_TYPE: "" # kafka or eventhub
# eventhub
Expand Down