【发布时间】:2021-02-26 23:47:16
【问题描述】:
这里是我的命令行:
kubectl apply -f postgres.secret.yaml \
-f postgres.configmap.yaml \
-f postgres.volume.yaml \
-f postgres.deployment.yaml \
-f postgres.service.yaml
这里是我的 yaml 文件部署:
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 0
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
restartPolicy: Always
containers:
- name: postgres
image: postgres:12
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: postgres-secret
- configMapRef:
name: postgres-configmap
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgres-pv
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
我收到一个错误:io.k8s.api.core.v1.EnvFromSource 中的未知字段“名称” 我已经检查了这个错误,每个人都说这是来自 envFrom 的空间,但它与他们提出的解决方案一样缩进。
【问题讨论】:
标签: kubernetes