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

41 lines
916 B
YAML
Raw Normal View History

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