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

Docs link to broken mysql-operator in k1.27.3 #357

Open
alex4108 opened this issue Jun 26, 2023 · 2 comments
Open

Docs link to broken mysql-operator in k1.27.3 #357

alex4108 opened this issue Jun 26, 2023 · 2 comments

Comments

@alex4108
Copy link

alex4108 commented Jun 26, 2023

Summary

mattermost-operator/docs has outdated mysql-operator incompatible

Steps to reproduce

  1. Fresh kubernetes cluster on 1.27.3 (or higher). I use home-grown kubeadm cluster.
  2. Follow MM blog or MM Docs to install self-hosted. Note step 5 "Install a Database" links to this repo:
  3. https://raw.githubusercontent.com/mattermost/mattermost-operator/master/docs/mysql-operator/mysql-operator.yaml
  4. Once mysql-operator is applied, check mysql-operator-0 pod logs for error
➜  2-mattermost git:(main) ✗ kubectl logs -n mysql-operator mysql-operator-0
Defaulted container "operator" out of: operator, orchestrator
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.948020743Z","logger":"mysql-operator","message":"Starting mysql-operator..."}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.991206933Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"mysqlbackup-controller","source":"kind source: /, Kind="}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.991409419Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"mysqlbackup-controller","source":"kind source: /, Kind="}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.991558945Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"mysqlbackupcron-controller","source":"kind source: /, Kind="}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.993247211Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"controller.mysqlcluster","source":"kind source: /, Kind="}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.993287715Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"controller.mysqlcluster","source":"kind source: /, Kind="}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.99425819Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"controller.mysqlcluster","source":"kind source: /, Kind="}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.994400535Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"controller.mysqlcluster","source":"kind source: /, Kind="}
{"severity":"INFO","timestamp":"2023-06-26T19:47:50.994547404Z","logger":"kubebuilder.controller","message":"Starting EventSource","controller":"controller.mysqlcluster","source":"kind source: /, Kind="}
{"severity":"ERROR","timestamp":"2023-06-26T19:47:50.994580795Z","logger":"kubebuilder.source","message":"if kind is a CRD, it should be installed before calling Start","kind":"PodDisruptionBudget.policy","error":"no matches for kind \"PodDisruptionBudget\" in version \"policy/v1beta1\"","stacktrace":"github.com/presslabs/mysql-operator/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/github.com/presslabs/mysql-operator/vendor/github.com/go-logr/zapr/zapr.go:128\ngithub.com/presslabs/mysql-operator/vendor/sigs.k8s.io/controller-runtime/pkg/source.(*Kind).Start\n\t/go/src/github.com/presslabs/mysql-operator/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go:89\ngithub.com/presslabs/mysql-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Watch\n\t/go/src/github.com/presslabs/mysql-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:122\ngithub.com/presslabs/mysql-operator/pkg/controller/mysqlcluster.add\n\t/go/src/github.com/presslabs/mysql-operator/pkg/controller/mysqlcluster/mysqlcluster_controller.go:107\ngithub.com/presslabs/mysql-operator/pkg/controller/mysqlcluster.Add\n\t/go/src/github.com/presslabs/mysql-operator/pkg/controller/mysqlcluster/mysqlcluster_controller.go:56\ngithub.com/presslabs/mysql-operator/pkg/controller.AddToManager\n\t/go/src/github.com/presslabs/mysql-operator/pkg/controller/controller.go:29\nmain.main\n\t/go/src/github.com/presslabs/mysql-operator/cmd/mysql-operator/main.go:94\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"}
{"severity":"ERROR","timestamp":"2023-06-26T19:47:50.99468862Z","logger":"mysql-operator","message":"unable to setup controllers","error":"**no matches for kind \"PodDisruptionBudget\"** in version \"policy/v1beta1\"","stacktrace":"github.com/presslabs/mysql-operator/vendor/github.com/go-logr/zapr.(*zapLogger).Error\n\t/go/src/github.com/presslabs/mysql-operator/vendor/github.com/go-logr/zapr/zapr.go:128\nmain.main\n\t/go/src/github.com/presslabs/mysql-operator/cmd/mysql-operator/main.go:95\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"}

Expected behavior

provided mysql-operator manifest should be compatible with latest stable kubernetes

Observed behavior (that appears unintentional)

mysql-operator-0 fails to initialize due to using deprecated kubernetes API resource

Possible fixes

  • update the mysql-operator.yaml
  • remove the blog post
@alex4108 alex4108 changed the title Can't deploy using docs on k1.27.3 Docs link to broken mysql-operator in k1.27.3 Jun 26, 2023
@monsi1000
Copy link

I am stuck at the same issue, would be nice if it gets fixed.

@juztins-lab
Copy link

Hi,

I have found a workaround to fix this, in case anyone else wonders on the internet clueless like me.

The old mysql-operator needs to be deleted, I recommended removing the whole namespace:

kubectl delete namespace mysql-operator

Extras:
kubectl delete serviceaccount mysql-operator -n mysql-operator -- might not be necessary, I am replaying my history here
kubectl delete clusterrole mysql-operator
kubectl delete clusterrolebinding mysql-operator

Then just install the updated and working version:
helm install mysql-operator bitpoke/mysql-operator -n mysql-operator

Then just wait it should repair the already configured cluster and spawn up. (working on kube v1.26.5)

Cheers!

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

3 participants