Update to autoscaling/v2beta1 syntax for hpa
This commit is contained in:
		
							parent
							
								
									efc58de740
								
							
						
					
					
						commit
						3077a1d304
					
				
					 3 changed files with 51 additions and 30 deletions
				
			
		| 
						 | 
					@ -1,19 +1,28 @@
 | 
				
			||||||
{{- if .Values.web.hpa.enabled -}}
 | 
					{{- if .Values.web.autoscaling.enabled -}}
 | 
				
			||||||
apiVersion: autoscaling/v1
 | 
					apiVersion: autoscaling/v2beta1
 | 
				
			||||||
kind: HorizontalPodAutoscaler
 | 
					kind: HorizontalPodAutoscaler
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
  name: {{ template "glitchtip.fullname" . }}
 | 
					  name: {{ template "glitchtip.fullname" . }}
 | 
				
			||||||
  labels:
 | 
					  labels:
 | 
				
			||||||
    app: {{ template "glitchtip.fullname" . }}
 | 
					    {{- include "glitchtip.labels" . | nindent 4 }}
 | 
				
			||||||
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
 | 
					 | 
				
			||||||
    release: "{{ .Release.Name }}"
 | 
					 | 
				
			||||||
    heritage: "{{ .Release.Service }}"
 | 
					 | 
				
			||||||
spec:
 | 
					spec:
 | 
				
			||||||
  scaleTargetRef:
 | 
					  scaleTargetRef:
 | 
				
			||||||
    kind: Deployment
 | 
					 | 
				
			||||||
    apiVersion: apps/v1
 | 
					    apiVersion: apps/v1
 | 
				
			||||||
 | 
					    kind: Deployment
 | 
				
			||||||
    name: {{ template "glitchtip.fullname" . }}
 | 
					    name: {{ template "glitchtip.fullname" . }}
 | 
				
			||||||
  minReplicas: {{ .Values.web.hpa.minpods }}
 | 
					  minReplicas: {{ .Values.web.autoscaling.minReplicas }}
 | 
				
			||||||
  maxReplicas: {{ .Values.web.hpa.maxpods }}
 | 
					  maxReplicas: {{ .Values.web.autoscaling.maxReplicas }}
 | 
				
			||||||
  targetCPUUtilizationPercentage: {{ .Values.web.hpa.cputhreshold }}
 | 
					  metrics:
 | 
				
			||||||
 | 
					    {{- if .Values.web.autoscaling.targetCPUUtilizationPercentage }}
 | 
				
			||||||
 | 
					    - type: Resource
 | 
				
			||||||
 | 
					      resource:
 | 
				
			||||||
 | 
					        name: cpu
 | 
				
			||||||
 | 
					        targetAverageUtilization: {{ .Values.web.autoscaling.targetCPUUtilizationPercentage }}
 | 
				
			||||||
 | 
					    {{- end }}
 | 
				
			||||||
 | 
					    {{- if .Values.web.autoscaling.targetMemoryUtilizationPercentage }}
 | 
				
			||||||
 | 
					    - type: Resource
 | 
				
			||||||
 | 
					      resource:
 | 
				
			||||||
 | 
					        name: memory
 | 
				
			||||||
 | 
					        targetAverageUtilization: {{ .Values.web.autoscaling.targetMemoryUtilizationPercentage }}
 | 
				
			||||||
 | 
					    {{- end }}
 | 
				
			||||||
{{- end }}
 | 
					{{- end }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,19 +1,28 @@
 | 
				
			||||||
{{- if .Values.worker.hpa.enabled -}}
 | 
					{{- if .Values.worker.autoscaling.enabled -}}
 | 
				
			||||||
apiVersion: autoscaling/v1
 | 
					apiVersion: autoscaling/v2beta1
 | 
				
			||||||
kind: HorizontalPodAutoscaler
 | 
					kind: HorizontalPodAutoscaler
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
  name: {{ template "glitchtip.fullname" . }}-worker
 | 
					  name: {{ template "glitchtip.fullname" . }}
 | 
				
			||||||
  labels:
 | 
					  labels:
 | 
				
			||||||
    app: {{ template "glitchtip.fullname" . }}
 | 
					    {{- include "glitchtip.labels" . | nindent 4 }}
 | 
				
			||||||
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
 | 
					 | 
				
			||||||
    release: "{{ .Release.Name }}"
 | 
					 | 
				
			||||||
    heritage: "{{ .Release.Service }}"
 | 
					 | 
				
			||||||
spec:
 | 
					spec:
 | 
				
			||||||
  scaleTargetRef:
 | 
					  scaleTargetRef:
 | 
				
			||||||
    kind: Deployment
 | 
					 | 
				
			||||||
    apiVersion: apps/v1
 | 
					    apiVersion: apps/v1
 | 
				
			||||||
 | 
					    kind: Deployment
 | 
				
			||||||
    name: {{ template "glitchtip.fullname" . }}-worker
 | 
					    name: {{ template "glitchtip.fullname" . }}-worker
 | 
				
			||||||
  minReplicas: {{ .Values.worker.hpa.minpods }}
 | 
					  minReplicas: {{ .Values.worker.autoscaling.minReplicas }}
 | 
				
			||||||
  maxReplicas: {{ .Values.worker.hpa.maxpods }}
 | 
					  maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }}
 | 
				
			||||||
  targetCPUUtilizationPercentage: {{ .Values.worker.hpa.cputhreshold }}
 | 
					  metrics:
 | 
				
			||||||
{{- end }}
 | 
					    {{- if .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
 | 
				
			||||||
 | 
					    - type: Resource
 | 
				
			||||||
 | 
					      resource:
 | 
				
			||||||
 | 
					        name: cpu
 | 
				
			||||||
 | 
					        targetAverageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }}
 | 
				
			||||||
 | 
					    {{- end }}
 | 
				
			||||||
 | 
					    {{- if .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
 | 
				
			||||||
 | 
					    - type: Resource
 | 
				
			||||||
 | 
					      resource:
 | 
				
			||||||
 | 
					        name: memory
 | 
				
			||||||
 | 
					        targetAverageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }}
 | 
				
			||||||
 | 
					    {{- end }}
 | 
				
			||||||
 | 
					{{- end }}
 | 
				
			||||||
							
								
								
									
										19
									
								
								values.yaml
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								values.yaml
									
										
									
									
									
								
							| 
						 | 
					@ -23,11 +23,13 @@ environmentVariables:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
