glamorous-holiday-93698
07/17/2024, 2:41 PMDiagnostics:
pulumi:pulumi:Stack (infra-eks-utils-dev):
warning: unable to determine cluster's API version: could not get server version from Kubernetes: Get "<https://2A1746CBAF4ADCE5D31BDD78F5115A64.gr7.eu-central-1.eks.amazonaws.com/version?timeout=32s>": getting credentials: exec: executable aws-iam-authenticator not found
It looks like you are trying to use a client-go credential plugin that is not installed.
To learn more about this feature, consult the documentation available at:
<https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins>
glamorous-holiday-93698
07/17/2024, 2:42 PMcluster = aws.eks.Cluster.get('eks_cluster', cluster_id)
# Create the Kubernetes provider with the kubeconfig
kubeconfig = pulumi.Output.all(cluster.endpoint, cluster.certificate_authority, cluster.name).apply(
lambda args: f"""
apiVersion: v1
clusters:
- cluster:
server: {args[0]}
certificate-authority-data: {args[1]['data']}
name: kubernetes
contexts:
- context:
cluster: kubernetes
user: aws
name: aws
current-context: aws
kind: Config
preferences: {{}}
users:
- name: aws
user:
exec:
apiVersion: <http://client.authentication.k8s.io/v1beta1|client.authentication.k8s.io/v1beta1>
command: aws-iam-authenticator
args:
- "token"
- "-i"
- {args[2]}
"""
)
k8s_provider = k8s.Provider("k8s-provider", kubeconfig=kubeconfig)
glamorous-holiday-93698
07/17/2024, 2:43 PMglamorous-holiday-93698
07/17/2024, 2:43 PMglamorous-holiday-93698
07/17/2024, 2:49 PMbrew install aws-iam-authenticator
OKquick-house-41860
07/17/2024, 4:05 PMaws eks update-kubeconfig --region REGION [--profile PROFILE_IF_YOU_USE_ONE] --name CLUSTER_NAME
.
That should create the kube config for youglamorous-holiday-93698
07/17/2024, 4:06 PMglamorous-holiday-93698
07/17/2024, 4:06 PMglamorous-holiday-93698
07/17/2024, 4:06 PMquick-house-41860
07/17/2024, 4:10 PMaws eks get-token
under the hood).
You can have a look here how we're creating the kubeconfig in the pulumi-eks provider: https://github.com/pulumi/pulumi-eks/blob/986c528a058381be989c382d38a2e74238c9502b/nodejs/eks/cluster.ts#L207
Alternatively you could start using the pulumi-eks provider directly because it generates the kubeconfig for you 🙂glamorous-holiday-93698
07/17/2024, 4:12 PMglamorous-holiday-93698
07/17/2024, 4:14 PMquick-house-41860
07/17/2024, 4:17 PMglamorous-holiday-93698
07/17/2024, 4:18 PMglamorous-holiday-93698
07/17/2024, 4:19 PMglamorous-holiday-93698
07/17/2024, 4:20 PM