openyurtio / yurt-app-manager

The workload controller manager from NodePool level in OpenYurt cluster
Apache License 2.0
6 stars 1 forks source link

[BUG] open /tmp/k8s-webhook-server/serving-certs/tls.crt: no such file or directory #90

Closed beatyman closed 2 years ago

beatyman commented 2 years ago

803 10:17:49.305182 1 leaderelection.go:248] attempting to acquire leader lease kube-system/yurt-app-manager... 2022-08-03T10:17:49.305Z INFO controller-runtime.manager starting metrics server {"path": "/metrics"} 2022-08-03T10:17:49.305Z INFO controller-runtime.webhook.webhooks starting webhook server 2022-08-03T10:17:49.305Z ERROR controller-runtime.manager error received after stop sequence was engaged {"error": "context canceled"} 2022-08-03T10:17:49.305Z ERROR controller-runtime.manager error received after stop sequence was engaged {"error": "context canceled"} E0803 10:17:49.305737 1 leaderelection.go:330] error retrieving resource lock kube-system/yurt-app-manager: Get "https://10.10.0.1:443/apis/coordination.k8s.io/v1/namespaces/kube-system/leases/yurt-app-manager": context canceled 2022-08-03T10:17:49.305Z ERROR setup problem running manager {"error": "open /tmp/k8s-webhook-server/serving-certs/tls.crt: no such file or directory"} github.com/openyurtio/yurt-app-manager/cmd/yurt-app-manager/app.Run /build/cmd/yurt-app-manager/app/core.go:167 github.com/openyurtio/yurt-app-manager/cmd/yurt-app-manager/app.NewCmdYurtAppManager.func1 /build/cmd/yurt-app-manager/app/core.go:87 github.com/spf13/cobra.(Command).execute /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 github.com/spf13/cobra.(Command).ExecuteC /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 github.com/spf13/cobra.(*Command).Execute /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897 main.main /build/cmd/yurt-app-manager/app-manager.go:37 runtime.main /usr/local/go/src/runtime/proc.go:255

beatyman commented 2 years ago

企业微信截图_16595220718207

huiwq1990 commented 2 years ago

Try the command below:

IMAGE_TAG=v0.7.0-beta.1 TARGET_PLATFORMS=linux/amd64 make docker-build

helm uninstall yurt-app-manager  
helm install yurt-app-manager ./charts/yurt-app-manager/  
rudolf-chy commented 2 years ago

/assign

rudolf-chy commented 2 years ago

803 10:17:49.305182 1 leaderelection.go:248] attempting to acquire leader lease kube-system/yurt-app-manager... 2022-08-03T10:17:49.305Z INFO controller-runtime.manager starting metrics server {"path": "/metrics"} 2022-08-03T10:17:49.305Z INFO controller-runtime.webhook.webhooks starting webhook server 2022-08-03T10:17:49.305Z ERROR controller-runtime.manager error received after stop sequence was engaged {"error": "context canceled"} 2022-08-03T10:17:49.305Z ERROR controller-runtime.manager error received after stop sequence was engaged {"error": "context canceled"} E0803 10:17:49.305737 1 leaderelection.go:330] error retrieving resource lock kube-system/yurt-app-manager: Get "https://10.10.0.1:443/apis/coordination.k8s.io/v1/namespaces/kube-system/leases/yurt-app-manager": context canceled 2022-08-03T10:17:49.305Z ERROR setup problem running manager {"error": "open /tmp/k8s-webhook-server/serving-certs/tls.crt: no such file or directory"} github.com/openyurtio/yurt-app-manager/cmd/yurt-app-manager/app.Run /build/cmd/yurt-app-manager/app/core.go:167 github.com/openyurtio/yurt-app-manager/cmd/yurt-app-manager/app.NewCmdYurtAppManager.func1 /build/cmd/yurt-app-manager/app/core.go:87 github.com/spf13/cobra.(Command).execute /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 github.com/spf13/cobra.(Command).ExecuteC /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 github.com/spf13/cobra.(*Command).Execute /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897 main.main /build/cmd/yurt-app-manager/app-manager.go:37 runtime.main /usr/local/go/src/runtime/proc.go:255

Could you show me the steps of your operation and the version of your environment

AndyEWang commented 2 years ago

same in the latest image openyurt/yurt-app-manager:latest I found the secret is empty in config/setup/all_in_one.yaml

      volumes:
      - name: cert
        secret:
          defaultMode: 420
          secretName: yurt-app-manager

# Source: yurt-app-manager/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: yurt-app-manager
  namespace: kube-system

So we need to manually add the cert firstly, right?

rambohe-ch commented 2 years ago

@huiwq1990 I think we need to update config/setup/all_in_one.yaml file in terms of helm charts of yurt-app-manager. would you be able to upgrade yaml file of yurt-app-manager?

Lulucyliu commented 2 years ago

I have the same problem

