Skip to content

Commit

Permalink
Merge pull request #23 from gabramov/hpafix
Browse files Browse the repository at this point in the history
hpa fix
  • Loading branch information
d7561985 authored Jul 10, 2023
2 parents 4882a9f + 24d4712 commit 381cfc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion charts/app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ description: Deployment for base pinup app
maintainers:
- email: [email protected]
name: DevOps
version: 3.1.15
version: 3.1.16
apiVersion: v2
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
{{- if .Values.hpa -}}
{{- $apiIsStable := semverCompare ">= 1.23.x" (include "kubeVersion" .) -}}
{{- if $apiIsStable }}
apiVersion: autoscaling/v2
{{ else }}
apiVersion: autoscaling/v2beta2
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Values.labels.app }}
name: {{ .Values.appName }}
{{- if .Values.hpa.annotations }}
annotations:
{{- range $key, $val := .Values.hpa.annotations }}
{{ $key }}: {{ $val }}
{{- end }}
{{ toYaml .Values.hpa.annotations | indent 4 }}
{{- end }}
labels:
{{- range $key, $val := .Values.labels }}
{{ $key }}: {{ $val | quote }}
{{- end }}
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Values.labels.app }}
name: {{ .Values.appName }}
minReplicas: {{ .Values.hpa.minReplicas | default "3"}}
maxReplicas: {{ .Values.hpa.maxReplicas | default "6"}}
{{- if .Values.hpa.behavior }}
behavior:
{{- toYaml .Values.hpa.behavior | nindent 4 }}
{{- toYaml .Values.hpa.behavior | indent 4 }}
{{- end }}
metrics:
{{- if .Values.hpa.cpu }}
Expand Down Expand Up @@ -59,4 +52,4 @@ spec:
type: Value
value: {{ .Values.hpa.customTarget | default "100" }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ hpa:
minReplicas: 3
maxReplicas: 6
cpu: 70
memory: 70
memory: 70

0 comments on commit 381cfc7

Please sign in to comment.