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