Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: INSTALLATION FAILED: failed pre-install: timed out waiting for the condition #27

Open
Harmol opened this issue Apr 20, 2022 · 1 comment

Comments

@Harmol
Copy link
Contributor

Harmol commented Apr 20, 2022

Describe the bug a clear and concise description of what the bug is.

helm install kubediag -n kubediag ./kubediag-helm --debug timed out waiting for the condition.

$ helm install kubediag -n kubediag ./kubediag-helm --debug
install.go:178: [debug] Original chart version: ""
install.go:195: [debug] CHART PATH: /home/ywh/Desktop/kubediag-helm

client.go:128: [debug] creating 1 resource(s)
W0509 17:23:03.410772  519030 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
install.go:151: [debug] CRD diagnoses.diagnosis.kubediag.org is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
W0509 17:23:03.431805  519030 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
install.go:151: [debug] CRD operations.diagnosis.kubediag.org is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
W0509 17:23:03.456401  519030 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
install.go:151: [debug] CRD operationsets.diagnosis.kubediag.org is already present. Skipping.
client.go:128: [debug] creating 1 resource(s)
W0509 17:23:03.487895  519030 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
install.go:151: [debug] CRD triggers.diagnosis.kubediag.org is already present. Skipping.
W0509 17:23:04.891413  519030 warnings.go:70] admissionregistration.k8s.io/v1beta1 MutatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 MutatingWebhookConfiguration
W0509 17:23:04.894453  519030 warnings.go:70] admissionregistration.k8s.io/v1beta1 ValidatingWebhookConfiguration is deprecated in v1.16+, unavailable in v1.22+; use admissionregistration.k8s.io/v1 ValidatingWebhookConfiguration
client.go:299: [debug] Starting delete for "kubediag-admission" ServiceAccount
client.go:128: [debug] creating 1 resource(s)
client.go:299: [debug] Starting delete for "kubediag-admission" ClusterRole
client.go:128: [debug] creating 1 resource(s)
client.go:299: [debug] Starting delete for "kubediag-admission" ClusterRoleBinding
client.go:128: [debug] creating 1 resource(s)
client.go:299: [debug] Starting delete for "kubediag-admission" Role
client.go:128: [debug] creating 1 resource(s)
client.go:299: [debug] Starting delete for "kubediag-admission" RoleBinding
client.go:128: [debug] creating 1 resource(s)
client.go:299: [debug] Starting delete for "kubediag-kubediag-helm-create-secret" Job
client.go:128: [debug] creating 1 resource(s)
client.go:529: [debug] Watching for changes to Job kubediag-kubediag-helm-create-secret with timeout of 5m0s
client.go:557: [debug] Add/Modify event for kubediag-kubediag-helm-create-secret: ADDED
client.go:596: [debug] kubediag-kubediag-helm-create-secret: Jobs active: 0, jobs failed: 0, jobs succeeded: 0
client.go:557: [debug] Add/Modify event for kubediag-kubediag-helm-create-secret: MODIFIED
client.go:596: [debug] kubediag-kubediag-helm-create-secret: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
Error: INSTALLATION FAILED: failed pre-install: timed out waiting for the condition
helm.go:84: [debug] failed pre-install: timed out waiting for the condition
INSTALLATION FAILED
main.newInstallCmd.func2
	helm.sh/helm/v3/cmd/helm/install.go:127
github.com/spf13/cobra.(*Command).execute
	github.com/spf13/cobra@v1.3.0/command.go:856
github.com/spf13/cobra.(*Command).ExecuteC
	github.com/spf13/cobra@v1.3.0/command.go:974
github.com/spf13/cobra.(*Command).Execute
	github.com/spf13/cobra@v1.3.0/command.go:902
main.main
	helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
	runtime/proc.go:255
runtime.goexit
	runtime/asm_amd64.s:1581

This bug is caused by kube-webhook-certgen, which failed to create secret.

$ kubectl logs -n kubediag pod/kubediag-kubediag-helm-create-secret-6sj89
W0420 09:53:23.295336       1 client_config.go:608] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
{"level":"fatal","msg":"got secret, but it did not contain a 'ca' key","source":"k8s/k8s.go:114","time":"2022-04-20T09:53:23Z"}

What's your kubectl version?

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.5-nks.2", GitCommit:"dcef6963d06733606144b5c8bc3ca27ff83edd55", GitTreeState:"clean", BuildDate:"2021-10-26T10:17:08Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.5-nks.2", GitCommit:"dcef6963d06733606144b5c8bc3ca27ff83edd55", GitTreeState:"clean", BuildDate:"2021-10-26T10:15:26Z", GoVersion:"go1.16.9", Compiler:"gc", Platform:"linux/amd64"}

What's the chart version?

v0.1.3

@Harmol
Copy link
Contributor Author

Harmol commented May 9, 2022

问题分析

kubediag 部署过程中 Job kubediag-kubediag-helm-create-secret 会创建一个包含证书的 secret ,但该命名空间下已存在同名 secret 且该 secret 不包含 ca 字段(证书过期),当存在目标 secret 时该 Job 会检查已有 secret (该 secret 不包含 ca 字段故 Job 会报错,无法成功创建 secret)。helm 一直等待 job 成功运行,最终超时。

解决方案

删除旧的同名 secret 并重新部署 kubediag (helm install 或 helm upgrade)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant