This commit is contained in:
Zhenzhong Xu
2024-10-21 10:31:27 +03:00
parent 24166615d7
commit 9ee1a7410b
2 changed files with 23 additions and 23 deletions

View File

@@ -2,38 +2,38 @@
# SPDX-License-Identifier: Apache-2.0
{{- $global := .Values }}
{{- range $deployment := .Values.deployments }}
{{- range $microservice := .Values.microservices }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $deployment.name }}
name: {{ $microservice.name }}
namespace: default
spec:
{{- $replicas := $deployment.replicas }}
{{- $replicas := $microservice.replicas }}
{{- range $podSpec := $global.podSpecs }}
{{- if eq $podSpec.name $deployment.name }}
{{- $replicas = $podSpec.replicas | default $deployment.replicas }}
{{- if eq $podSpec.name $microservice.name }}
{{- $replicas = $podSpec.replicas | default $microservice.replicas }}
{{- end }}
{{- end }}
replicas: {{ $replicas }}
selector:
matchLabels:
app: {{ $deployment.name }}
app: {{ $microservice.name }}
template:
metadata:
annotations:
sidecar.istio.io/rewriteAppHTTPProbers: 'true'
labels:
app: {{ $deployment.name }}
app: {{ $microservice.name }}
spec:
containers:
- envFrom:
- configMapRef:
name: {{ $global.config.CONFIG_MAP_NAME }}
{{- if $deployment.args }}
{{- if $microservice.args }}
args:
{{- range $arg := $deployment.args }}
{{- range $arg := $microservice.args }}
{{- if $arg.name }}
- {{ $arg.name }}
{{- end }}
@@ -43,30 +43,30 @@ spec:
{{- end }}
{{- end }}
{{- if $deployment.env }}
{{- if $microservice.env }}
env:
{{- range $env := $deployment.env }}
{{- range $env := $microservice.env }}
- name: {{ $env.name }}
value: "{{ $env.value }}"
{{- end }}
{{- end }}
image: {{ $deployment.image }}
image: {{ $microservice.image }}
imagePullPolicy: IfNotPresent
name: {{ $deployment.name }}
name: {{ $microservice.name }}
{{- if $deployment.ports }}
{{- if $microservice.ports }}
ports:
{{- range $port := $deployment.ports }}
{{- range $port := $microservice.ports }}
{{- range $port_name, $port_id := $port }}
- {{ $port_name }}: {{ $port_id }}
{{- end }}
{{- end }}
{{- end }}
{{- $resources := $deployment.resources }}
{{- $resources := $microservice.resources }}
{{- range $podSpec := $global.podSpecs }}
{{- if eq $podSpec.name $deployment.name }}
{{- if eq $podSpec.name $microservice.name }}
{{- if $podSpec.resources }}
{{- $resources = $podSpec.resources }}
{{- end }}
@@ -83,9 +83,9 @@ spec:
{{- end }}
{{- end }}
{{- if $deployment.volumeMounts }}
{{- if $microservice.volumeMounts }}
volumeMounts:
{{- range $volumeMount := $deployment.volumeMounts }}
{{- range $volumeMount := $microservice.volumeMounts }}
- mountPath: {{ $volumeMount.mountPath }}
name: {{ $volumeMount.name }}
{{- end }}
@@ -98,15 +98,15 @@ spec:
topologySpreadConstraints:
- labelSelector:
matchLabels:
app: {{ $deployment.name }}
app: {{ $microservice.name }}
maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
{{- if $deployment.volumes }}
{{- if $microservice.volumes }}
volumes:
{{- range $index, $volume := $deployment.volumes }}
{{- range $index, $volume := $microservice.volumes }}
- name: {{ $volume.name }}
{{- if $volume.hostPath }}
hostPath:

View File

@@ -10,7 +10,7 @@ config:
LLM_MODEL_ID: Intel/neural-chat-7b-v3-3
RERANK_MODEL_ID: BAAI/bge-reranker-base
deployments:
microservices:
- name: chatqna-backend-server-deploy
image: opea/chatqna:latest
replicas: 1