Giter Club home page Giter Club logo

eks-s3-triggered-job-sample's Introduction

eks-s3-triggered-job-sample

Requirements

  • kubectl
  • eksctl
  • docker
  • awscli
  • aws-sam-cli
  • direnv

Setup

Set environments

  • AWS_PROFILE
  • OBJECT_SUFFIX
  • DEPLOYMENT_BUCKET
  • DATA_BUCKET
  • STACK_NAME
$EDITOR .envrc

Create deployment bucket

./01-create-deployment-bucket.sh

Create ECR for the job

./02-create-ecr.sh

Create cluster

./03-create-cluster.sh

Setup aws-lambda-layer-kubectl

./04-setup-aws-lambda-layer-kubectl.sh

Deploy SAM

./05-deploy-sam.sh

Login

./06-login.sh

Create ECR Secret

./07-create-ecr-secret.sh

Setup the docker image for the job

./08-setup-docker-image.sh

Create IAM Service Account

./09-create-iamserviceaccount.sh

Allow handler to use kubectl

kubectl edit configmap -n kube-system aws-auth

And add to mapRoles as follows

mapRoles:
  - groups:
      - system:masters
    rolearn: $HANDLER_ROLE_ARN
    username: handler

$HANDLER_ROLE_ARN is result of ./10-get-handler-role-arn.sh

Run the job

echo 'hi.' > tmp/sample.txt
aws s3 cp tmp/sample.txt s3://$(./11-get-bucket-name.sh)/sample.txt
kubectl get pods
kubectl logs job/job

eks-s3-triggered-job-sample's People

Contributors

tatat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.