Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: the server doesn't have resource type "svc"

Tags:

kubernetes

Admins-MacBook-Pro:~ Harshin$ kubectl cluster-info Kubernetes master is running at http://localhost:8080

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. error: the server doesn't have a resource type "services"

i am following this document

https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html?refid=gs_card

while i am trying to test my configuration in step 11 of configure kubectl for amazon eks

apiVersion: v1
clusters:
- cluster:
    server: ...
    certificate-authority-data: ....
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: aws
  name: aws
current-context: aws
kind: Config
preferences: {}
users:
- name: aws
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      command: heptio-authenticator-aws
      args:
        - "token"
        - "-i"
        - "kunjeti"
        # - "-r"
        # - "<role-arn>"
      # env:
        # - name: AWS_PROFILE
        #   value: "<aws-profile>"
like image 952
Harshin_ Avatar asked Jul 02 '18 12:07

Harshin_


1 Answers

I have faced a similar issue, however this is not a direct solution but workaround. Use AWS cli commands to create cluster rather than console. As per documentation, the user or role which creates cluster will have master access.

aws eks create-cluster --name <cluster name> --role-arn <EKS Service Role> --resources-vpc-config subnetIds=<subnet ids>,securityGroupIds=<security group id>

Make sure that EKS Service Role has IAM access(I have given Full however AssumeRole will do I guess).

The EC2 machine Role should have eks:CreateCluster and IAM access. Worked for me :)

like image 68
Kailas J C Avatar answered Sep 22 '22 22:09

Kailas J C