From b0b648bdcf64732c0a713bd8e45077c5f1b39ba6 Mon Sep 17 00:00:00 2001 From: Offending Commit Date: Wed, 3 Jun 2026 11:07:11 -0500 Subject: [PATCH] feat(helm): add optional HPA, PDB, and NetworkPolicy templates --- charts/openconcho/templates/hpa.yaml | 22 +++++++++++++++++++ .../openconcho/templates/networkpolicy.yaml | 20 +++++++++++++++++ charts/openconcho/templates/pdb.yaml | 18 +++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 charts/openconcho/templates/hpa.yaml create mode 100644 charts/openconcho/templates/networkpolicy.yaml create mode 100644 charts/openconcho/templates/pdb.yaml diff --git a/charts/openconcho/templates/hpa.yaml b/charts/openconcho/templates/hpa.yaml new file mode 100644 index 0000000..4f86d9a --- /dev/null +++ b/charts/openconcho/templates/hpa.yaml @@ -0,0 +1,22 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "openconcho.fullname" . }} + labels: + {{- include "openconcho.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "openconcho.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} +{{- end }} diff --git a/charts/openconcho/templates/networkpolicy.yaml b/charts/openconcho/templates/networkpolicy.yaml new file mode 100644 index 0000000..b7dfe4a --- /dev/null +++ b/charts/openconcho/templates/networkpolicy.yaml @@ -0,0 +1,20 @@ +{{- if .Values.networkPolicy.enabled }} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "openconcho.fullname" . }} + labels: + {{- include "openconcho.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + {{- include "openconcho.selectorLabels" . | nindent 6 }} + policyTypes: + - Ingress + ingress: + - ports: + - port: {{ .Values.service.containerPort }} + protocol: TCP + from: + - podSelector: {} +{{- end }} diff --git a/charts/openconcho/templates/pdb.yaml b/charts/openconcho/templates/pdb.yaml new file mode 100644 index 0000000..b28e59a --- /dev/null +++ b/charts/openconcho/templates/pdb.yaml @@ -0,0 +1,18 @@ +{{- if .Values.podDisruptionBudget.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "openconcho.fullname" . }} + labels: + {{- include "openconcho.labels" . | nindent 4 }} +spec: + {{- if .Values.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "openconcho.selectorLabels" . | nindent 6 }} +{{- end }}