Files
oc-k8s/opencloud/templates/oc-shared/service.yaml

40 lines
910 B
YAML
Raw Normal View History

2025-01-09 16:24:43 +01:00
{{- if index .Values.ocShared.enabled }}
apiVersion: v1
kind: Service
metadata:
name: oc-shared-svc
labels:
app: oc-shared-svc
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: oc-shared
type: ClusterIP
{{- end }}
{{- if and .Values.ocShared.enabled .Values.ocShared.hpa.enabled }}
---
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-oc-shared
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-oc-shared
minReplicas: {{ .Values.ocShared.hpa.minReplicas }}
maxReplicas: {{ .Values.ocShared.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.ocShared.hpa.targetCPUUtilizationPercentage }}
2025-01-09 16:24:43 +01:00
{{- end }}