How to include AWS EKS with CI/CD? How to include AWS EKS with CI/CD? kubernetes kubernetes

How to include AWS EKS with CI/CD?


Gitab provides the inbuilt integration of EKS and deployment with the help of Helm charts. If you plan to use other tools Using AWS lambda to update the image is the best bet!

I've added my github project.

Setup a lambda with below code and give RBAC access to this lambda in your EKS. Try invoking the lambda by passing the required information like namespace, deployment, image etc

Lambda for Kubernetes image update

The lambda must require EKS:describecluster policy.

The Lambda role must be provided atleast update image RBAC role in EKS clusterRBAC role setup


Since there's no built-in CI/CD for EKS at the moment, this is going to be a showcase of success/failure stories of a 3rd-party CI/CDs in EKS :) My take: https://github.com/fluxcd/flux

Pros:

  • Quick to set up initially (until you get into multiple teams/environments)
  • Tracks and deploys image releases out of box
  • Possibility to split what to auto-deploy in dev/prod using regex. E.g. all versions to dev, only minor to prod. Or separate tag prefixes for dev/prod.
  • All state is in git - a good practice to start with

Cons:

  • Getting complex for further pipeline expansion, e.g. blue-green, canary, auto-rollbacks, etc.
  • The dashboard is proprietary (weave works product)
  • Not for on-demand parametrized job runs like traditional CIs.

Setup:

  • Setup an automated image build (looks like you've already figured out)
  • Setup flux and helm-operator into the cluster, point them to your "gitops repo"
  • For each app, create a HelmRelease object that describes a regex of image tag to track

Done. A newly published image tag that falls into regex will be auto-deployed to the cluster and the new version is committed to a gitops repo.