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

40 lines
943 B
YAML
Raw Normal View History

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