Ошибка CRD K8s: неподдерживаемый тип носителя 415 - PullRequest
0 голосов
/ 15 марта 2020

Итак, я следовал этому уроку (https://www.youtube.com/watch?v=KBTXBUVNF2I), и после настройки согласователя, когда я выполняю команду «make run», я получаю следующую ошибку:

/Users/sourav/go/bin/controller-gen object:headerFile=./hack/boilerplate.go.txt paths="./..."
go fmt ./...
go vet ./...
/Users/sourav/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
go run ./main.go
2020-03-15T22:13:29.111+0530 INFO controller-runtime.metrics metrics server is starting to listen {"addr": ":8080"}
2020-03-15T22:13:29.112+0530 INFO setup starting manager
2020-03-15T22:13:29.113+0530 INFO controller-runtime.manager starting metrics server {"path": "/metrics"}
2020-03-15T22:13:29.213+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.213+0530 INFO controller-runtime.controller Starting EventSource {"controller": "redis", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.213+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.315+0530 INFO controller-runtime.controller Starting EventSource {"controller": "redis", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.315+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting EventSource {"controller": "guestbook", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting EventSource {"controller": "redis", "source": "kind source: /, Kind="}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting Controller {"controller": "guestbook"}
2020-03-15T22:13:29.418+0530 INFO controller-runtime.controller Starting Controller {"controller": "redis"}
2020-03-15T22:13:29.519+0530 INFO controller-runtime.controller Starting workers {"controller": "redis", "worker count": 1}
2020-03-15T22:13:29.519+0530 INFO controllers.Redis reconciling redis {"redis": "default/redis-sample"}
2020-03-15T22:13:29.523+0530 INFO controller-runtime.controller Starting workers {"controller": "guestbook", "worker count": 1}
2020-03-15T22:13:29.527+0530 ERROR controller-runtime.controller Reconciler error {"controller": "redis", "request": "default/redis-sample", "error": "415: Unsupported Media Type"}
github.com/go-logr/zapr.(*zapLogger).Error
/Users/sourav/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
/Users/sourav/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:258
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/Users/sourav/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:232
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker
/Users/sourav/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.4.0/pkg/internal/controller/controller.go:211
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1
/Users/sourav/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190913080033-27d36303b655/pkg/util/wait/wait.go:152
k8s.io/apimachinery/pkg/util/wait.JitterUntil
/Users/sourav/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190913080033-27d36303b655/pkg/util/wait/wait.go:153
k8s.io/apimachinery/pkg/util/wait.Until
/Users/sourav/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190913080033-27d36303b655/pkg/util/wait/wait.go:88
2020-03-15T22:13:30.528+0530 INFO controllers.Redis reconciling redis {"redis": "default/redis-sample"}
2020-03-15T22:13:30.548+0530 ERROR controller-runtime.controller Reconciler error {"controller": "redis", "request": "default/redis-sample", "error": "415: Unsupported Media Type"}

Ошибка, кажется, происходит из этой строки:

https://github.com/DirectXMan12/kubebuilder-workshops/blob/605890232fb368a8ff00ac5e9879c8dfd90f904c/controllers/redis_controller.go#L73

Любая идея, что может быть причиной этой ошибки и как ее решить?

1 Ответ

1 голос
/ 15 марта 2020

То есть с использованием сравнительно новой функции, убедитесь, что ваши kubernetes обновлены и на сервере включена поддержка.

...