Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deploy AWS applications with PipeCD

Khanh Tran
October 29, 2021

Deploy AWS applications with PipeCD

My talk at JAWSUG-container Connpass event #20. Content includes an overview of PipeCD - a Gitops based continuous delivery tool and a detailed example of using PipeCD to deploy services to AWS ECS.

Khanh Tran

October 29, 2021
Tweet

Other Decks in Technology

Transcript

  1. PipeCD ❤ AWS Control your AWS applications deployment in GitOps

    style with PipeCD. khanhtc1202 Developer Productivity Div, CyberAgent, Inc. Presents
  2. Agenda • What and why we need • PipeCD •

    Progressive deployment for AWS ECS applications • PipeCD’s enterprise features • Roadmap • ... 3
  3. What & why we need - An end-to-end solution -

    Progressive delivery: Canary, Blue/Green, Rollout - Automated analysis: metrics, log, smoke test - A unified solution cross cloudplatform and application kind - Decrease onboarding costs - Improve developer experience - One delivery infrastructure for multiple deployment targets (Kubernetes, Terraform, AWS ECS, AWS Lambda, …) And we need a CD tool, not the CI tool which does the CICD tasks
  4. Importance of CD Commit Changes Build Test Staging Production Continuous

    Integration and Delivery(CI/CD) Continuous Delivery(CD) Commit Changes Build Test Staging Production Continuous Integration(CI) Artifacts
  5. 7

  6. PipeCD overview - platform team ref: https://pipecd.dev/docs/operator-manual/control-plane/installation/ Controlplane main components

    - All stateless components (servers, cache, ops) - Managed services: Datastore (RDS,...) and Filestore (S3) => Low maintenance cost - Easy to get start with just Helm - Optional: components for monitoring (prometheus, grafana) - monitoring both controlpane and pipeds
  7. PipeCD overview - product team ref: https://pipecd.dev/docs/operator-manual/piped/installation/ Platform team space

    Support all possible places • k8s pod • ECS Fargate task • CloudRun • ... - All credentials stored in product team cluster (controlplane stores nothing related to the product) - Only outbound requests (no expose ports required)
  8. How do we do progressively ref: AWS Blog: Blue Green

    Deployment What do we need to prepare?? - ALB (Listener, Targetgroup) - Cluster - TaskDefinition - Service & tons of scripts to register/create above entities...
  9. AWS ECS deployment with Codedeploy ref: Codedeploy tutorial - Customizable

    stage 👍 - Simple UI 👍 - External stage (such as deployment based on analysis) ?
  10. AWS ECS deployment with Jenkins ref: AWS Blog: Blue Green

    Deployment Human approval? Auto rollback? Error rate based deploy? ...
  11. Piped - an agent to deploy applications ref: PipeCD user

    guide Register a piped agent from the console
  12. Piped - an agent to deploy applications ref: Piped configuration

    Require a simple configuration which contains: - Piped credentials - Registered controlplane - Gitops credentials (ssh key, repositories) - Cloudprovider
  13. PipeCD application ref: PipeCD user guide Application can be one

    of: - Kubernetes - AWS ECS - AWS Lambda - Terraform - Cloudrun (gcp)
  14. Deployment configuration ref: Configure ECS deployment Require a simple configuration

    which define the PipeD behavior: - Kind (ECSApp for instance) - Input: contains ECS required configuration: task definition, service definition, targetGroup - Pipeline: contains deployment flow Note: - all configurations stored in Git - can reuse task definition and service definition as it is - no changes or PipeCD specified syntax required
  15. Deployment configuration 24 The UI visualizes the state of the

    application in real time and clearly shows what happened at what timing
  16. Bonus - KubernetesApp Application detail view: show state of currently

    running resources Find more examples at pipecd/examples
  17. PipeCD’s enterprise features - Event wacher 30 Continuous Delivery(CD) Commit

    Changes Build Test Staging Production Continuous Integration(CI) Artifacts Event watcher Define how Piped handle an event and trigger the event from CI => Piped will update the configuration by itself via PR => trigger deployment ref: PipeCD eventwatcher We also use pipecd to deploy our pipecd development controlplane 😉
  18. PipeCD’s enterprise features - Plan preview 31 ref: PipeCD plan-preview

    Enable to preview what will be applied/changed in your cluster at the pull request review step (the CD is not yet triggered - no deployment yet)