Hello all! Im very new to pulumi and I was hoping ...
# kubernetes
s
Hello all! Im very new to pulumi and I was hoping to leverage the kubernetes provider to interact with an existing eks cluster but I keep getting the following -
error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: Get "https://********************.<http://sk1.us-west-2.eks.amazonaws.com/openapi/v2?timeout=32s|sk1.us-west-2.eks.amazonaws.com/openapi/v2?timeout=32s>": getting credentials: exec: exit status 2
This is using typescript and the following guide - https://www.pulumi.com/docs/get-started/kubernetes/review-project/ Can pulumi not authenticate with the existing kubeconfig via an iam role?
b
yes it can! does
kubectl
currently work?
s
Yup
Could it be that its trying to authenticate using the default aws profile? To get the kubeconfig I have to use a different profile with an assume role.
b
does your kubeconfig have a reference to the AWS authentictor?
s
It doesnt..
Copy code
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: **********************=
    server: https://**************.<http://sk1.us-west-2.eks.amazonaws.com|sk1.us-west-2.eks.amazonaws.com>
  name: arn:aws:eks:us-west-2:******:cluster/dev-default-cluster
contexts:
- context:
    cluster: arn:aws:eks:us-west-2:******:cluster/dev-default-cluster
    user: arn:aws:eks:us-west-2:******:cluster/dev-default-cluster
  name: arn:aws:eks:us-west-2:******:cluster/dev-default-cluster
current-context: arn:aws:eks:us-west-2:******:cluster/dev-default-cluster
kind: Config
preferences: {}
users:
- name: arn:aws:eks:us-west-2:******:cluster/dev-default-cluster
  user:
    exec:
      apiVersion: <http://client.authentication.k8s.io/v1alpha1|client.authentication.k8s.io/v1alpha1>
      args:
      - --region
      - us-west-2
      - eks
      - get-token
      - --cluster-name
      - dev-default-cluster
      command: aws
      env:
      - name: AWS_PROFILE
        value: n-eks
I just ran
aws eks update-kubeconfig
to get the config
Thanks @billowy-army-68599 That was it. My kubeconfig was leveraging the
aws eks get-token
rather than
aws-iam-authenticator
b
Glad you got it fixed! Looking forward to hearing about your Pulumi experience!