diff --git a/charts/metrics-agent/templates/hpa.yaml b/charts/metrics-agent/templates/hpa.yaml new file mode 100644 index 00000000..222f68e1 --- /dev/null +++ b/charts/metrics-agent/templates/hpa.yaml @@ -0,0 +1,14 @@ +{{- if .Values.hpa.enabled }} +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "metrics-agent.fullname" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "metrics-agent.fullname" . }} + minReplicas: {{ .Values.hpa.minReplicas }} + maxReplicas: {{ .Values.hpa.maxReplicas }} + targetCPUUtilizationPercentage: {{ .Values.hpa.targetCPUUtilizationPercentage }} +{{- end }} \ No newline at end of file diff --git a/charts/metrics-agent/templates/pdb.yaml b/charts/metrics-agent/templates/pdb.yaml new file mode 100644 index 00000000..6d81ac89 --- /dev/null +++ b/charts/metrics-agent/templates/pdb.yaml @@ -0,0 +1,11 @@ +{{- if .Values.pdb.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "metrics-agent.fullname" . }} +spec: + minAvailable: {{ .Values.pdb.minAvailable }} + selector: + matchLabels: + app: {{ include "metrics-agent.fullname" . }} +{{- end }} \ No newline at end of file diff --git a/charts/metrics-agent/values.yaml b/charts/metrics-agent/values.yaml index 32b8cf76..f843a07a 100644 --- a/charts/metrics-agent/values.yaml +++ b/charts/metrics-agent/values.yaml @@ -28,6 +28,16 @@ image: pullPolicy: Always imagePullSecrets: [] +# HorizontalPodAutoscaler +hpa: + enabled: false + minReplicas: 1 + maxReplicas: 3 + targetCPUUtilizationPercentage: 80 +#Disruption Budget for the Application in caes of node upgrades +pdb: + enabled: false + minAvailable: 1 resources: requests: