Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PersistentVolumeClaim retention is feature-gated and should be handled conditionally #2599

Open
bo0ts opened this issue Apr 4, 2024 · 4 comments · May be fixed by #2611
Open

PersistentVolumeClaim retention is feature-gated and should be handled conditionally #2599

bo0ts opened this issue Apr 4, 2024 · 4 comments · May be fixed by #2611

Comments

@bo0ts
Copy link

bo0ts commented Apr 4, 2024

After upgrading to v1.11.0 I noticed the following messages for every postgres cluster on every start up of the operator:

time="2024-04-04T16:56:37Z" level=info msg="statefulset myapp/myapp-postgres is not in the desired state and needs to be updated" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-          terminationMessagePath: /dev/termination-log," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-          terminationMessagePolicy: File," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      restartPolicy: Always," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      dnsPolicy: ClusterFirst," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      serviceAccount: postgres-pod," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      securityContext: {}," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      schedulerName: default-scheduler" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="+      securityContext: {}" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      kind: PersistentVolumeClaim," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      apiVersion: v1," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      status: {" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-        phase: Pending" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-      }" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="+      status: {}" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="-  revisionHistoryLimit: 10" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="+  persistentVolumeClaimRetentionPolicy: {" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="+    whenDeleted: Retain," cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="+    whenScaled: Retain" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="+  }" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=info msg="reason: new statefulset's persistent volume claim retention policy do not match" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="replacing statefulset" cluster-name=myapp/myapp-postgres pkg=cluster
time="2024-04-04T16:56:37Z" level=debug msg="waiting for the statefulset to be deleted" cluster-name=myapp/myapp-postgres pkg=cluster

After that nothing happens. The sts is neither deleted nor fixed and the messages show up on every start of the operator.

The cluster is running version k8s 1.25. It is my understanding that PersistentVolumeClaims are behind a feature-gate even in version 1.27 and that those parts of the sts spec can never be set. Indeed, trying to set them manually fails. See: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention

The operator should not attempt to set those values if the feature is not available.

@haeuserm
Copy link

haeuserm commented Apr 5, 2024

Observing the same. We are on GKE 1.26 .

@hau21um
Copy link

hau21um commented Apr 8, 2024

Setting configuration to
persistent_volume_claim_retention_policy: {}
or even completely removing it has no effect and behaves same way as described in this issue.

bo0ts added a commit to bo0ts/postgres-operator that referenced this issue Apr 16, 2024
@bo0ts bo0ts linked a pull request Apr 16, 2024 that will close this issue
@angelsantillana94
Copy link

I have the same problem.

@aldelsa
Copy link

aldelsa commented May 27, 2024

Hi, same issue here :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants