Drone

Drone unable to execute kubectl commands on eks

Hi, I’m using drone latest . while executing kubectl commands with drone iam getting below error.

1 + kubectl get all
2 User “default” set.
3 Cluster “default” set.
4 Context “default” created.
5 Switched to context “default”.
6 Error from server (Forbidden): pods is forbidden: User “system:serviceaccount:default:default” cannot list resource “pods” in API group “” in the namespace “default”
7 Error from server (Forbidden): replicationcontrollers is forbidden: User “system:serviceaccount:default:default” cannot list resource “replicationcontrollers” in API group “” in the namespace “default”
8 Error from server (Forbidden): services is forbidden: User “system:serviceaccount:default:default” cannot list resource “services” in API group “” in the namespace “default”
9 Error from server (Forbidden): daemonsets.apps is forbidden: User “system:serviceaccount:default:default” cannot list resource “daemonsets” in API group “apps” in the namespace “default”
10 Error from server (Forbidden): deployments.apps is forbidden: User “system:serviceaccount:default:default” cannot list resource “deployments” in API group “apps” in the namespace “default”
11 Error from server (Forbidden): replicasets.apps is forbidden: User “system:serviceaccount:default:default” cannot list resource “replicasets” in API group “apps” in the namespace “default”
12 Error from server (Forbidden): statefulsets.apps is forbidden: User “system:serviceaccount:default:default” cannot list resource “statefulsets” in API group “apps” in the namespace “default”
13 Error from server (Forbidden): horizontalpodautoscalers.autoscaling is forbidden: User “system:serviceaccount:default:default” cannot list resource “horizontalpodautoscalers” in API group “autoscaling” in the namespace “default”
14 Error from server (Forbidden): jobs.batch is forbidden: User “system:serviceaccount:default:default” cannot list resource “jobs” in API group “batch” in the namespace “default”
15 Error from server (Forbidden): cronjobs.batch is forbidden: User “system:serviceaccount:default:default” cannot list resource “cronjobs” in API group “batch” in the namespace “default”

###my .drone.yml file is like this

kind: pipeline
name: deploy

steps:

  • name: deploy
    image: sinlead/drone-kubectl
    settings:
    kubernetes_server:
    from_secret: k8s_server
    kubernetes_cert:
    from_secret: k8s_cert
    kubernetes_token:
    from_secret: k8s_token
    commands:
    • kubectl get all
    • kubectl get nodes

how to overcome from this problem,please help