当我安装我创建的舵图时,我会得到一个错误。
头盔安装-f values.yaml
我改变了缩进,让它像山雀一样。我多次使用"kubectl -o yaml“,但它不起作用。
yaml文件中的第50行包含卷名称:前端-http
有人知道怎么解决这个问题吗?下面是整个yaml模板文件:
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "frontend-nginx.fullname" . }}
labels:
{{- include "frontend-nginx.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "frontend-nginx.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "frontend-nginx.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "frontend-nginx.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
volumeMounts:
- mountPath: /usr/local/nginx/conf/nginx.conf
name: {{ .Values.nginxconfig.nginxcm }}-volume
subPath: nginx.conf
- mountPath: /usr/local/nginx/html/app
name: data-storage
volumes:
- configMap:
defaultMode: 420
name: frontend-http
name: frontend-http-volume
{{- if .Values.persistentVolume.enabled }}
- name: data-storage
persistentVolumeClaim:
claimName: {{ .Values.persistentVolume.existingClaim | default (include "frontend-nginx.fullname" .) }}
{{- else }}
- name: data-storage
emptyDir: {}
{{- end }}
{{- if .Values.persistentVolume.mountPaths }}
{{ toYaml .Values.persistentVolume.mountPaths | indent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}发布于 2022-01-19 08:16:46
尝试交换"configMap“和”名称“:
volumes:
- name: frontend-http-volume
configMap:
defaultMode: 420
name: frontend-http
{{- if .Values.persistentVolume.enabled }}
- name: data-storage
persistentVolumeClaim:
claimName: {{ .Values.persistentVolume.existingClaim | default (include "frontend-nginx.fullname" .) }}
{{- else }}
- name: data-storage
emptyDir: {}
{{- end }} https://stackoverflow.com/questions/70766965
复制相似问题