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

@@ -1,4 +1,4 @@
{{- if index .Values.ocAuth.enabled }}
{{- if .Values.ocAuth.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -6,7 +6,7 @@ metadata:
app: oc-auth
name: {{ .Release.Name }}-oc-auth
spec:
replicas: 1
replicas: {{ .Values.ocAuth.replicas }}
selector:
matchLabels:
app: oc-auth
@@ -50,5 +50,11 @@ spec:
memory: "{{ .Values.ocAuth.resources.limits.memory }}"
requests:
cpu: "{{ .Values.ocAuth.resources.requests.cpu }}"
memory: "{{ .Values.ocAuth.resources.requests.memory }}"
memory: "{{ .Values.ocAuth.resources.requests.memory }}"
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
{{- end }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocAuth.enabled }}
{{- if .Values.ocAuth.enabled }}
apiVersion: v1
kind: Service
metadata:
@@ -14,4 +14,27 @@ spec:
selector:
app: oc-auth
type: ClusterIP
{{- end }}
{{- 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 }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocCatalog.enabled }}
{{- if .Values.ocCatalog.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -6,7 +6,7 @@ metadata:
app: oc-catalog
name: {{ .Release.Name }}-oc-catalog
spec:
replicas: 1
replicas: {{ .Values.ocCatalog.replicas }}
selector:
matchLabels:
app: oc-catalog
@@ -36,4 +36,4 @@ spec:
requests:
cpu: "{{ .Values.ocCatalog.resources.requests.cpu }}"
memory: "{{ .Values.ocCatalog.resources.requests.memory }}"
{{- end }}
{{- end }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocCatalog.enabled }}
{{- if .Values.ocCatalog.enabled }}
apiVersion: v1
kind: Service
metadata:
@@ -14,4 +14,27 @@ spec:
selector:
app: oc-catalog
type: ClusterIP
{{- end }}
{{- end }}
{{- if and .Values.ocCatalog.enabled .Values.ocCatalog.hpa.enabled }}
---
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-oc-catalog
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-oc-catalog
minReplicas: {{ .Values.ocCatalog.hpa.minReplicas }}
maxReplicas: {{ .Values.ocCatalog.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.ocCatalog.hpa.targetCPUUtilizationPercentage }}
{{- end }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocDatacenter.enabled }}
{{- if .Values.ocDatacenter.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -6,7 +6,7 @@ metadata:
app: oc-datacenter
name: {{ .Release.Name }}-oc-datacenter
spec:
replicas: 1
replicas: {{ .Values.ocDatacenter.replicas }}
selector:
matchLabels:
app: oc-datacenter
@@ -29,6 +29,12 @@ spec:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
resources:
limits:
cpu: "{{ .Values.ocDatacenter.resources.limits.cpu }}"

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocDatacenter.enabled }}
{{- if .Values.ocDatacenter.enabled }}
apiVersion: v1
kind: Service
metadata:
@@ -14,4 +14,28 @@ spec:
selector:
app: oc-datacenter
type: ClusterIP
{{- end }}
{{- end }}
{{- if and .Values.ocDatacenter.enabled .Values.ocDatacenter.hpa.enabled }}
---
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-oc-datacenter
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-oc-datacenter
minReplicas: {{ .Values.ocDatacenter.hpa.minReplicas }}
maxReplicas: {{ .Values.ocDatacenter.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.ocDatacenter.hpa.targetCPUUtilizationPercentage }}
{{- end }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocFront.enabled }}
{{- if .Values.ocFront.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -6,7 +6,7 @@ metadata:
app: oc-front
name: {{ .Release.Name }}-oc-front
spec:
replicas: 1
replicas: {{ .Values.ocFront.replicas }}
selector:
matchLabels:
app: oc-front
@@ -30,6 +30,12 @@ spec:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
resources:
limits:
cpu: "{{ .Values.ocFront.resources.limits.cpu }}"

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocFront.enabled }}
{{- if .Values.ocFront.enabled }}
apiVersion: v1
kind: Service
metadata:
@@ -14,4 +14,27 @@ spec:
selector:
app: oc-front
type: ClusterIP
{{- end }}
{{- 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 }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocPeer.enabled }}
{{- if .Values.ocPeer.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -6,7 +6,7 @@ metadata:
app: oc-peer
name: {{ .Release.Name }}-oc-peer
spec:
replicas: 1
replicas: {{ .Values.ocPeer.replicas }}
selector:
matchLabels:
app: oc-peer
@@ -25,6 +25,12 @@ spec:
envFrom:
- configMapRef:
name: opencloud-config
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
ports:
- name: http
containerPort: 8080

View File

@@ -14,4 +14,27 @@ spec:
selector:
app: oc-peer
type: ClusterIP
{{- end }}
{{- if and .Values.ocPeer.enabled .Values.ocPeer.hpa.enabled }}
---
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-oc-peer
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-oc-peer
minReplicas: {{ .Values.ocPeer.hpa.minReplicas }}
maxReplicas: {{ .Values.ocPeer.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.ocPeer.hpa.targetCPUUtilizationPercentage }}
{{- end }}

View File

@@ -6,7 +6,7 @@ metadata:
app: oc-scheduler
name: {{ .Release.Name }}-oc-scheduler
spec:
replicas: 1
replicas: {{ .Values.ocScheduler.replicas }}
selector:
matchLabels:
app: oc-scheduler
@@ -26,6 +26,12 @@ spec:
envFrom:
- configMapRef:
name: opencloud-config
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
ports:
- name: http
containerPort: 8080

View File

@@ -14,4 +14,27 @@ spec:
selector:
app: oc-scheduler
type: ClusterIP
{{- end }}
{{- if and .Values.ocScheduler.enabled .Values.ocScheduler.hpa.enabled }}
---
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-oc-scheduler
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-oc-scheduler
minReplicas: {{ .Values.ocScheduler.hpa.minReplicas }}
maxReplicas: {{ .Values.ocScheduler.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.ocScheduler.hpa.targetCPUUtilizationPercentage }}
{{- end }}

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 }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocShared.enabled }}
{{- if .Values.ocShared.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -6,7 +6,7 @@ metadata:
app: oc-shared
name: {{ .Release.Name }}-oc-shared
spec:
replicas: 1
replicas: {{ .Values.ocShared.replicas }}
selector:
matchLabels:
app: oc-shared
@@ -25,6 +25,12 @@ spec:
envFrom:
- configMapRef:
name: opencloud-config
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
ports:
- name: http
containerPort: 8080

View File

@@ -14,4 +14,27 @@ spec:
selector:
app: oc-shared
type: ClusterIP
{{- end }}
{{- if and .Values.ocShared.enabled .Values.ocShared.hpa.enabled }}
---
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-oc-shared
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-oc-shared
minReplicas: {{ .Values.ocShared.hpa.minReplicas }}
maxReplicas: {{ .Values.ocShared.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.ocShared.hpa.targetCPUUtilizationPercentage }}
{{- end }}

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocWorkflow.enabled }}
{{- if .Values.ocWorkflow.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -6,7 +6,7 @@ metadata:
app: oc-workflow
name: {{ .Release.Name }}-oc-workflow
spec:
replicas: 1
replicas: {{ .Values.ocWorkflow.replicas }}
selector:
matchLabels:
app: oc-workflow
@@ -29,6 +29,12 @@ spec:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /metrics
port: http
initialDelaySeconds: 10
periodSeconds: 30
resources:
limits:
cpu: "{{ .Values.ocWorkflow.resources.limits.cpu }}"

View File

@@ -1,4 +1,4 @@
{{- if index .Values.ocWorkflow.enabled }}
{{- if .Values.ocWorkflow.enabled }}
apiVersion: v1
kind: Service
metadata:
@@ -14,4 +14,27 @@ spec:
selector:
app: oc-workflow
type: ClusterIP
{{- end }}
{{- if and .Values.ocWorkflow.enabled .Values.ocWorkflow.hpa.enabled }}
---
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}-oc-workflow
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}-oc-workflow
minReplicas: {{ .Values.ocWorkflow.hpa.minReplicas }}
maxReplicas: {{ .Values.ocWorkflow.hpa.maxReplicas }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.ocWorkflow.hpa.targetCPUUtilizationPercentage }}
{{- end }}

