Any one seen this error before: ```error: an unha...
# general
r
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
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
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
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
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
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
Scott is right - that's almost certainly what's wrong. You have to create an explicit provider and pass in the Kubeconfig.
r
I’ll have to get this locked into the design then! Thanks very much!
s
Happy to help! (And thanks for the extra confirmation, @stocky-restaurant-98004!)
139 Views