SlideShare a Scribd company logo
Building a Kubernetes App with
Amazon EKS
Laura Frank Tacho
Director of Engineering, CloudBees
@rhein_wein
We’ll Cover:
• What Amazon EKS is, and how it differs from other Kubernetes
offerings
• Requirements for running an EKS cluster
• Automating app deployment to EKS with CodeShip, a CI/CD tool
• CI/CD best practices
EKS is a managed
Kubernetes offering
from AWS
CloudBees CodeShip is a
customizable CI/CD engine
designed with containerized
applications in mind
Kubernetes provides a shared standard for declaring application
configuration, making your containerized apps portable.
Local Environments
Minikube
Docker for Mac
Docker for Windows
play-with-k8s.com
Managed Kubernetes platforms
offered by cloud providers
GKE, AKS, EKS
Cloud agnostic* managed Kubernetes
Rancher Kubernetes Engine
Docker Enterprise Edition
Joyent Triton
RedHat OpenShift
CoreOS Tectonic (now part of RedHat)
landscape.cncf.io
Managed, not magic
AWS docs are great, but not everything is done
for you
Prerequisites:
- Basic understanding of IAM
- Able to use provided templates with
CloudFormation
- Understanding of EC2 resource types
AWS CLI skills not necessary, but helpful
Basic understanding of kubectl is necessary
An Even Quicker Quickstart Guide
Create your Amazon EKS service role in the IAM console
Create a VPC to use with your cluster. You can use a provided CloudFormation
template for this. Note that EKS is only available in us-west-2 and us-east-1.
Install kubectl and aws-iam-authenticator for local access
Create your EKS cluster either via the GUI or the CLI
Configure access to your cluster locally
Launch worker nodes via CloudFormation
1
2
3
4
5
6
EKS + Terraform
You can stand up your cluster using Terraform
Guide is available at
https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html
Building a Kubernetes App with Amazon EKS
Sample App: Cats vs Dogs
vote result
worker dbredis
worker
.NET
vote
python
redis
redis
db
postgres
result
node-js
Service Architecture
worker
.NET
vote
python
redis
redis
db
postgres
result
node-js
Use from DockerHub
Test, create, and push images with CodeShip, then deploy to EKS cluster
you must set up a storage
class to use persistent
volume claims; they are not
configured automatically
with EKS
Switching Between Local Dev and EKS
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
aws kubernetes aws
$ echo $KUBECONFIG
/Users/laura/.kube/config-demo
$ export KUBECONFIG=$KUBECONFIG:/Users/laura/.kube/config-docker4mac
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* aws kubernetes aws
docker-for-desktop docker-for-desktop-cluster docker-for-desktop
see all available contexts
add another config file to KUBECONFIG path
new context has been added
...Or Just Update KUBECONFIG
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
aws kubernetes aws
$ echo $KUBECONFIG
/Users/laura/.kube/config-demo
$ export KUBECONFIG=/Users/laura/.kube/config-docker4mac
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
docker-for-desktop docker-for-desktop-cluster docker-for-desktop
see all available contexts
update KUBECONFIG to only see one config file
only one context!
Building a Kubernetes App with Amazon EKS
1. Make a change locally
2. Run tests locally
3. Push to GitHub & trigger a build on CodeShip
4. Build the updated images
5. Run tests against new code
6. Push new images to registry (Docker Hub)
7. Green build? Merge to master!
8. Use CodeShip to trigger a deployment on EKS
9. Finally see our changes in prod!
Updating our Application
1. Make a change locally
2. Run tests locally
3. Push to GitHub & trigger a build on CodeShip
4. Build the updated images
5. Run tests against new code
6. Push new images to registry (Docker Hub)
7. Green build? Merge to master!
8. Use CodeShip to trigger a deployment on EKS
9. Finally see our changes in prod!
Updating our Application
Automate with CodeShip
Accessing your EKS Cluster from CodeShip
Prerequisites
- AWS account and credentials
- kubectl installed and configured locally
- The Jet CLI installed locally (bit.ly/codeship-jet-tool)
AWS access keys + kubeconfig allow you to access your EKS cluster from a CodeShip build.
EKS uses IAM credentials to authenticate to your cluster.
The aws-iam-authenticator was previously called heptio-authenticator-aws
Accessing your EKS Cluster from CodeShip
Set up access to your cluster as described in the AWS EKS docs. Then flatten your kubeconfig and
add it to your environment file. Use the Jet CLI and your project’s AES key to encrypt the env file.
AWS_ACCESS_KEY_ID=your_access_key_id
AWS_SECRET_ACCESS_KEY=your_secret_access_key
eks-env
kubectl config current-context #make sure it’s aws
kubectl config view --minify --flatten > kubeconfigdata
docker run --rm -it -v $(pwd):/files codeship/env-var-helper cp 
kubeconfigdata:/root/.kube/config k8s-env
cat k8s-env >> eks-env
jet encrypt eks-env eks-env.encrypted
rm kubeconfigdata k8s-env eks-env #or add them to your .gitignore
Accessing your EKS Cluster from CodeShip
[...]
kubectl:
image: codeship/eks-kubectl
encrypted_env_file: eks-env.encrypted
volumes:
- ./deploy:/deploy
[...]
- name: eks_deployment
service: kubectl
tag: master
command: ./deploy/eks-deployment.sh
codeship-services.yml codeship-steps.yml
This image has AWS-vendored kubectl,
aws-iam-authenticator, and a helper script to pull the
kubeconfig out of the encrypted environment variable
and put it into /.kube/kubeconfig.
This step is only run on builds from the master branch,
and will run the EKS deploy script that is mounted into
the container.
Deploying to EKS
CodeShip Build
EKS Cluster
magic?
Deploying to EKS
Managed, not magic
EKS is concerned with infrastructure, and doesn’t replace existing deployment patterns
You still need to:
1. Package your application code in container images
2. Push the images to a registry for distribution
3. Issue commands to update your cluster
4. Deal with extra requirements like storage classes, etc
Good news: using EKS doesn’t lock you in to ECR (AWS’s image registry), though it may be slightly easier to use
because of shared credentials and roles
Deploying to EKS
- type: push
service: worker
name: push_worker_image
image_name: rheinwein/examplevotingapp-worker
image_tag: "{{.CommitID}}"
Build images with CodeShip and push to a registry
using CodeShip’s push step type.
codeship-steps.yml
Best Practice for Containerized Apps
Tag your images with versions or the commit SHA. Avoid pulling images using the latest tag.
- name: eks_deployment
service: kubectl
tag: master
command: ./deploy/eks-deployment.sh
codeship-steps.yml
Use a deploy script to issue update commands
against your EKS cluster.
1 2
Deploying to EKS
CodeShip Build
EKS Cluster
magic?
Deploying to EKS
Image
Registry
EKS Cluster
CodeShip Build
GitHub
check out source code
report testing & build status
push images
build & tag images
issue update/deployment commands
pull images
Monitoring,
Observing,
Alerting
Building a Kubernetes App with Amazon EKS
CI/CD Tips and Best Practices
Healthchecks
A running container only
means that the process is
running, not that the service
is available. CodeShip
respects the HEALTHCHECK
attribute of services, and will
wait until the service is
available before trying to use
it in a build.
Encryption
CodeShip provides each
project with an AES key to
encrypt secrets. Using the
CodeShip CLI jet, you can
encrypt and decrypt
environment variables.
Manual Approval
Want an extra set of eyes on
changes before they’re
deployed, or want to restrict
deployments to certain
groups of people? With
manual steps, you have more
control over your CD process.
Sign up for CodeShip
https://codeship.com
AWS EKS Getting Started Guide
https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html
Download a local Kubernetes environment with Docker for Mac or Windows
https://www.docker.com/products/docker-desktop
Example-voting-app source code
https://github.com/rheinwein/example-voting-app
Download Deploying to Kubernetes Codeship eBook
https://resources.codeship.com/ebook/deploy-docker-kubernetes-codeship
Useful Links
Interested in learning more about DevOps best practices and use cases?
Join us for Jenkins World | DevOps World
San Francisco, California
September 16-19, 2018
Nice, France
October 22-25, 2018
Get 20% off with code JWLTACHO
Thank you!
Slides: bit.ly/eks-codeship

