Update K8S to include an auto generator of values template
This commit is contained in:
@@ -6,7 +6,7 @@ metadata:
|
||||
app: oc-workspace
|
||||
name: {{ .Release.Name }}-oc-workspace
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: {{ .Values.ocWorkspace.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: oc-workspace
|
||||
@@ -25,6 +25,12 @@ spec:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 30
|
||||
resources:
|
||||
limits:
|
||||
cpu: "{{ .Values.ocWorkspace.resources.limits.cpu }}"
|
||||
|
||||
@@ -14,4 +14,27 @@ spec:
|
||||
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 }}
|
||||
Reference in New Issue
Block a user