Add Helm chart for deploying web and API components
All checks were successful
Build and Deploy / build-web (push) Successful in 36s
Build and Deploy / build-api (push) Successful in 38s

- Created complete Helm chart with deployments, services, and ingress
- Added support for both web frontend and API backend components
- Included autoscaling (HPA) for both components
- Added pod disruption budgets for high availability
- Configured security contexts and best practices
- Created helper templates and configuration management
- Added production and development value files
- Included comprehensive README with installation instructions
This commit is contained in:
d.viti
2025-10-03 01:51:17 +02:00
parent 073d652869
commit ef93f4a35f
19 changed files with 1031 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.web.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "api7ee.fullname" . }}-web)
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.web.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "api7ee.fullname" . }}-web'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "api7ee.fullname" . }}-web --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.web.service.port }}
{{- else if contains "ClusterIP" .Values.web.service.type }}
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward service/{{ include "api7ee.fullname" . }}-web 8080:{{ .Values.web.service.port }}
{{- end }}
2. Check the deployment status:
kubectl get deployments -n {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "api7ee.name" . }},app.kubernetes.io/instance={{ .Release.Name }}"
3. View the pods:
kubectl get pods -n {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "api7ee.name" . }},app.kubernetes.io/instance={{ .Release.Name }}"
4. Check the logs:
# For Web component:
kubectl logs -n {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "api7ee.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=web"
# For API component:
kubectl logs -n {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "api7ee.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=api"
5. Scale the deployments:
# Scale Web component:
kubectl scale deployment {{ include "api7ee.fullname" . }}-web -n {{ .Release.Namespace }} --replicas=3
# Scale API component:
kubectl scale deployment {{ include "api7ee.fullname" . }}-api -n {{ .Release.Namespace }} --replicas=5
{{- if .Values.web.autoscaling.enabled }}
6. Web Horizontal Pod Autoscaler is enabled:
Min replicas: {{ .Values.web.autoscaling.minReplicas }}
Max replicas: {{ .Values.web.autoscaling.maxReplicas }}
Target CPU: {{ .Values.web.autoscaling.targetCPUUtilizationPercentage }}%
Target Memory: {{ .Values.web.autoscaling.targetMemoryUtilizationPercentage }}%
{{- end }}
{{- if .Values.api.autoscaling.enabled }}
7. API Horizontal Pod Autoscaler is enabled:
Min replicas: {{ .Values.api.autoscaling.minReplicas }}
Max replicas: {{ .Values.api.autoscaling.maxReplicas }}
Target CPU: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }}%
Target Memory: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }}%
{{- end }}