More Related Content

PPTX
Kubernetes Security
PDF
Kubernetes for Beginners
PDF
Terraform + ansible talk
PPTX
Airflow Clustering and High Availability
PPTX
Kubernetes and container security
PDF
Introduction to Docker Containers - Docker Captain
PPTX
Terraform
PDF
Getting Started with Apache Spark on Kubernetes
Kubernetes Security
Kubernetes for Beginners
Terraform + ansible talk
Airflow Clustering and High Availability
Kubernetes and container security
Introduction to Docker Containers - Docker Captain
Terraform
Getting Started with Apache Spark on Kubernetes

What's hot (20)

PDF
Top 5 mistakes when writing Spark applications
PPTX
Microservices Network Architecture 101
PDF
Elastic Kubernetes Services (EKS)
PDF
Kubernetes Networking
PDF
ArgoCD 的雷 碰過的人就知道 @TSMC IT Community Meetup #4
PDF
An Introduction to Kubernetes
PDF
DockerとKubernetesをかけめぐる
PDF
Terraform -- Infrastructure as Code
PDF
Seldon: Deploying Models at Scale
PPTX
Securing and Automating Kubernetes with Kyverno
PDF
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
PPTX
CI/CD for React Native
PDF
Making Structured Streaming Ready for Production
PDF
User authentication and authorizarion in Kubernetes
PDF
Efficient Kubernetes scaling using Karpenter
PPTX
Jenkins, pipeline and docker
PDF
Introduction to Kubernetes and Google Container Engine (GKE)
PPTX
Kubernetes Basics
PDF
Hardening Kubernetes by Securing Pods
PPTX
Room 2 - 4 - Juncheng Anthony Lin - Redhat - A Practical Approach to Traditio...
Top 5 mistakes when writing Spark applications
Microservices Network Architecture 101
Elastic Kubernetes Services (EKS)
Kubernetes Networking
ArgoCD 的雷 碰過的人就知道 @TSMC IT Community Meetup #4
An Introduction to Kubernetes
DockerとKubernetesをかけめぐる
Terraform -- Infrastructure as Code
Seldon: Deploying Models at Scale
Securing and Automating Kubernetes with Kyverno
ClickHouse Unleashed 2020: Our Favorite New Features for Your Analytical Appl...
CI/CD for React Native
Making Structured Streaming Ready for Production
User authentication and authorizarion in Kubernetes
Efficient Kubernetes scaling using Karpenter
Jenkins, pipeline and docker
Introduction to Kubernetes and Google Container Engine (GKE)
Kubernetes Basics
Hardening Kubernetes by Securing Pods
Room 2 - 4 - Juncheng Anthony Lin - Redhat - A Practical Approach to Traditio...
Ad

