|
| 1 | +{{- if .Values.hpa.enabled }} |
| 2 | +{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }} |
| 3 | +{{- if eq $isEnabled "true" }} |
| 4 | +apiVersion: autoscaling/v2 |
| 5 | +kind: HorizontalPodAutoscaler |
| 6 | +metadata: |
| 7 | + name: {{ include "wiz-hpa-enforcer.name" . }} |
| 8 | + namespace: {{ .Release.Namespace }} |
| 9 | + labels: |
| 10 | + {{- include "wiz-hpa-enforcer.labels" . | nindent 4 }} |
| 11 | +spec: |
| 12 | + scaleTargetRef: |
| 13 | + apiVersion: apps/v1 |
| 14 | + kind: Deployment |
| 15 | + name: {{ include "wiz-admission-controller.fullname" . }} |
| 16 | + minReplicas: {{ .Values.hpa.minReplicas }} |
| 17 | + maxReplicas: {{ .Values.hpa.maxReplicas }} |
| 18 | + metrics: |
| 19 | + {{- if .Values.hpa.enableCPU }} |
| 20 | + - type: Resource |
| 21 | + resource: |
| 22 | + name: cpu |
| 23 | + target: |
| 24 | + type: Utilization |
| 25 | + averageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }} |
| 26 | + {{- end }} |
| 27 | + {{- if .Values.hpa.enableMemory }} |
| 28 | + - type: Resource |
| 29 | + resource: |
| 30 | + name: memory |
| 31 | + target: |
| 32 | + type: Utilization |
| 33 | + averageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }} |
| 34 | + {{- end }} |
| 35 | + {{- with .Values.hpa.customMetrics }} |
| 36 | + {{- toYaml . | nindent 4 }} |
| 37 | + {{- end }} |
| 38 | + {{- if hasKey .Values.hpa "behavior" }} |
| 39 | + behavior: |
| 40 | + {{- toYaml .Values.hpa.behavior | nindent 4 }} |
| 41 | + {{- end }} |
| 42 | +--- |
| 43 | +{{- end }} |
| 44 | +{{ if .Values.kubernetesAuditLogsWebhook.enabled -}} |
| 45 | +apiVersion: autoscaling/v2 |
| 46 | +kind: HorizontalPodAutoscaler |
| 47 | +metadata: |
| 48 | + name: {{ include "wiz-hpa-audit-logs.name" . }} |
| 49 | + namespace: {{ .Release.Namespace }} |
| 50 | + labels: |
| 51 | + {{- include "wiz-hpa-audit-logs.labels" . | nindent 4 }} |
| 52 | +spec: |
| 53 | + scaleTargetRef: |
| 54 | + apiVersion: apps/v1 |
| 55 | + kind: Deployment |
| 56 | + name: {{ include "wiz-kubernetes-audit-log-collector.name" . }} |
| 57 | + minReplicas: {{ .Values.hpa.minReplicas }} |
| 58 | + maxReplicas: {{ .Values.hpa.maxReplicas }} |
| 59 | + metrics: |
| 60 | + {{- if .Values.hpa.enableCPU }} |
| 61 | + - type: Resource |
| 62 | + resource: |
| 63 | + name: cpu |
| 64 | + target: |
| 65 | + type: Utilization |
| 66 | + averageUtilization: {{ .Values.hpa.targetCPUUtilizationPercentage }} |
| 67 | + {{- end }} |
| 68 | + {{- if .Values.hpa.enableMemory }} |
| 69 | + - type: Resource |
| 70 | + resource: |
| 71 | + name: memory |
| 72 | + target: |
| 73 | + type: Utilization |
| 74 | + averageUtilization: {{ .Values.hpa.targetMemoryUtilizationPercentage }} |
| 75 | + {{- end }} |
| 76 | + {{- with .Values.hpa.customMetrics }} |
| 77 | + {{- toYaml . | nindent 4 }} |
| 78 | + {{- end }} |
| 79 | + {{- if hasKey .Values.hpa "behavior" }} |
| 80 | + behavior: |
| 81 | + {{- toYaml .Values.hpa.behavior | nindent 4 }} |
| 82 | + {{- end }} |
| 83 | +{{- end }} |
| 84 | +{{- end }} |
0 commit comments