diff --git a/helm-chart/templates/adapter-statefulset.yaml b/helm-chart/templates/adapter-statefulset.yaml index 998819ae..19c7bdac 100644 --- a/helm-chart/templates/adapter-statefulset.yaml +++ b/helm-chart/templates/adapter-statefulset.yaml @@ -27,7 +27,10 @@ spec: - containerPort: 8095 name: napcat-ws protocol: TCP - resources: {{ .Values.adapter.resources | default nil }} + {{- if .Values.adapter.resources }} + resources: + {{ toYaml .Values.adapter.resources | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /adapters/data name: data @@ -35,9 +38,18 @@ spec: name: config readOnly: true subPath: config.toml - imagePullSecrets: {{ .Values.adapter.image.pullSecrets | default nil }} - nodeSelector: {{ .Values.adapter.nodeSelector | default nil }} - tolerations: {{ .Values.adapter.tolerations | default nil }} + {{- if .Values.adapter.image.pullSecrets }} + imagePullSecrets: + {{ toYaml .Values.adapter.image.pullSecrets | nindent 8 }} + {{- end }} + {{- if .Values.adapter.nodeSelector }} + nodeSelector: + {{ toYaml .Values.adapter.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.adapter.tolerations }} + tolerations: + {{ toYaml .Values.adapter.tolerations | nindent 8 }} + {{- end }} volumes: - name: data persistentVolumeClaim: diff --git a/helm-chart/templates/core-statefulset.yaml b/helm-chart/templates/core-statefulset.yaml index 29016726..9b360c68 100644 --- a/helm-chart/templates/core-statefulset.yaml +++ b/helm-chart/templates/core-statefulset.yaml @@ -35,7 +35,10 @@ spec: - containerPort: 8000 name: adapter-ws protocol: TCP - resources: {{ .Values.core.resources | default nil }} + {{- if .Values.core.resources }} + resources: + {{ toYaml .Values.core.resources | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /MaiMBot/data name: data @@ -59,9 +62,18 @@ spec: - mountPath: /MaiMBot/statistics name: statistics {{- end }} - imagePullSecrets: {{ .Values.core.image.pullSecrets | default nil }} - nodeSelector: {{ .Values.core.nodeSelector | default nil }} - tolerations: {{ .Values.core.tolerations | default nil }} + {{- if .Values.core.image.pullSecrets }} + imagePullSecrets: + {{ toYaml .Values.core.image.pullSecrets | nindent 8 }} + {{- end }} + {{- if .Values.core.nodeSelector }} + nodeSelector: + {{ toYaml .Values.core.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.core.tolerations }} + tolerations: + {{ toYaml .Values.core.tolerations | nindent 8 }} + {{- end }} volumes: - name: data persistentVolumeClaim: diff --git a/helm-chart/templates/napcat-ingress.yaml b/helm-chart/templates/napcat-ingress.yaml index 2343ca9c..e46243a2 100644 --- a/helm-chart/templates/napcat-ingress.yaml +++ b/helm-chart/templates/napcat-ingress.yaml @@ -4,7 +4,10 @@ kind: Ingress metadata: name: {{ .Release.Name }}-maibot-napcat namespace: {{ .Release.Namespace }} - annotations: {{ .Values.napcat.ingress.annotations | default nil }} + {{- if .Values.napcat.ingress.annotations }} + annotations: + {{ toYaml .Values.napcat.ingress.annotations | nindent 4 }} + {{- end }} labels: app: {{ .Release.Name }}-maibot-napcat spec: diff --git a/helm-chart/templates/napcat-statefulset.yaml b/helm-chart/templates/napcat-statefulset.yaml index 7969d388..138845f5 100644 --- a/helm-chart/templates/napcat-statefulset.yaml +++ b/helm-chart/templates/napcat-statefulset.yaml @@ -42,7 +42,10 @@ spec: - containerPort: 6099 name: webui protocol: TCP - resources: {{ .Values.napcat.resources | default nil }} + {{- if .Values.napcat.resources }} + resources: + {{ toYaml .Values.napcat.resources | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /app/napcat/config name: napcat @@ -50,9 +53,18 @@ spec: - mountPath: /app/.config/QQ name: napcat subPath: data - imagePullSecrets: {{ .Values.napcat.image.pullSecrets | default nil }} - nodeSelector: {{ .Values.napcat.nodeSelector | default nil }} - tolerations: {{ .Values.napcat.tolerations | default nil }} + {{- if .Values.napcat.image.pullSecrets }} + imagePullSecrets: + {{ toYaml .Values.napcat.image.pullSecrets | nindent 8 }} + {{- end }} + {{- if .Values.napcat.nodeSelector }} + nodeSelector: + {{ toYaml .Values.napcat.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.napcat.tolerations }} + tolerations: + {{ toYaml .Values.napcat.tolerations | nindent 8 }} + {{- end }} volumes: - name: napcat persistentVolumeClaim: diff --git a/helm-chart/templates/sqlite-web-ingress.yaml b/helm-chart/templates/sqlite-web-ingress.yaml index 0bd6a3c4..fe14e744 100644 --- a/helm-chart/templates/sqlite-web-ingress.yaml +++ b/helm-chart/templates/sqlite-web-ingress.yaml @@ -4,7 +4,10 @@ kind: Ingress metadata: name: {{ .Release.Name }}-maibot-sqlite-web namespace: {{ .Release.Namespace }} - annotations: {{ .Values.sqlite_web.ingress.annotations | default nil }} + {{- if .Values.sqlite_web.ingress.annotations }} + annotations: + {{ toYaml .Values.sqlite_web.ingress.annotations | nindent 4 }} + {{- end }} labels: app: {{ .Release.Name }}-maibot-sqlite-web spec: diff --git a/helm-chart/templates/sqlite-web-statefulset.yaml b/helm-chart/templates/sqlite-web-statefulset.yaml index 80ef7c53..b2c9cc47 100644 --- a/helm-chart/templates/sqlite-web-statefulset.yaml +++ b/helm-chart/templates/sqlite-web-statefulset.yaml @@ -38,13 +38,25 @@ spec: - containerPort: 8080 name: webui protocol: TCP - resources: {{ .Values.sqlite_web.resources | default nil }} + {{- if .Values.sqlite_web.resources }} + resources: + {{ toYaml .Values.sqlite_web.resources | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /data/MaiMBot name: data - imagePullSecrets: {{ .Values.sqlite_web.image.pullSecrets | default nil }} - nodeSelector: {{ .Values.sqlite_web.nodeSelector | default nil }} - tolerations: {{ .Values.sqlite_web.tolerations | default nil }} + {{- if .Values.sqlite_web.image.pullSecrets }} + imagePullSecrets: + {{ toYaml .Values.sqlite_web.image.pullSecrets | nindent 8 }} + {{- end }} + {{- if .Values.sqlite_web.nodeSelector }} + nodeSelector: + {{ toYaml .Values.sqlite_web.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.sqlite_web.tolerations }} + tolerations: + {{ toYaml .Values.sqlite_web.tolerations | nindent 8 }} + {{- end }} volumes: - name: data persistentVolumeClaim: diff --git a/helm-chart/templates/statistics-deployment.yaml b/helm-chart/templates/statistics-deployment.yaml index 95a3f4e5..94e7e2c7 100644 --- a/helm-chart/templates/statistics-deployment.yaml +++ b/helm-chart/templates/statistics-deployment.yaml @@ -34,14 +34,26 @@ spec: - containerPort: 80 name: dashboard protocol: TCP - resources: {{ .Values.statistics_dashboard.resources | default nil }} + {{- if .Values.statistics_dashboard.resources }} + resources: + {{ toYaml .Values.statistics_dashboard.resources | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /usr/share/nginx/html name: statistics readOnly: true - imagePullSecrets: {{ .Values.statistics_dashboard.image.pullSecrets | default nil }} - nodeSelector: {{ .Values.statistics_dashboard.nodeSelector | default nil }} - tolerations: {{ .Values.core.tolerations | default nil }} + {{- if .Values.statistics_dashboard.image.pullSecrets }} + imagePullSecrets: + {{ toYaml .Values.statistics_dashboard.image.pullSecrets | nindent 8 }} + {{- end }} + {{- if .Values.statistics_dashboard.nodeSelector }} + nodeSelector: + {{ toYaml .Values.statistics_dashboard.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.statistics_dashboard.tolerations }} + tolerations: + {{ toYaml .Values.statistics_dashboard.tolerations | nindent 8 }} + {{- end }} volumes: - name: statistics persistentVolumeClaim: diff --git a/helm-chart/templates/statistics-ingress.yaml b/helm-chart/templates/statistics-ingress.yaml index 67c8e037..70c18353 100644 --- a/helm-chart/templates/statistics-ingress.yaml +++ b/helm-chart/templates/statistics-ingress.yaml @@ -4,7 +4,10 @@ kind: Ingress metadata: name: {{ .Release.Name }}-maibot-statistics-dashboard namespace: {{ .Release.Namespace }} - annotations: {{ .Values.statistics_dashboard.ingress.annotations | default nil }} + {{- if .Values.statistics_dashboard.ingress.annotations }} + annotations: + {{ toYaml .Values.statistics_dashboard.ingress.annotations | nindent 4 }} + {{- end }} labels: app: {{ .Release.Name }}-maibot-statistics-dashboard spec: