https://pulumi.com logo
#kubernetes
Title
# kubernetes
g

green-gigabyte-29081

05/02/2023, 4:30 PM
Hey, I'm using Pulumi to deploy an EKS cluster and install some Helm charts on it. Everything is working when I run Pulumi using the CLI on my laptop but since last week, Pulumi preview stopped working on Github actions with the following error: “kubernetes: helm.sh/v3:Release (helm-chart-name): error: could not get server version from Kubernetes: the server has asked for the client to provide credentials”. Any clues?
s

steep-toddler-94095

05/02/2023, 6:04 PM
could you double check your K8s provider and make sure it's not using outdated credentials
g

green-gigabyte-29081

05/02/2023, 6:07 PM
Thanks, already checked that. The k8s provider kubeconfig is ok, and i can run a preview from my local using the cli but from github actions fails
s

steep-toddler-94095

05/02/2023, 6:08 PM
does the github runner itself still have permissions to authenticate to the cluster? e.g. if you run a plain
kubectl get po
command from the runner does it succeed?
g

green-gigabyte-29081

05/02/2023, 6:15 PM
Yes, i can run that command and get the output
s

steep-toddler-94095

05/02/2023, 8:41 PM
can you share your provider configuration and helm code?
g

green-gigabyte-29081

05/02/2023, 10:14 PM
Copy code
kubeConfig, err := cluster.GetKubeconfig(ctx, &eks.ClusterGetKubeconfigArgs{
			ProfileName: pulumi.String(profileName),
		})
		if err != nil {
			return nil, err
		}

k8sProvider, err := kubernetes.NewProvider(ctx, clusterResName, &kubernetes.ProviderArgs{
			Kubeconfig: kubeConfig,
		})
		if err != nil {
			return nil, err
		}

_, err := helm.NewRelease(ctx, name, &helm.ReleaseArgs{
			Chart:     pulumi.String(chart.Name),
			Version:   pulumi.String(chart.Version),
			Namespace: pulumi.String(chart.Namespace),
			RepositoryOpts: helm.RepositoryOptsArgs{
				Repo: pulumi.String(chart.Repo),
			}
		}, pulumi.Provider(k8sProvider))
		if err != nil {
			return err
		}
I think it is something related to how aws profiles are managed, but not sure what the problem is yet
s

steep-toddler-94095

05/02/2023, 10:47 PM
if the kubeConfig specifies an AWS_PROFILE then your runner will need that same profile to be available. Or it will need to be excluded from the provider you created
g

green-gigabyte-29081

05/03/2023, 11:16 AM
yeah, I have a profile with the same name on github actions
164 Views