View File

@@ -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 }}"

View File

@@ -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 }}

View File

@@ -22,7 +22,9 @@ data:
OC_LDAP_BINDPW: "{{ index .Values.ocAuth.ldap.binPwd }}"
OC_LDAP_BASEDN: "{{ index .Values.ocAuth.ldap.baseDn }}"
OC_LDAP_ROLE_BASEDN: "{{ index .Values.ocAuth.ldap.roleBaseDn }}"
OC_MONGO_URL: "mongodb://{{ index .Values.mongodb.auth.usernames 0 }}:{{ index .Values.mongodb.auth.passwords 0 }}@{{ .Release.Name }}-mongodb.{{ .Release.Namespace }}:27017/{{ index .Values.mongodb.auth.databases 0 }}"
OC_MONGO_URL: "mongodb://{{ index .Values.mongodb.auth.rootUser }}:{{ index .Values.mongodb.auth.rootPassword }}@{{ .Release.Name }}-mongodb.{{ .Release.Namespace }}:27017/{{ index .Values.mongodb.auth.databases 0 }}"
OC_MONGO_DATABASE: "{{ index .Values.mongodb.auth.databases 0 }}"
OC_NATS_URL: "nats://{{ .Release.Name }}-nats.{{ .Release.Namespace }}:4222"
OC_LOKI_URL: "http://{{ .Release.Name }}-loki.{{ .Release.Namespace }}:3100"
OC_LOKI_URL: "http://{{ .Release.Name }}-loki.{{ .Release.Namespace }}:3100"
OC_PROMETHEUS_URL: "http://{{ .Release.Name }}-monitor.{{ .Release.Namespace }}:9090"

View File

@@ -0,0 +1,27 @@
{{- if .Values.externalLDAP.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: oc-openldap
name: {{ .Release.Name }}-oc-openldap
spec:
replicas: 1
template:
spec:
containers:
- name: oc-openldap
image: {{ .Values.openldap.image.repository }}
env:
- name: LDAP_ORGANISATION
value: {{ .Values.openldap.env.LDAP_ORGANISATION }}
- name: LDAP_DOMAIN
value: {{ .Values.openldap.env.LDAP_DOMAIN }}
volumeMounts:
- name: ldif
mountPath: /container/service/slapd/assets/config/bootstrap/ldif/external
volumes:
- name: ldif
configMap:
name: openldap-ldif
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- if .Values.prometheus.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Release.Name }}-monitor.{{ .Release.Namespace }}
labels:
release: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: monitor
endpoints:
- port: http
interval: 30s
{{- end }}

View File

@@ -1,22 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "my-prometheus.fullname" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "my-prometheus.name" . }}
template:
metadata:
labels:
app: {{ include "my-prometheus.name" . }}
spec:
containers:
- name: prometheus
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 9090
resources:
{{- toYaml .Values.resources | nindent 12 }}

View File

@@ -1,11 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "my-prometheus.fullname" . }}
spec:
type: {{ .Values.service.type }}
selector:
app: {{ include "my-prometheus.name" . }}
ports:
- port: {{ .Values.service.port }}
targetPort: 9090