web:
 | 
					web:
 | 
				
			||||||
  replicaCount: 1
 | 
					  replicaCount: 1
 | 
				
			||||||
  hpa:
 | 
					  autoscaling:
 | 
				
			||||||
    enabled: false
 | 
					    enabled: false
 | 
				
			||||||
    cputhreshold: 70
 | 
					    minReplicas: 1
 | 
				
			||||||
    minpods: 2
 | 
					    maxReplicas: 100
 | 
				
			||||||
    maxpods: 4
 | 
					    targetCPUUtilizationPercentage: 80
 | 
				
			||||||
 | 
					    # targetMemoryUtilizationPercentage: 80
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # budget:
 | 
					  # budget:
 | 
				
			||||||
  #  minAvailable: 1
 | 
					  #  minAvailable: 1
 | 
				
			||||||
  resources:
 | 
					  resources:
 | 
				
			||||||
| 
						 | 
					@ -52,11 +54,12 @@ web:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
worker:
 | 
					worker:
 | 
				
			||||||
  replicaCount: 1
 | 
					  replicaCount: 1
 | 
				
			||||||
  hpa:
 | 
					  autoscaling:
 | 
				
			||||||
    enabled: false
 | 
					    enabled: false
 | 
				
			||||||
    cputhreshold: 90
 | 
					    minReplicas: 1
 | 
				
			||||||
    minpods: 1
 | 
					    maxReplicas: 100
 | 
				
			||||||
    maxpods: 4
 | 
					    targetCPUUtilizationPercentage: 90
 | 
				
			||||||
 | 
					    # targetMemoryUtilizationPercentage: 80
 | 
				
			||||||
  resources:
 | 
					  resources:
 | 
				
			||||||
    {}
 | 
					    {}
 | 
				
			||||||
    # limits:
 | 
					    # limits:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue