https://pulumi.com logo
#general
Title
# general
r

refined-pilot-45584

07/17/2023, 4:49 PM
Any one seen this error before:
Copy code
error: an unhandled error occurred: program failed:
    waiting for RPCs: failed to invoke helm template: rpc error: code = Unknown desc = invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: could not get server version from Kubernetes: Get "<https://34.65.53.155/version?timeout=32s>": dial tcp 34.65.53.155:443: connect: connection timed out
I am not sure if this is just a Rookie Mistake but I am trying to Apply a Helm chart to a GKE Cluster that is created in the Same Stack; The dependancies are there in place and the Charts are Local. But I don’t know why I am getting the issue?
s

salmon-account-74572

07/17/2023, 4:51 PM
The error message seems to indicate that it’s unable to communicate with the Kubernetes API endpoint for some reason. Is that the correct endpoint? Is the appropriate traffic being allowed to that endpoint?
r

refined-pilot-45584

07/17/2023, 4:56 PM
Well here is the thing. It’s on a Pulumi up of a completely new deployment… so no endpoint exists yet. The same plan should create the Kubernetes Cluster and the endpoint… therefore I can only assume that endpoint is an old kubeconfig on my local machine. Is there a way to do this without thenkuneconfig needed till after the cluster is build and kubeconfig created?
s

salmon-account-74572

07/17/2023, 4:59 PM
Hmmm…if you create a new Kubernetes provider using the Kubeconfig generated by the cluster creation, then Pulumi should understand the dependency and not try to deploy the Helm chart until after the cluster is created.
r

refined-pilot-45584

07/17/2023, 5:00 PM
Yeah I might have to create an explicit Kubernetes config.
I’m currently not doing that and I assume it’s just defaulting to local.
s

salmon-account-74572

07/17/2023, 5:02 PM
In TS, that would look something like this:
Copy code
import * as k8s from "@pulumi/kubernetes";
const k8sProvider = new k8s.Provider("new-k8s-provider", {kubeconfig: cluster-config});
And then you’d reference
k8sProvider
when you define the Kubernetes/Helm objects. And yes, if you aren’t creating an explicit provider, then it’s using the default provider, which in turn is using your local configuration to determine endpoint and such.
s

stocky-restaurant-98004

07/17/2023, 5:19 PM
Scott is right - that's almost certainly what's wrong. You have to create an explicit provider and pass in the Kubeconfig.
r

refined-pilot-45584

07/17/2023, 7:07 PM
I’ll have to get this locked into the design then! Thanks very much!
s

salmon-account-74572

07/17/2023, 7:21 PM
Happy to help! (And thanks for the extra confirmation, @stocky-restaurant-98004!)
52 Views