Update K8S to include an auto generator of values template

This commit is contained in:
mr
2025-11-12 13:13:43 +01:00
parent 7ad4bf0b5d
commit 9f9b1849eb
141 changed files with 13168 additions and 211 deletions

View File

@@ -6,7 +6,7 @@ metadata:
app: oc-schedulerd
name: {{ .Release.Name }}-oc-schedulerd
spec:
replicas: 1
replicas: {{ .Values.ocSchedulerd.replicas }}
selector:
matchLabels:
app: oc-schedulerd
@@ -25,6 +25,12 @@ spec:
envFrom:
- configMapRef:
name: opencloud-config
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
resources:
limits:
cpu: "{{ .Values.ocSchedulerd.resources.limits.cpu }}"

View File

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