如标题所示,我想将Postgresql-10升级到Postgresql-11。我正在使用ubuntu-18.04。
我有一个运行应用程序的 kubernetes 集群。集群的一部分是 postgresql pod,当前运行版本 10.4。不幸的是,我发现我需要升级postgresql版本。
postgres yaml 如下:
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:10.4
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: postgres-config
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
Run Code Online (Sandbox Code Playgroud)
postgresql 数据库中已经有一些数据。我需要找到一种在生产过程中升级集群的方法。
如果我只是尝试将映像更改为 12.0 并运行,kubectl apply则会出现错误:
2020-11-15 22:48:08.332 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version …Run Code Online (Sandbox Code Playgroud)