go-helm-client
go-helm-client copied to clipboard
Can not deploy simple nginx-helm chart
I'm trying to deploy the ingress-nginx helm chart with no customizations, and I keep getting context deadline exceeded.
I can deploy this with helm install absolutely fine.
My code snippet:
// Builds Helm Chart Client ////
fmt.Println("Building Helm Client\n")
opt := &helmclient.Options{
Namespace: "default", // Change this to the namespace you wish the client to operate in.
RepositoryCache: "/tmp/.helmcache",
RepositoryConfig: "/tmp/.helmrepo",
Debug: false,
Linting: true,
DebugLog: func(format string, v ...interface{}) {},
Output: &outputBuffer, // Not mandatory, leave open for default os.Stdout
}
myHelmClient, err := helmclient.New(opt)
if err != nil {
panic(err)
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//// Now use Helmchart client to create external-secrets chart repo //////
fmt.Println("Deploying nginx-ingress\n")
nginxchartRepo := repo.Entry{
Name: "ingress-nginx",
URL: "https://kubernetes.github.io/ingress-nginx",
PassCredentialsAll: true,
}
if err := myHelmClient.AddOrUpdateChartRepo(nginxchartRepo); err != nil {
log.Fatal(err)
} else {
fmt.Printf("Added Chart Repo %s\n", nginxchartRepo.Name)
}
// Now Run Update Chart Repos
if err := myHelmClient.UpdateChartRepos(); err != nil {
log.Fatal(err)
} else {
fmt.Printf("Updating Chart Repo\n")
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
// Now install the chart from the repo thats just been created./////////////////////
nginxchartSpec := helmclient.ChartSpec{
ReleaseName: "nginx-ingress",
ChartName: "ingress-nginx/ingress-nginx",
Namespace: "nginx-ingress",
CreateNamespace: true,
SkipCRDs: false,
Wait: true,
//ValuesOptions: values.Options{
// ValueFiles: []string{"nginxvalues.yaml"},
//},
}
nginxInstalledHelmChart, err := myHelmClient.InstallChart(ctx, &nginxchartSpec, nil)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Status of Chart Install %v,\n", *nginxInstalledHelmChart.Info)
```
I've managed to get this output from the helm client run. It might help with troubleshooting.
2024/05/30 12:09:36 creating 1 resource(s)
2024/05/30 12:09:37 Starting delete for "nginx-ingress-ingress-nginx-admission" ServiceAccount
2024/05/30 12:09:37 Ignoring delete failure for "nginx-ingress-ingress-nginx-admission" /v1, Kind=ServiceAccount: serviceaccounts "nginx-ingress-ingress-nginx-admission" not found
2024/05/30 12:09:37 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:38 creating 1 resource(s)
2024/05/30 12:09:38 Starting delete for "nginx-ingress-ingress-nginx-admission" ClusterRole
2024/05/30 12:09:38 Ignoring delete failure for "nginx-ingress-ingress-nginx-admission" rbac.authorization.k8s.io/v1, Kind=ClusterRole: clusterroles.rbac.authorization.k8s.io "nginx-ingress-ingress-nginx-admission" not found
2024/05/30 12:09:38 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:38 creating 1 resource(s)
2024/05/30 12:09:39 Starting delete for "nginx-ingress-ingress-nginx-admission" ClusterRoleBinding
2024/05/30 12:09:39 Ignoring delete failure for "nginx-ingress-ingress-nginx-admission" rbac.authorization.k8s.io/v1, Kind=ClusterRoleBinding: clusterrolebindings.rbac.authorization.k8s.io "nginx-ingress-ingress-nginx-admission" not found
2024/05/30 12:09:39 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:40 creating 1 resource(s)
2024/05/30 12:09:40 Starting delete for "nginx-ingress-ingress-nginx-admission" Role
2024/05/30 12:09:40 Ignoring delete failure for "nginx-ingress-ingress-nginx-admission" rbac.authorization.k8s.io/v1, Kind=Role: roles.rbac.authorization.k8s.io "nginx-ingress-ingress-nginx-admission" not found
2024/05/30 12:09:40 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:41 creating 1 resource(s)
2024/05/30 12:09:41 Starting delete for "nginx-ingress-ingress-nginx-admission" RoleBinding
2024/05/30 12:09:41 Ignoring delete failure for "nginx-ingress-ingress-nginx-admission" rbac.authorization.k8s.io/v1, Kind=RoleBinding: rolebindings.rbac.authorization.k8s.io "nginx-ingress-ingress-nginx-admission" not found
2024/05/30 12:09:41 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:42 creating 1 resource(s)
2024/05/30 12:09:42 Starting delete for "nginx-ingress-ingress-nginx-admission-create" Job
2024/05/30 12:09:42 Ignoring delete failure for "nginx-ingress-ingress-nginx-admission-create" batch/v1, Kind=Job: jobs.batch "nginx-ingress-ingress-nginx-admission-create" not found
2024/05/30 12:09:42 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:42 creating 1 resource(s)
2024/05/30 12:09:42 Watching for changes to Job nginx-ingress-ingress-nginx-admission-create with timeout of 0s
2024/05/30 12:09:43 Add/Modify event for nginx-ingress-ingress-nginx-admission-create: ADDED
2024/05/30 12:09:43 nginx-ingress-ingress-nginx-admission-create: Jobs active: 0, jobs failed: 0, jobs succeeded: 0
2024/05/30 12:09:43 Add/Modify event for nginx-ingress-ingress-nginx-admission-create: MODIFIED
2024/05/30 12:09:43 nginx-ingress-ingress-nginx-admission-create: Jobs active: 1, jobs failed: 0, jobs succeeded: 0
2024/05/30 12:09:46 Add/Modify event for nginx-ingress-ingress-nginx-admission-create: MODIFIED
2024/05/30 12:09:46 nginx-ingress-ingress-nginx-admission-create: Jobs active: 0, jobs failed: 0, jobs succeeded: 0
2024/05/30 12:09:46 Add/Modify event for nginx-ingress-ingress-nginx-admission-create: MODIFIED
2024/05/30 12:09:46 Starting delete for "nginx-ingress-ingress-nginx-admission" ServiceAccount
2024/05/30 12:09:46 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:46 Starting delete for "nginx-ingress-ingress-nginx-admission" ClusterRole
2024/05/30 12:09:46 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:46 Starting delete for "nginx-ingress-ingress-nginx-admission" ClusterRoleBinding
2024/05/30 12:09:46 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:46 Starting delete for "nginx-ingress-ingress-nginx-admission" Role
2024/05/30 12:09:46 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:47 Starting delete for "nginx-ingress-ingress-nginx-admission" RoleBinding
2024/05/30 12:09:47 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:47 beginning wait for 1 resources to be deleted with timeout of 0s
2024/05/30 12:09:47 creating 11 resource(s)
2024/05/30 12:09:47 beginning wait for 11 resources with timeout of 0s
2024/05/30 12:09:47 Error received when checking status of resource nginx-ingress-ingress-nginx-controller-admission. Error: 'client rate limiter Wait returned an error: context deadline exceeded', Resource details: 'ResourceName: "nginx-ingress-ingress-nginx-controller-admission", Namespace: "nginx-ingress"'
2024/05/30 12:09:47 Retryable error? true
2024/05/30 12:09:47 Retrying as current number of retries 0 less than max number of retries 30
2024/05/30 12:09:48 context deadline exceeded
exit status 1
Actually this helm client wont install any helm charts. Moving on from nginx-ingress and trying to install cert-manager you get a very similar error:
2024/05/30 12:57:32 creating 1 resource(s)
2024/05/30 12:57:33 creating 39 resource(s)
2024/05/30 12:57:33 beginning wait for 39 resources with timeout of 0s
2024/05/30 12:57:33 Error received when checking status of resource cert-manager. Error: 'client rate limiter Wait returned an error: context deadline exceeded', Resource details: 'Resource: "/v1, Resource=services", GroupVersionKind: "/v1, Kind=Service"
Name: "cert-manager", Namespace: "cert-manager"'
2024/05/30 12:57:33 Retryable error? true
2024/05/30 12:57:33 Retrying as current number of retries 0 less than max number of retries 30
2024/05/30 12:57:34 context deadline exceeded
exit status 1
This is most unfortunate as now I need to go back to the drawing board and re-program my whole project. As this client was the basis of this project.
This needs fixing currently you cant deploy a single helm chart with this client.
I have the same Issue and started coding already and everything. How can this be still available?
It seems like the procedure is timing out, maybe because the timeout is set to zero. The chart spec has a Timeout property, and I would suggest setting it to something like 10 minutes.