postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

pgo is not compatible with k8s v1.25

Open youvegotmoxie opened this issue 2 years ago • 4 comments

Overview

After upgrading to Kubernetes v1.25.0 the pgo pod is crashing because the CronJob batch/v1beta1 API is no longer served. The code for the operator needs to be updated to (also) look for the batch/v1 apiVersion which has been GA since k8s v1.21

$ k get pod -n postgres-operator
NAME                           READY   STATUS             RESTARTS      AGE
pgo-6d89f7c7cb-4dhkf           0/1     CrashLoopBackOff   7 (68s ago)   12m
pgo-upgrade-6f956b867c-4tzts   1/1     Running            0             12m

I am using the latest version of the postgres-operator Helm chart from here

Environment

Please provide the following details:

  • Platform: Kubernetes
  • Platform Version: v1.25.0

Steps to Reproduce

  1. Install the latest version of the PGO
  2. Upgrade Kubernetes to v1.25.0
  3. Observe that the pgo pod is now crash looping

EXPECTED

  1. To not crash after the k8s upgrade

ACTUAL

  1. pgo pod goes into CrashLoopBackoff due to the beta CronJob API not being served

Logs

time="2022-08-29T15:33:28Z" level=error msg="if kind is a CRD, it should be installed before calling Start" error="no matches for kind \"CronJob\" in version \"batch/v1beta1\"" file="sigs.k8s.io/[email protected]/pkg/log/deleg.go:144" func="log.(*DelegatingLogger).Error" kind=CronJob.batch version=5.1.3-0
panic: no matches for kind "CronJob" in version "batch/v1beta1"

goroutine 1 [running]:
main.assertNoError(...)
        github.com/crunchydata/postgres-operator/cmd/postgres-operator/main.go:40
main.main()
        github.com/crunchydata/postgres-operator/cmd/postgres-operator/main.go:100 +0x550

Furthermore, while CronJobs are required for backups, they aren't critical for managing the lifecycle of the database cluster from what I can tell. It may be better to emit a warning and skip trying to reconcile the CronJob(s) objects instead of crashing the application.

youvegotmoxie avatar Aug 29 '22 15:08 youvegotmoxie

I have the same issue , also when installing fresh installtion on kubernetes 1.25 it fails to create CDR , it says :

The CustomResourceDefinition "postgresclusters.postgres-operator.crunchydata.com" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

ButeForce avatar Sep 03 '22 19:09 ButeForce

I have the same issue , also when installing fresh installtion on kubernetes 1.25 it fails to create CDR , it says :

The CustomResourceDefinition "postgresclusters.postgres-operator.crunchydata.com" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

Try passing --server-side to kubectl; that should address it.

jelmer avatar Sep 03 '22 19:09 jelmer

I've added support for Kubernetes 1.25 in #3370; experimental container build from those changes available at ghcr.io/jelmer/postgres-operator:rocky9-v4.5.0-855-g1b8413409

jelmer avatar Sep 04 '22 15:09 jelmer

I just wanted to note on this thread that we are actively working on 1.25 compatibility/support, which will be included the next release of PGO.

andrewlecuyer avatar Sep 16 '22 15:09 andrewlecuyer

@youvegotmoxie as mentioned above, PR https://github.com/CrunchyData/postgres-operator/pull/3370 should resolve these issues and is planned to be available in the next release.

tjmoore4 avatar Oct 03 '22 17:10 tjmoore4

When is the next release, approximately?

loxy avatar Oct 31 '22 19:10 loxy

When is the next release scheduled?

MrFox131 avatar Nov 01 '22 02:11 MrFox131

Wait for the next release.

yanmxa avatar Nov 15 '22 10:11 yanmxa

any updates for the release of this fix ? @jelmer published a nice fix few month ago, but this repo is yet to focus on older version of kubernetes. this is slowly becoming unusable.

sorinpepelea avatar Nov 27 '22 17:11 sorinpepelea

dead in the water ... have been waiting almost 3 months now for a new release.

jansmets avatar Dec 01 '22 12:12 jansmets

Hey PGO team (@tjmoore4, @andrewlecuyer, @cbandy, @benjaminjb, I think that's some of you), people are obviously getting frustrated here, so is there anything the community can do to help move a release with #3370 forward?

If there's other issues that you need to solve before a release is possible, please let us know! I'm sure some of us would be willing to help out!

zevisert avatar Dec 02 '22 20:12 zevisert

We are currently planning a mid-December release for PGO v5.3.0, which will include the changes required for Kubernetes v1.25 compatibility.

I also wanted to point out the Crunchy Postgres for Kubernetes release policy, which specifically highlights our standard release cadence across each quarter. For instance, as described in the policy:

Crunchy Data anticipates the following release schedule for Crunchy PostgreSQL for Kubernetes:

  • At least one (1) PATCH release per quarter, timed around the PGDG Release
  • At least one (1) MINOR release per quarter, timed around the end-of-the-quarter

PGO v5.3.0 is therefore the new MINOR version of PGO that we're looking to release this quarter.

Thanks for your feedback, and we appreciate your patience as we look to get this update released in the coming weeks!

andrewlecuyer avatar Dec 02 '22 22:12 andrewlecuyer

Since I'm in no hurry to use PGO, I'll just delete the deployment. I would rather not have the pod in crash loop backoff for the next month.

controlpl4n3 avatar Dec 05 '22 17:12 controlpl4n3

PGO v5.3.0 has been released! It is compatible with K8s v1.25, as noted above.

benjaminjb avatar Dec 22 '22 18:12 benjaminjb

Will the community operator in the openshift operatorhub supposed to get this update as well? I can see that only the certified version is currently v5.3.0. (Nor the community neither the marketplace)

Zvezdoreel avatar Jan 05 '23 08:01 Zvezdoreel

@Zvezdoreel We are planning to release that version as well, but are currently encountering some issues deploying our installers via the Red Hat certification process. We are actively working with Red Hat on a resolution and hope to have all OLM installers available soon.

tjmoore4 avatar Jan 05 '23 19:01 tjmoore4

So now this is biting me, because 5.3.0 doesn't have working backups: #3549

So I guess the conclusion is that Crunchy Data has no support for Kubernetes 1.25?

haf avatar Feb 10 '23 19:02 haf

To clarify, PGO is fully compatible with Kubernetes 1.25.

The issue @haf references is unrelated, and cannot be reproduced (and is being addressed/discussed in https://github.com/CrunchyData/postgres-operator/issues/3549). Additionally, backups have been confirmed to work properly with the v5.3.0 release.

andrewlecuyer avatar Feb 10 '23 19:02 andrewlecuyer