mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-03 15:56:22 +00:00
refactor: Remove old Helm chart files and templates feat: Add new Helm chart structure for neo-blog deployment chore: Add .helmignore and initial Chart.yaml for Helm chart feat: Implement backend and frontend deployment templates in Helm chart feat: Create services and ingress configurations for backend and frontend chore: Define resource limits and requests for backend and frontend in values.yaml feat: Enable autoscaling configuration for backend and frontend deployments chore: Clean up unused files and configurations from previous setup
66 lines
2.0 KiB
YAML
66 lines
2.0 KiB
YAML
{{- if .Values.autoscaling.enabled }}
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ include "neo-blog.fullname" . }}-backend
|
|
labels:
|
|
{{- include "neo-blog.backend.selectorLabels" . | nindent 4 }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ include "neo-blog.fullname" . }}-backend
|
|
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
|
metrics:
|
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- if .Values.frontend.enabled -}}
|
|
---
|
|
apiVersion: autoscaling/v2
|
|
kind: HorizontalPodAutoscaler
|
|
metadata:
|
|
name: {{ include "neo-blog.fullname" . }}-frontend
|
|
labels:
|
|
{{- include "neo-blog.frontend.selectorLabels" . | nindent 4 }}
|
|
spec:
|
|
scaleTargetRef:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
name: {{ include "neo-blog.fullname" . }}-frontend
|
|
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
|
metrics:
|
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: cpu
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
|
- type: Resource
|
|
resource:
|
|
name: memory
|
|
target:
|
|
type: Utilization
|
|
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
|
{{- end }}
|
|
{{- end -}}
|
|
{{- end }}
|