2022-08-10T11:53:56.521Z        INFO    controller-runtime.metrics      Metrics server is starting to listen    {"addr": ":8080"}
I0810 11:53:56.522997       1 core.go:188] Create readiness/health check
2022-08-10T11:53:56.523Z        INFO    setup   register field index
2022-08-10T11:53:56.523Z        INFO    setup   new clientset registry
2022-08-10T11:53:56.528Z        INFO    setup   setup controllers
2022-08-10T11:53:56.536Z        INFO    setup   setup webhook
2022-08-10T11:53:56.536Z        INFO    controller-runtime.builder      Registering a mutating webhook  {"GVK": "apps.openyurt.io/v1alpha1, Kind=NodePool", "path": "/mutate-apps-openyurt-io-v1alpha1-nodepool"}
2022-08-10T11:53:56.536Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/mutate-apps-openyurt-io-v1alpha1-nodepool"}
2022-08-10T11:53:56.536Z        INFO    controller-runtime.builder      Registering a validating webhook        {"GVK": "apps.openyurt.io/v1alpha1, Kind=NodePool", "path": "/validate-apps-openyurt-io-v1alpha1-nodepool"}
2022-08-10T11:53:56.537Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/validate-apps-openyurt-io-v1alpha1-nodepool"}
2022-08-10T11:53:56.537Z        INFO    controller-runtime.builder      Registering a mutating webhook  {"GVK": "apps.openyurt.io/v1alpha1, Kind=YurtAppDaemon", "path": "/mutate-apps-openyurt-io-v1alpha1-yurtappdaemon"}
2022-08-10T11:53:56.537Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/mutate-apps-openyurt-io-v1alpha1-yurtappdaemon"}
2022-08-10T11:53:56.537Z        INFO    controller-runtime.builder      Registering a validating webhook        {"GVK": "apps.openyurt.io/v1alpha1, Kind=YurtAppDaemon", "path": "/validate-apps-openyurt-io-v1alpha1-yurtappdaemon"}
2022-08-10T11:53:56.537Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/validate-apps-openyurt-io-v1alpha1-yurtappdaemon"}
2022-08-10T11:53:56.538Z        INFO    controller-runtime.builder      Registering a mutating webhook  {"GVK": "apps.openyurt.io/v1alpha1, Kind=YurtAppSet", "path": "/mutate-apps-openyurt-io-v1alpha1-yurtappset"}
2022-08-10T11:53:56.538Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/mutate-apps-openyurt-io-v1alpha1-yurtappset"}
2022-08-10T11:53:56.538Z        INFO    controller-runtime.builder      Registering a validating webhook        {"GVK": "apps.openyurt.io/v1alpha1, Kind=YurtAppSet", "path": "/validate-apps-openyurt-io-v1alpha1-yurtappset"}
2022-08-10T11:53:56.538Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/validate-apps-openyurt-io-v1alpha1-yurtappset"}
2022-08-10T11:53:56.538Z        INFO    controller-runtime.builder      Registering a mutating webhook  {"GVK": "apps.openyurt.io/v1alpha1, Kind=YurtIngress", "path": "/mutate-apps-openyurt-io-v1alpha1-yurtingress"}
2022-08-10T11:53:56.538Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/mutate-apps-openyurt-io-v1alpha1-yurtingress"}
2022-08-10T11:53:56.539Z        INFO    controller-runtime.builder      Registering a validating webhook        {"GVK": "apps.openyurt.io/v1alpha1, Kind=YurtIngress", "path": "/validate-apps-openyurt-io-v1alpha1-yurtingress"}
2022-08-10T11:53:56.539Z        INFO    controller-runtime.webhook      Registering webhook     {"path": "/validate-apps-openyurt-io-v1alpha1-yurtingress"}
2022-08-10T11:53:56.539Z        INFO    setup   starting manager
2022-08-10T11:53:56.540Z        INFO    Starting metrics server {"path": "/metrics"}
2022-08-10T11:53:56.540Z        INFO    controller-runtime.webhook.webhooks     Starting webhook server
I0810 11:53:56.540226       1 leaderelection.go:248] attempting to acquire leader lease kube-system/yurt-app-manager...
2022-08-10T11:53:56.540Z        ERROR   error received after stop sequence was engaged  {"error": "context canceled"}
2022-08-10T11:53:56.541Z        ERROR   error received after stop sequence was engaged  {"error": "context canceled"}
E0810 11:53:56.541170       1 leaderelection.go:330] error retrieving resource lock kube-system/yurt-app-manager: context canceled
2022-08-10T11:53:56.541Z        ERROR   error received after stop sequence was engaged  {"error": "leader election lost"}
2022-08-10T11:53:56.541Z        ERROR   setup   problem running manager {"error": "open /tmp/k8s-webhook-server/serving-certs/tls.crt: no such file or directory"}
github.com/spf13/cobra.(*Command).execute
        /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
        /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960
github.com/spf13/cobra.(*Command).Execute
        /go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
main.main
        /build/cmd/yurt-app-manager/app-manager.go:37
runtime.main
        /usr/local/go/src/runtime/proc.go:255
huiwq1990 commented 2 years ago

@huiwq1990 I think we need to update config/setup/all_in_one.yaml file in terms of helm charts of yurt-app-manager. would you be able to upgrade yaml file of yurt-app-manager?

@rambohe-ch I will do the follow things:

1) recover the all-in-one.yaml to the old version, make sure the document instruction is fine, but the yurt-app-manager version is old; 2) modify the document, recommend user to use helm install yurt-app-manager; 3) deprecated the all-in-one.yaml;

rambohe-ch commented 2 years ago

@beatyman The problem has been solved by #101 . please you can take a try with the newest all_in_one.yaml, and i will close this issue at first.