fluxcd not applying anything with err="running kubectl: error: unable to recognize \"STDIN\": ..."

fluxcd not applying anything with err="running kubectl: error: unable to recognize \"STDIN\": ..."

我最近使用 fluxctl install[=27= 在 Azure AKS k8s 集群上安装了 FluxCD 1.19.0 ].我们使用私有 git(自托管 bitbucket),Flux 可以访问并检出。

现在 Flux 没有应用任何错误消息:

ts=2020-06-10T09:07:42.7589883Z caller=loop.go:133 component=sync-loop event=refreshed url=ssh://git@bitbucket.some-private-server.com:7999/infra/k8s-gitops.git branch=master HEAD=7bb83d1753a814c510b1583da6867408a5f7e21b
ts=2020-06-10T09:09:00.631764Z caller=sync.go:73 component=daemon info="trying to sync git changes to the cluster" old=7bb83d1753a814c510b1583da6867408a5f7e21b new=7bb83d1753a814c510b1583da6867408a5f7e21b
ts=2020-06-10T09:09:01.6130559Z caller=sync.go:539 method=Sync cmd=apply args= count=3
ts=2020-06-10T09:09:20.2097034Z caller=sync.go:605 method=Sync cmd="kubectl apply -f -" took=18.5965923s err="running kubectl: error: unable to recognize \"STDIN\": an error on the server (\"\") has prevented the request from succeeding" output=
ts=2020-06-10T09:09:38.7432182Z caller=sync.go:605 method=Sync cmd="kubectl apply -f -" took=18.5334244s err="running kubectl: error: unable to recognize \"STDIN\": an error on the server (\"\") has prevented the request from succeeding" output=
ts=2020-06-10T09:09:57.277918Z caller=sync.go:605 method=Sync cmd="kubectl apply -f -" took=18.5346491s err="running kubectl: error: unable to recognize \"STDIN\": an error on the server (\"\") has prevented the request from succeeding" output=
ts=2020-06-10T09:09:57.2779965Z caller=sync.go:167 component=daemon err="<cluster>:namespace/dev: running kubectl: error: unable to recognize \"STDIN\": an error on the server (\"\") has prevented the request from succeeding; <cluster>:namespace/prod: running kubectl: error: unable to recognize \"STDIN\": an error on the server (\"\") has prevented the request from succeeding; dev:service/hello-world: running kubectl: error: unable to recognize \"STDIN\": an error on the server (\"\") has prevented the request from succeeding"
ts=2020-06-10T09:09:57.2879489Z caller=images.go:17 component=sync-loop msg="polling for new images for automated workloads"
ts=2020-06-10T09:09:57.3002208Z caller=images.go:27 component=sync-loop msg="no automated workloads"

据我了解,Flux 将资源定义传递给 kubectl,然后 kubectl 应用它们?

我解释错误的方式意味着 kubectl 没有传递任何东西。然而,我在容器中打开了一个 shell 并确保 Flux 实际上正在检查一些东西 - 它确实做到了。

我尝试将详细程度提高到 9,但它没有 return 我认为相关的任何内容(针对 Kubernetes API 的 http 请求和响应的详细输出)。

那么这里发生了什么?

问题出在 1.19 flux 版本中使用的 kubectl 版本,所以我使用预发布修复了它:https://hub.docker.com/r/fluxcd/flux-prerelease/tags