【发布时间】:2021-04-05 03:00:05
【问题描述】:
我正在尝试将 [CouchDB](https://couchdb.apache.org] 部署到 Kubernetes 集群中的正确步骤。
我所做的是:
kubectl create secret --namespace mynamespace generic couch-test-couchdb \
--from-literal=adminUsername=admin
--from-literal=adminPassword=password
--from-literal=cookieAuthSecret=supersecret
helm install --namespace mynamespace couch-test \
--set couchdbConfig.couchdb.uuid=$(uuid | tr -d -) \
-f couch-test.yml \
couchdb/couchdb
couch-test.yml:
createAdminSecret : false
persistentVolume.enabled : true
persistentVolume.size: 10Gi
该命令运行时没有错误消息,但不会发生持久存储分配。当我输入 kubectl describe pod couch-test-couchdb-0 时,我进入 Volumes for config-storage,database-storage EmptyDir
我错过了什么?
我怀疑我需要先创建一个PV,但不清楚如何将其链接到安装。是 storageClass 还是名称或其他?
** 更新**
我重新开始,删除设置并使用k apply --namespace mynamespace -f couch-storage.yml添加存储类定义
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: couch-storage
provisioner: kubernetes.io/no-provisioner
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
所以couch-farm.yml 现在看起来像这样:
createAdminSecret : false
persistentVolume.enabled : true
persistentVolume.size: 10Gi
persistentVolume.storageClass : couch-storage
没有区别,k describe pod... 中的存储仍然指向 EmptyDir
【问题讨论】:
标签: yaml couchdb kubernetes-helm