Sign inSign up

samcre/drone-eks

By samcre

•Updated about 7 years ago

A Drone plugin to deploy on an AWS EKS cluster

Image
0

816

samcre/drone-eks repository overview

⁠Drone EKS plugin

Drone plugin to get credentials and deploy to an EKS cluster.

⁠Usage

Resource should exist before this plugin can be executed. Works better if the pipeline is executed on an EC2 instance with an instance role that have permissions.

kind: pipeline
name: default

steps:
- name: deploy_to_eks
  image: samcre/drone-eks
  settings:
    eks_cluster: ${EKS_CLUSTER_NAME}
    name: ${RESOURCE_NAME}
    image_tag: ${IMAGE_TAG_NAME}
    container: ${CONTAINER_NAME}
    access_key: ${AWS_ACCESS_KEY_ID}  # Optional
    secret_key: ${AWS_SECRET_ACCESS_KEY}  # Optional
    namespace: ${K8S_NAMESPACE}  # Optional, default to "default"
    aws_region: ${AWS_REGION}  # Optional, default to "us-east-2"
    kind: ${K8S_RESOURCE_TYPE}  # Optional, default to "deployment"
    iam_role: ${AWS_IAM_ROLE}  # Optional, default to ""

⁠IAM permissions

Since the plugin gets the KUBECONFIG from aws-cli, proper IAM permissions are necessary to download. Here is a simple IAM policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowEKSAccess",
            "Effect": "Allow",
            "Action": "eks:DescribeCluster",
            "Resource": [
                "arn:aws:eks:eu-west-1:820102917197:cluster/${CLUSTER_NAME}"
            ]
        }
    ]
}

Besides, you need to link aws-auth⁠ to a RBAC policy that allows proper permissions to update needed resources.

Tag summary

Content type

Image

Digest

Size

44.6 MB

Last updated

about 7 years ago

docker pull samcre/drone-eks