【发布时间】:2020-11-21 10:35:25
【问题描述】:
我有一个 deployment.yaml,它像这样使用 persistentvolumeclaim
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mautic-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: standard
我正在尝试使用 (Horizontal Pod Scheduler) 水平扩展我的部署,但是当我扩展我的部署时,其余的 pod 都在 ContainerCreating 进程中,这是我在 describe the pod 时遇到的错误
Unable to attach or mount volumes: unmounted volume
我在这里做错了什么?
【问题讨论】:
-
尝试使用 VolumeClaimTemplate
-
哦,我认为 volumeclaimtemplates 只适用于 statefulsets..
-
对不起,我的时间不多了。我要试试这个快
-
你好。又读了一些书。我不知道这是可能的。要横向扩展卷,您可能需要使用 StatefulSets。还让我们澄清一些事情。您有一个 HPA 横向扩展副本。创建新副本时,您希望它获得自己的 persistentVolume 声明,但您知道当 HPA 缩小它时,它会丢失卷,对吗?
-
StatefulSets 代表一组具有唯一、持久身份和稳定主机名的 Pod,它们适用于部署 Kafka、MySQL、Redis、ZooKeeper 和其他需要唯一、持久身份和稳定主机名的应用程序。跨度>
标签: kubernetes google-kubernetes-engine kubernetes-pod horizontal-pod-autoscaling horizontalpodautoscaler