drupal-operator
drupal-operator copied to clipboard
Can't get Operator to start on Minikube / 1.15.0
I get the following errors for the drupal-operator pod, which is stuck in a CrashLoopBackOff:
{
"level": "error",
"ts": 1563824078.4568,
"logger": "kubebuilder.source",
"msg": "if kind is a CRD, it should be installed before calling Start",
"kind": "Drupal.drupal.org",
"error": "no matches for kind \"Drupal\" in version \"drupal.org\/v1alpha1\"",
"stacktrace": "github.com\/operator-framework\/operator-sdk\/vendor\/github.com\/go-logr\/zapr.(*zapLogger).Error\n\tsrc\/github.com\/operator-framework\/operator-sdk\/vendor\/github.com\/go-logr\/zapr\/zapr.go:128\ngithub.com\/operator-framework\/operator-sdk\/vendor\/sigs.k8s.io\/controller-runtime\/pkg\/source.(*Kind).Start\n\tsrc\/github.com\/operator-framework\/operator-sdk\/vendor\/sigs.k8s.io\/controller-runtime\/pkg\/source\/source.go:89\ngithub.com\/operator-framework\/operator-sdk\/vendor\/sigs.k8s.io\/controller-runtime\/pkg\/internal\/controller.(*Controller).Watch\n\tsrc\/github.com\/operator-framework\/operator-sdk\/vendor\/sigs.k8s.io\/controller-runtime\/pkg\/internal\/controller\/controller.go:122\ngithub.com\/operator-framework\/operator-sdk\/pkg\/ansible\/controller.Add\n\tsrc\/github.com\/operator-framework\/operator-sdk\/pkg\/ansible\/controller\/controller.go:93\ngithub.com\/operator-framework\/operator-sdk\/pkg\/ansible\/operator.Run\n\tsrc\/github.com\/operator-framework\/operator-sdk\/pkg\/ansible\/operator\/operator.go:55"
}
and:
{
"level": "error",
"ts": 1563824078.4575,
"logger": "ansible-controller",
"msg": "",
"error": "no matches for kind \"Drupal\" in version \"drupal.org\/v1alpha1\"",
"stacktrace": "github.com\/operator-framework\/operator-sdk\/vendor\/github.com\/go-logr\/zapr.(*zapLogger).Error\n\tsrc\/github.com\/operator-framework\/operator-sdk\/vendor\/github.com\/go-logr\/zapr\/zapr.go:128\ngithub.com\/operator-framework\/operator-sdk\/pkg\/ansible\/controller.Add\n\tsrc\/github.com\/operator-framework\/operator-sdk\/pkg\/ansible\/controller\/controller.go:94\ngithub.com\/operator-framework\/operator-sdk\/pkg\/ansible\/operator.Run\n\tsrc\/github.com\/operator-framework\/operator-sdk\/pkg\/ansible\/operator\/operator.go:55"
}
Running Minikube 1.2.0 locally, with Kubernetes 1.15.0.
Looks like it's related this issue: https://github.com/operator-framework/operator-sdk/issues/183 — could be an order of operations thing.
I had to first apply the CRD:
kubectl apply -f deploy/crds/drupal_v1alpha1_drupal_crd.yaml
Then run the command in the README to deploy the operator:
kubectl apply -f deploy/
And now it seems the operator is running correctly.