我有一个部署,其中包括一个 configMap、persistentVolumeClaim 和一个服务。我更改了 configMap 并将部署重新应用于我的集群。我了解此更改不会自动重新启动部署中的 pod:
更新了 configMap.yaml 但它没有被应用到 Kubernetes pods
我知道我可以kubectl delete -f wiki.yaml && kubectl apply -f wiki.yaml。但这会破坏持久卷,其中包含我希望在重启后继续存在的数据。如何以保留现有卷的方式重新启动 pod?
这是 wiki.yaml 的样子:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dot-wiki
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 4Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: wiki-config
data:
config.json: |
{
"farm": true,
"security_type": "friends",
"secure_cookie": false,
"allowed": "*"
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wiki-deployment
spec:
replicas: 1
selector: …Run Code Online (Sandbox Code Playgroud)