Similar to Building a Kubernetes App with Amazon EKS (20)

PDF
What Is AWS Elastic Kubernetes Service
PDF
Amazon EKS - Aws community day bengaluru 2019
PPTX
AWS SSA Webinar 15 - Getting started on AWS with Containers: Amazon EKS
PDF
EKS Workshop
PDF
게임 고객사를 위한 ‘AWS 컨테이너 교육’ 자료 - 유재석 솔루션즈 아키텍트, AWS :: Gaming Immersion Day 201...
PPTX
Shipping apps to eks with code pipeline and lambda functions
PPTX
Introduction_to_Amazon_EKS, How to use Introduction
PPTX
Kubernetes security with AWS
PPTX
AWS-Fargate-and-AWS-EKS-Masterclass-V7.pptx
PPTX
before-v7-AWS-Fargate-and-EKS-Masterclass.pptx
PDF
AWS Community Day - Andrew May - Running Containers in AWS
PDF
Introduction to EKS (AWS User Group Slovakia)
PDF
Container orchestration k8s azure kubernetes services
PPTX
K8s in 3h - Kubernetes Fundamentals Training
PPTX
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
PDF
Dockerized .Net Core based app services in azure K8s
PPTX
EKS AWS Presentation kuberneted oriented
PDF
Amazon Elastic Kubernetes Service (EKS) From Zero to Day 1
PDF
Introduction to EKS and eksctl
PPTX
Eks and fargate
What Is AWS Elastic Kubernetes Service
Amazon EKS - Aws community day bengaluru 2019
AWS SSA Webinar 15 - Getting started on AWS with Containers: Amazon EKS
EKS Workshop
게임 고객사를 위한 ‘AWS 컨테이너 교육’ 자료 - 유재석 솔루션즈 아키텍트, AWS :: Gaming Immersion Day 201...
Shipping apps to eks with code pipeline and lambda functions
Introduction_to_Amazon_EKS, How to use Introduction
Kubernetes security with AWS
AWS-Fargate-and-AWS-EKS-Masterclass-V7.pptx
before-v7-AWS-Fargate-and-EKS-Masterclass.pptx
AWS Community Day - Andrew May - Running Containers in AWS
Introduction to EKS (AWS User Group Slovakia)
Container orchestration k8s azure kubernetes services
K8s in 3h - Kubernetes Fundamentals Training
Amazon Elastic Container Service for Kubernetes (Amazon EKS) I AWS Dev Day 2018
Dockerized .Net Core based app services in azure K8s
EKS AWS Presentation kuberneted oriented
Amazon Elastic Kubernetes Service (EKS) From Zero to Day 1
Introduction to EKS and eksctl
Eks and fargate
Ad

