Hey, I'm using Pulumi to deploy an EKS cluster and...
# kubernetes
g
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
could you double check your K8s provider and make sure it's not using outdated credentials
g
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
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
Yes, i can run that command and get the output
s
can you share your provider configuration and helm code?
g
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
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
yeah, I have a profile with the same name on github actions
221 Views