feat(chart): _frontend/_postgres affinity 合并 + audit/shared-infra 注入 + bump 1.2.0
Tasks 10-11: podAffinity+nodeAffinity 合并到同一 affinity 块; audit/shared-infra 走 tier;Chart.yaml 1.1.0→1.2.0。
This commit is contained in:
1 parent
e0d680d67c
commit
132285c253
6 files changed
+33
-9
No files matched your search
+1
-1
@@ -2,5 +2,5 @@ apiVersion: v2
|
||||
name: mixingx
|
||||
description: MixingX 全栈部署 Helm Chart(替代 Aspire publish)
|
||||
type: application
|
||||
version: 1.1.0
|
||||
version: 1.2.0
|
||||
appVersion: "1.0.1"
|
||||
+13
-2
@@ -33,8 +33,10 @@ spec:
|
||||
labels:
|
||||
app.kubernetes.io/component: {{ .name }}
|
||||
spec:
|
||||
{{- if .affinity }}
|
||||
# 四胞胎:前端必须和后端同节点
|
||||
{{- if .nodeName }}
|
||||
nodeName: {{ .nodeName }}
|
||||
{{- else if .affinity }}
|
||||
# 四胞胎:前端必须和后端同节点(podAffinity + 点位/tier nodeAffinity 合并到同一 affinity 块)
|
||||
affinity:
|
||||
podAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
@@ -42,6 +44,15 @@ spec:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: {{ .affinity }}
|
||||
topologyKey: kubernetes.io/hostname
|
||||
{{- if .pointAffinity }}
|
||||
{{ include "mixingx.pointNodeAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
||||
{{ include "mixingx.tierNodeAffinity" (dict "role" .tierRole "root" $root) }}
|
||||
{{- end }}
|
||||
{{- else if .pointAffinity }}
|
||||
{{ include "mixingx.pointAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
||||
{{ include "mixingx.tierAffinity" (dict "role" .tierRole "root" $root) }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .name }}
|
||||
|
||||
+13
-2
@@ -40,8 +40,10 @@ spec:
|
||||
labels:
|
||||
app.kubernetes.io/component: {{ .name }}-postgres
|
||||
spec:
|
||||
{{- if .affinity }}
|
||||
# 四胞胎:postgres 必须和后端 Pod 同节点
|
||||
{{- if .nodeName }}
|
||||
nodeName: {{ .nodeName }}
|
||||
{{- else if .affinity }}
|
||||
# 四胞胎:postgres 必须和后端 Pod 同节点(podAffinity + 点位/tier nodeAffinity 合并到同一 affinity 块)
|
||||
affinity:
|
||||
podAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
@@ -49,6 +51,15 @@ spec:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: {{ .name }}
|
||||
topologyKey: kubernetes.io/hostname
|
||||
{{- if .pointAffinity }}
|
||||
{{ include "mixingx.pointNodeAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
||||
{{ include "mixingx.tierNodeAffinity" (dict "role" .tierRole "root" $root) }}
|
||||
{{- end }}
|
||||
{{- else if .pointAffinity }}
|
||||
{{ include "mixingx.pointAffinity" (dict "affinity" .pointAffinity "root" $root) }}
|
||||
{{- else if and $root.Values.tier $root.Values.tier.enabled }}
|
||||
{{ include "mixingx.tierAffinity" (dict "role" .tierRole "root" $root) }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: postgres
|
||||
|
||||
@@ -18,6 +18,7 @@ spec:
|
||||
labels:
|
||||
app.kubernetes.io/component: audit
|
||||
spec:
|
||||
{{ include "mixingx.tierAffinity" (dict "role" "audit" "root" $) }}
|
||||
containers:
|
||||
- name: audit
|
||||
image: "{{ .Values.registry }}/{{ .Values.audit.image }}:{{ .Values.tag | default "latest" }}"
|
||||
|
||||
@@ -33,6 +33,7 @@ spec:
|
||||
labels:
|
||||
app.kubernetes.io/component: {{ .name }}
|
||||
spec:
|
||||
{{ include "mixingx.tierAffinity" (dict "role" "sharedDatastores" "root" $root) }}
|
||||
containers:
|
||||
- name: {{ .name }}
|
||||
image: {{ .image }}
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
# 1. 后端(多副本)
|
||||
{{ include "mixingx.backend" (dict "name" $inst.name "image" $inst.image "role" $inst.role "replicas" $inst.replicas "serviceId" $inst.serviceId "database" $inst.database "description" $inst.description "root" $root) }}
|
||||
|
||||
# 2. 前端(无亲和)
|
||||
{{ include "mixingx.frontend" (dict "name" $inst.webName "image" $inst.webImage "basePath" $inst.webBasePath "root" $root) }}
|
||||
# 2. 前端(无 podAffinity,走 tier nodeAffinity)
|
||||
{{ include "mixingx.frontend" (dict "name" $inst.webName "image" $inst.webImage "basePath" $inst.webBasePath "tierRole" $inst.role "root" $root) }}
|
||||
|
||||
# 3. 独立 postgres(无亲和)
|
||||
{{ include "mixingx.postgres" (dict "name" $inst.name "database" $inst.database "pgStorage" $inst.pgStorage "affinity" false "root" $root) }}
|
||||
# 3. 独立 postgres(无 podAffinity,走 tier nodeAffinity)
|
||||
{{ include "mixingx.postgres" (dict "name" $inst.name "database" $inst.database "pgStorage" $inst.pgStorage "affinity" false "tierRole" $inst.role "root" $root) }}
|
||||
{{- end }}
|
||||
Reference in new issue
Block a user