More from DevOps.com (20)

PDF
Modernizing on IBM Z Made Easier With Open Source Software
PPTX
Comparing Microsoft SQL Server 2019 Performance Across Various Kubernetes Pla...
PPTX
Comparing Microsoft SQL Server 2019 Performance Across Various Kubernetes Pla...
PDF
Next Generation Vulnerability Assessment Using Datadog and Snyk
PPTX
Vulnerability Discovery in the Cloud
PDF
2021 Open Source Governance: Top Ten Trends and Predictions
PDF
A New Year’s Ransomware Resolution
PPTX
Getting Started with Runtime Security on Azure Kubernetes Service (AKS)
PDF
Don't Panic! Effective Incident Response
PDF
Creating a Culture of Chaos: Chaos Engineering Is Not Just Tools, It's Culture
PDF
Role Based Access Controls (RBAC) for SSH and Kubernetes Access with Teleport
PDF
Monitoring Serverless Applications with Datadog
PDF
Deliver your App Anywhere … Publicly or Privately
PPTX
Securing medical apps in the age of covid final
PDF
How to Build a Healthy On-Call Culture
PPTX
The Evolving Role of the Developer in 2021
PDF
Service Mesh: Two Big Words But Do You Need It?
PPTX
Secure Data Sharing in OpenShift Environments
PPTX
How to Govern Identities and Access in Cloud Infrastructure: AppsFlyer Case S...
PDF
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
Modernizing on IBM Z Made Easier With Open Source Software
Comparing Microsoft SQL Server 2019 Performance Across Various Kubernetes Pla...
Comparing Microsoft SQL Server 2019 Performance Across Various Kubernetes Pla...
Next Generation Vulnerability Assessment Using Datadog and Snyk
Vulnerability Discovery in the Cloud
2021 Open Source Governance: Top Ten Trends and Predictions
A New Year’s Ransomware Resolution
Getting Started with Runtime Security on Azure Kubernetes Service (AKS)
Don't Panic! Effective Incident Response
Creating a Culture of Chaos: Chaos Engineering Is Not Just Tools, It's Culture
Role Based Access Controls (RBAC) for SSH and Kubernetes Access with Teleport
Monitoring Serverless Applications with Datadog
Deliver your App Anywhere … Publicly or Privately
Securing medical apps in the age of covid final
How to Build a Healthy On-Call Culture
The Evolving Role of the Developer in 2021
Service Mesh: Two Big Words But Do You Need It?
Secure Data Sharing in OpenShift Environments
How to Govern Identities and Access in Cloud Infrastructure: AppsFlyer Case S...
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
cuic standard and advanced reporting.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
“AI and Expert System Decision Support & Business Intelligence Systems”
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
cuic standard and advanced reporting.pdf
Understanding_Digital_Forensics_Presentation.pptx
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Machine learning based COVID-19 study performance prediction
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
MYSQL Presentation for SQL database connectivity

