嗨,我得到了一个YAML,它对我来说似乎是有效的,但它在应用它时不起作用,我不知道它有什么问题
错误类型:
unknown field "spec.template.spec.volumes[0].PersistentVolumeClaim"
kubeval deployment.yaml通过,没有错误
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-service
namespace: app-1-0
labels:
app: app-service
spec:
replicas: 1
selector:
matchLabels:
app: my-service
template:
metadata:
labels:
app: my-service
spec:
containers:
- name: my-service
image: registry.azurecr.io/app/app-service:1.0
env:
- name: AzureAd__Instance
value: ...
- name: AzureAd__ClientId
value: ...
- name: AzureAd__TenantId
value: ...
imagePullPolicy: Always
ports:
- containerPort: 8080
name: http
volumeMounts:
- mountPath: "/mnt/data"
name: cache
dnsPolicy: ClusterFirst
volumes:
- name: cache
PersistentVolumeClaim:
claimName: app-pvc
1条答案
按热度按时间8ehkhllq1#
注意
persistentVolumeClaim
应该小写,并指定为卷下的嵌套对象。