Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GitHub Actions, Flux, and Amazon EKS ✨

License

NotificationsYou must be signed in to change notification settings

github-developer/example-actions-flux-eks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An example workflow that usesGitHub Actions to builda static website into a Docker container, push that image to Amazon Elastic Container Registry, and usesFlux to automatically update an existing Amazon Elastic Kubernetes Service cluster with that image.

See thistechnical blog post which uses this code for full step-by-step instructions.

Prerequisites

  1. Create an EKS cluster, e.g. usingeksctl create cluster
  2. Set up Flux on the cluster, e.g. usingthis guide. Note that you must set--git-path to point to where your manifests are. For example:
export GHOWNER=<github user or organization account where your fork lives>export GHREPO=example-actions-flux-ekskubectl create ns fluxfluxctl install \    --git-user=${GHUSER} \    --git-email=${GHUSER}@users.noreply.github.com \    --git-url=git@github.com:${GHOWNER}/${GHREPO} \    --git-path=manifests \    --namespace=flux| kubectl apply -f -
  1. Give Flux read/write access to the GitHub repositoryusing a deploy key
  2. Create a repository calledexample-eks inAmazon Elastic Container Registry, in the same AWS region as the EKS cluster
  3. Update the image indeployment.yml to use yourREGISTRY,IMAGE, andTAG.TAG will be replaced by Flux as new images are available in the registry.

Secrets

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

  1. AWS_ACCOUNT_ID: The AWS account ID that owns the EKS cluster
  2. AWS_ACCESS_KEY_ID: An AWS access key ID for an account having theEKS IAM role
  3. AWS_SECRET_ACCESS_KEY: An AWS secret sccess key for an account having theEKS IAM role

Workflow

Theexample workflow will trigger on every push to this repo.

Forpull requests, the workflow will:

  1. Build and tagthe Docker image
    • The image will be tagged with the feature branch's HEAD commit SHA

Forpushes to the default branch (master), in addition to the above, the workflow will:

  1. Push the image to Amazon Elastic Container Registry

Beyond the workflow

Flux watches ECR for changes to the image listed in ourdeployment configuration. When it detects a change, it updates the EKS cluster with the new image, no manualkubectl apply needed!

Contributions

We welcome contributions! Seehow to contribute.

License

MIT

About

GitHub Actions, Flux, and Amazon EKS ✨

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp