Skip to content

gumlet/aws-eks-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

setup-aws-eks

build-test

Use this action to connect to an AWS EKS cluster from a GitHub Actions workflow.

This action will create or update the .kube/config file, configuring Kubernetes clients (including the kubectl CLI) to connect to your EKS cluster. It uses the update-kubeconfig command provided by the AWS CLI.

Usage

See action.yml.

- uses: gumlet/aws-eks-action@v1.0
  with:
    # Name of the EKS cluster you want to access (required)
    cluster: ''

    # Name of the Kubernetes config context to create (default: EKS cluster name)
    context: ''

    # ARN of an IAM role to assign to cluster authentication
    role: ''

    # If 'true', the action will run use-context for the cluster's new context
    activate: 'false'

Example

- name: Configure AWS Credentials
  uses: aws-actions/configure-aws-credentials@v2
  with:
    role-to-assume: arn:aws:iam::123456789100:role/my-github-actions-role
    aws-region: us-east-2

- name: Configure Kubernetes client
  uses: gumlet/aws-eks-action@v1.0
  with:
    cluster: my-cluster-name

- name: Deploy service
  run: |
    kubectl apply -f ./deployment.yml
    kubectl rollout status -f ./deployment.yml --timeout=15m

Outputs

  • context – The name of the Kubernetes context created
  • cluster_name – The EKS cluster name for which access was configured
  • cluster_arn – The ARN of the EKS cluster
  • cluster_status – The observed status of the EKS cluster
  • cluster_endpoint – The https:// origin of the cluster's API server
  • cluster_tags – The AWS tags applied to the EKS cluster, as a JSON object
  • kubernetes_version – The Kubernetes version of the cluster, e.g., 1.24

About

Update .kube/config in a GitHub Action to connect to an AWS EKS Kubernetes cluster

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%