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

41 lines
892 B
YAML

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