thom8 / drupal-operator

Drupal ansible operator for kubernetes
18 stars 3 forks source link

Can't get Operator to start on Minikube / 1.15.0 #3

Open geerlingguy opened 5 years ago

geerlingguy commented 5 years ago

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.

geerlingguy commented 5 years ago

Looks like it's related this issue: https://github.com/operator-framework/operator-sdk/issues/183 — could be an order of operations thing.

geerlingguy commented 5 years ago

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.