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
|
name: mixingx
|
||||||
description: MixingX 全栈部署 Helm Chart(替代 Aspire publish)
|
description: MixingX 全栈部署 Helm Chart(替代 Aspire publish)
|
||||||
type: application
|
type: application
|
||||||
version: 1.1.0
|
version: 1.2.0
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.1"
|
||||||
+13
-2
@@ -33,8 +33,10 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: {{ .name }}
|
app.kubernetes.io/component: {{ .name }}
|
||||||
spec:
|
spec:
|
||||||
{{- if .affinity }}
|
{{- if .nodeName }}
|
||||||
# 四胞胎:前端必须和后端同节点
|
nodeName: {{ .nodeName }}
|
||||||
|
{{- else if .affinity }}
|
||||||
|
# 四胞胎:前端必须和后端同节点(podAffinity + 点位/tier nodeAffinity 合并到同一 affinity 块)
|
||||||
affinity:
|
affinity:
|
||||||
podAffinity:
|
podAffinity:
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
@@ -42,6 +44,15 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/component: {{ .affinity }}
|
app.kubernetes.io/component: {{ .affinity }}
|
||||||
topologyKey: kubernetes.io/hostname
|
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 }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
|
|||||||
+13
-2
@@ -40,8 +40,10 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: {{ .name }}-postgres
|
app.kubernetes.io/component: {{ .name }}-postgres
|
||||||
spec:
|
spec:
|
||||||
{{- if .affinity }}
|
{{- if .nodeName }}
|
||||||
# 四胞胎:postgres 必须和后端 Pod 同节点
|
nodeName: {{ .nodeName }}
|
||||||
|
{{- else if .affinity }}
|
||||||
|
# 四胞胎:postgres 必须和后端 Pod 同节点(podAffinity + 点位/tier nodeAffinity 合并到同一 affinity 块)
|
||||||
affinity:
|
affinity:
|
||||||
podAffinity:
|
podAffinity:
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
@@ -49,6 +51,15 @@ spec:
|
|||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/component: {{ .name }}
|
app.kubernetes.io/component: {{ .name }}
|
||||||
topologyKey: kubernetes.io/hostname
|
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 }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
spec:
|
spec:
|
||||||
|
{{ include "mixingx.tierAffinity" (dict "role" "audit" "root" $) }}
|
||||||
containers:
|
containers:
|
||||||
- name: audit
|
- name: audit
|
||||||
image: "{{ .Values.registry }}/{{ .Values.audit.image }}:{{ .Values.tag | default "latest" }}"
|
image: "{{ .Values.registry }}/{{ .Values.audit.image }}:{{ .Values.tag | default "latest" }}"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: {{ .name }}
|
app.kubernetes.io/component: {{ .name }}
|
||||||
spec:
|
spec:
|
||||||
|
{{ include "mixingx.tierAffinity" (dict "role" "sharedDatastores" "root" $root) }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
image: {{ .image }}
|
image: {{ .image }}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
# 1. 后端(多副本)
|
# 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) }}
|
{{ 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. 前端(无亲和)
|
# 2. 前端(无 podAffinity,走 tier nodeAffinity)
|
||||||
{{ include "mixingx.frontend" (dict "name" $inst.webName "image" $inst.webImage "basePath" $inst.webBasePath "root" $root) }}
|
{{ include "mixingx.frontend" (dict "name" $inst.webName "image" $inst.webImage "basePath" $inst.webBasePath "tierRole" $inst.role "root" $root) }}
|
||||||
|
|
||||||
# 3. 独立 postgres(无亲和)
|
# 3. 独立 postgres(无 podAffinity,走 tier nodeAffinity)
|
||||||
{{ include "mixingx.postgres" (dict "name" $inst.name "database" $inst.database "pgStorage" $inst.pgStorage "affinity" false "root" $root) }}
|
{{ include "mixingx.postgres" (dict "name" $inst.name "database" $inst.database "pgStorage" $inst.pgStorage "affinity" false "tierRole" $inst.role "root" $root) }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
Reference in new issue
Block a user