Building a Kubernetes App with Amazon EKS

  • 1. Building a Kubernetes App with Amazon EKS Laura Frank Tacho Director of Engineering, CloudBees @rhein_wein
  • 2. We’ll Cover: • What Amazon EKS is, and how it differs from other Kubernetes offerings • Requirements for running an EKS cluster • Automating app deployment to EKS with CodeShip, a CI/CD tool • CI/CD best practices
  • 3. EKS is a managed Kubernetes offering from AWS CloudBees CodeShip is a customizable CI/CD engine designed with containerized applications in mind
  • 4. Kubernetes provides a shared standard for declaring application configuration, making your containerized apps portable. Local Environments Minikube Docker for Mac Docker for Windows play-with-k8s.com Managed Kubernetes platforms offered by cloud providers GKE, AKS, EKS Cloud agnostic* managed Kubernetes Rancher Kubernetes Engine Docker Enterprise Edition Joyent Triton RedHat OpenShift CoreOS Tectonic (now part of RedHat)
  • 6. Managed, not magic AWS docs are great, but not everything is done for you Prerequisites: - Basic understanding of IAM - Able to use provided templates with CloudFormation - Understanding of EC2 resource types AWS CLI skills not necessary, but helpful Basic understanding of kubectl is necessary
  • 7. An Even Quicker Quickstart Guide Create your Amazon EKS service role in the IAM console Create a VPC to use with your cluster. You can use a provided CloudFormation template for this. Note that EKS is only available in us-west-2 and us-east-1. Install kubectl and aws-iam-authenticator for local access Create your EKS cluster either via the GUI or the CLI Configure access to your cluster locally Launch worker nodes via CloudFormation 1 2 3 4 5 6
  • 8. EKS + Terraform You can stand up your cluster using Terraform Guide is available at https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html
  • 10. Sample App: Cats vs Dogs vote result worker dbredis
  • 12. worker .NET vote python redis redis db postgres result node-js Use from DockerHub Test, create, and push images with CodeShip, then deploy to EKS cluster you must set up a storage class to use persistent volume claims; they are not configured automatically with EKS
  • 13. Switching Between Local Dev and EKS $ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE aws kubernetes aws $ echo $KUBECONFIG /Users/laura/.kube/config-demo $ export KUBECONFIG=$KUBECONFIG:/Users/laura/.kube/config-docker4mac $ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE * aws kubernetes aws docker-for-desktop docker-for-desktop-cluster docker-for-desktop see all available contexts add another config file to KUBECONFIG path new context has been added
  • 14. ...Or Just Update KUBECONFIG $ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE aws kubernetes aws $ echo $KUBECONFIG /Users/laura/.kube/config-demo $ export KUBECONFIG=/Users/laura/.kube/config-docker4mac $ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE docker-for-desktop docker-for-desktop-cluster docker-for-desktop see all available contexts update KUBECONFIG to only see one config file only one context!
  • 16. 1. Make a change locally 2. Run tests locally 3. Push to GitHub & trigger a build on CodeShip 4. Build the updated images 5. Run tests against new code 6. Push new images to registry (Docker Hub) 7. Green build? Merge to master! 8. Use CodeShip to trigger a deployment on EKS 9. Finally see our changes in prod! Updating our Application
  • 17. 1. Make a change locally 2. Run tests locally 3. Push to GitHub & trigger a build on CodeShip 4. Build the updated images 5. Run tests against new code 6. Push new images to registry (Docker Hub) 7. Green build? Merge to master! 8. Use CodeShip to trigger a deployment on EKS 9. Finally see our changes in prod! Updating our Application Automate with CodeShip
  • 18. Accessing your EKS Cluster from CodeShip Prerequisites - AWS account and credentials - kubectl installed and configured locally - The Jet CLI installed locally (bit.ly/codeship-jet-tool) AWS access keys + kubeconfig allow you to access your EKS cluster from a CodeShip build. EKS uses IAM credentials to authenticate to your cluster. The aws-iam-authenticator was previously called heptio-authenticator-aws
  • 19. Accessing your EKS Cluster from CodeShip Set up access to your cluster as described in the AWS EKS docs. Then flatten your kubeconfig and add it to your environment file. Use the Jet CLI and your project’s AES key to encrypt the env file. AWS_ACCESS_KEY_ID=your_access_key_id AWS_SECRET_ACCESS_KEY=your_secret_access_key eks-env kubectl config current-context #make sure it’s aws kubectl config view --minify --flatten > kubeconfigdata docker run --rm -it -v $(pwd):/files codeship/env-var-helper cp kubeconfigdata:/root/.kube/config k8s-env cat k8s-env >> eks-env jet encrypt eks-env eks-env.encrypted rm kubeconfigdata k8s-env eks-env #or add them to your .gitignore
  • 20. Accessing your EKS Cluster from CodeShip [...] kubectl: image: codeship/eks-kubectl encrypted_env_file: eks-env.encrypted volumes: - ./deploy:/deploy [...] - name: eks_deployment service: kubectl tag: master command: ./deploy/eks-deployment.sh codeship-services.yml codeship-steps.yml This image has AWS-vendored kubectl, aws-iam-authenticator, and a helper script to pull the kubeconfig out of the encrypted environment variable and put it into /.kube/kubeconfig. This step is only run on builds from the master branch, and will run the EKS deploy script that is mounted into the container.
  • 21. Deploying to EKS CodeShip Build EKS Cluster magic?
  • 22. Deploying to EKS Managed, not magic EKS is concerned with infrastructure, and doesn’t replace existing deployment patterns You still need to: 1. Package your application code in container images 2. Push the images to a registry for distribution 3. Issue commands to update your cluster 4. Deal with extra requirements like storage classes, etc Good news: using EKS doesn’t lock you in to ECR (AWS’s image registry), though it may be slightly easier to use because of shared credentials and roles
  • 23. Deploying to EKS - type: push service: worker name: push_worker_image image_name: rheinwein/examplevotingapp-worker image_tag: "{{.CommitID}}" Build images with CodeShip and push to a registry using CodeShip’s push step type. codeship-steps.yml Best Practice for Containerized Apps Tag your images with versions or the commit SHA. Avoid pulling images using the latest tag. - name: eks_deployment service: kubectl tag: master command: ./deploy/eks-deployment.sh codeship-steps.yml Use a deploy script to issue update commands against your EKS cluster. 1 2
  • 24. Deploying to EKS CodeShip Build EKS Cluster magic?
  • 25. Deploying to EKS Image Registry EKS Cluster CodeShip Build GitHub check out source code report testing & build status push images build & tag images issue update/deployment commands pull images Monitoring, Observing, Alerting
  • 27. CI/CD Tips and Best Practices Healthchecks A running container only means that the process is running, not that the service is available. CodeShip respects the HEALTHCHECK attribute of services, and will wait until the service is available before trying to use it in a build. Encryption CodeShip provides each project with an AES key to encrypt secrets. Using the CodeShip CLI jet, you can encrypt and decrypt environment variables. Manual Approval Want an extra set of eyes on changes before they’re deployed, or want to restrict deployments to certain groups of people? With manual steps, you have more control over your CD process.
  • 28. Sign up for CodeShip https://codeship.com AWS EKS Getting Started Guide https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html Download a local Kubernetes environment with Docker for Mac or Windows https://www.docker.com/products/docker-desktop Example-voting-app source code https://github.com/rheinwein/example-voting-app Download Deploying to Kubernetes Codeship eBook https://resources.codeship.com/ebook/deploy-docker-kubernetes-codeship Useful Links
  • 29. Interested in learning more about DevOps best practices and use cases? Join us for Jenkins World | DevOps World San Francisco, California September 16-19, 2018 Nice, France October 22-25, 2018 Get 20% off with code JWLTACHO