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

Error when starting up postgres, using version 1.16 #140

Open
joubertb opened this issue Nov 8, 2022 · 1 comment
Open

Error when starting up postgres, using version 1.16 #140

joubertb opened this issue Nov 8, 2022 · 1 comment

Comments

@joubertb
Copy link

joubertb commented Nov 8, 2022

I am not able to startup Postgres. Installed version 1.16. I am getting the following error. Any thoughts?

1.667944382668021e+09 INFO controllers.Kubegres KUBEGRES {"name": "test-postgres", "Status": {"blockingOperation":{"statefulSetOperation":{},"statefulSetSpecUpdateOperation":{}},"previousBlockingOperation":{"statefulSetOperation":{},"statefulSetSpecUpdateOperation":{}}}}
1.667944383520829e+09 ERROR controllers.Kubegres Unable to load any deployed BackUp CronJob. {"CronJob name": "backup-test-postgres", "error": "no matches for kind "CronJob" in version "batch/v1""}
reactive-tech.io/kubegres/controllers/ctx/log.(*LogWrapper).ErrorEvent
/workspace/controllers/ctx/log/LogWrapper.go:62
reactive-tech.io/kubegres/controllers/states.(*BackUpStates).getDeployedCronJob
/workspace/controllers/states/BackUpStates.go:91
reactive-tech.io/kubegres/controllers/states.(*BackUpStates).loadStates
/workspace/controllers/states/BackUpStates.go:49
reactive-tech.io/kubegres/controllers/states.loadBackUpStates
/workspace/controllers/states/BackUpStates.go:43
reactive-tech.io/kubegres/controllers/states.(*ResourcesStates).loadBackUpStates
/workspace/controllers/states/ResourcesStates.go:95
reactive-tech.io/kubegres/controllers/states.(*ResourcesStates).loadStates
/workspace/controllers/states/ResourcesStates.go:66
reactive-tech.io/kubegres/controllers/states.LoadResourcesStates
/workspace/controllers/states/ResourcesStates.go:40
reactive-tech.io/kubegres/controllers/ctx/resources.CreateResourcesContext
/workspace/controllers/ctx/resources/ResourcesContext.go:110
reactive-tech.io/kubegres/controllers.(*KubegresReconciler).Reconcile
/workspace/controllers/kubegres_controller.go:76
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:121
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:320
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:273
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:234
1.6679443835210457e+09 ERROR Reconciler error {"controller": "kubegres", "controllerGroup": "kubegres.reactive-tech.io", "controllerKind": "Kubegres", "kubegres": {"name":"test-postgres","namespace":"default"}, "namespace": "default", "name": "test-postgres", "reconcileID": "cb49cdb7-2464-4a48-8365-822d9e0af891", "error": "no matches for kind "CronJob" in version "batch/v1""}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:273
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:234
1.6679443835211165e+09 DEBUG events Warning {"object": {"kind":"Kubegres","namespace":"default","name":"test-postgres","uid":"b380917d-6c13-4471-995e-8069960adc3b","apiVersion":"kubegres.reactive-tech.io/v1","resourceVersion":"4535076"}, "reason": "BackUpCronJobLoadingErr", "message": "Unable to load any deployed BackUp CronJob. 'CronJob name': backup-test-postgres - no matches for kind "CronJob" in version "batch/v1""}

=====================================
apiVersion: kubegres.reactive-tech.io/v1
kind: Kubegres
metadata:
name: test-postgres
namespace: default
spec:
replicas: 2
image: postgres:14.1
database:
size: 8Gi
storageClassName: local-storage
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: superUserPassword
- name: POSTGRES_REPLICATION_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: replicationUserPassword

================
k8s version:
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.15", GitCommit:"8f1e5bf0b9729a899b8df86249b56e2c74aebc55", GitTreeState:"clean", BuildDate:"2022-01-19T17:23:01Z", GoVersion:"go1.15.15", Compiler:"gc", Platform:"linux/amd64"}

================
storage classes:
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 20d

@bendahl
Copy link

bendahl commented Nov 29, 2022

Hi @joubertb,

it looks like you're using an outdated K8S version (1.20.15), which does not support the stable Cronjob API. For this to work, you will need to upgrade your cluster, to a more recent version.

On a different note, I believe that it would be advisable to update your cluster anyway, in order to ensure that the version you're running is properly patched. For more details, see the documentation: https://kubernetes.io/releases/.

I hope this helps.

Cheers
Ben

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

No branches or pull requests

2 participants