Skip to content

github-developer/example-actions-eks-fargate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example GitHub Actions workflow to deploy to Amazon EKS on Fargate

An example workflow that uses GitHub Actions to build a static website into a container image tagged with the git sha, push that image to Amazon Elastic Container Registry, and deploy to Amazon EKS on using a simple Kubernetes Deployment and Service yaml with the image tag injected by Kustomize. An Ingress will create the needed ALB.

Setup flow

  1. Fork this repo.
  2. Create an EKS on Fargate cluster using the setup script: bash eks-fargate-setup.sh
  3. Create an ECR repo called example-eks
  4. On the Actions tab, enable GitHub Actions for the forked repo.
  5. Setup up the secrets and env vars mentioned below.

Secrets

The following secrets are required to be set on the repository:

  1. AWS_ACCESS_KEY_ID: An AWS access key ID for an account having the EKS IAM role
  2. AWS_SECRET_ACCESS_KEY: An AWS secret sccess key for an account having the EKS IAM role

Env vars

The following environment variables need to be set in the workflow:

  1. AWS_REGION: (e.g. eu-west-1)
  2. EKS_CLUSTER_NAME: (e.g. fantastic-party-9999999999)

You can optionally change the name of the ECR repo mentioned above in prereqs.

   - name: Build, tag, and push image to Amazon ECR
      id: build-image
      env:
        ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
        ECR_REPOSITORY: example-eks
        IMAGE_TAG: ${{ github.sha }}

Contributions

We welcome contributions! See how to contribute.

License

MIT

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published