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

Kubernetes on AWS

Kubernetes on AWS

This is an introduction to basic concepts of Kubernetes on AWS. It covers why you would use containers, how Kubernetes helps you deploy containers. Then it covers the tools that you can use to successfully deploy a Kubernetes architecture, including kops, and kubectl.

Nathan Peck

May 09, 2018
Tweet

More Decks by Nathan Peck

Other Decks in Programming

Transcript

  1. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Nathan Peck, Developer Advocate @nathankpeck Kubernetes on AWS Create, manage, and scale a Kubernetes cluster on AWS
  2. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. an open-source system for packaging software into standardized units (called containers) for development, shipment and deployment
  3. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Dependencies Binaries Code docker build
  4. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. docker push Container Registry (Private or Public)
  5. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Development docker run Container Registry (Private or Public) Production
  6. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Foo App Bar App Multiple docker containers can share a single machine
  7. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Launching and keeping track of many docker containers across many machines is hard!
  8. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. an open-source system for automating deployment, scaling, and management of containerized applications across clusters of machines
  9. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 3 x Container A 2 x Container B Accepts your intent to run containers… …and applies it to the underlying infrastructure
  10. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. 3 x Container A 2 x Container B Different infrastructure, same application
  11. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Core concepts of Kubernetes Pod Workers run your pods as instructed by the masters Masters control and monitor cluster state Cluster Worker Nodes Masters
  12. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. open source operations tool for setting up a production grade Kubernetes cluster to run containers kops
  13. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. kops Bootstraps the cluster by provisioning EC2 instances and installing Kubernetes and etcd Cluster Worker Nodes Masters Pod
  14. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Important kops commands kops create cluster kops create cluster --target terraform kops create cluster --target cloudformation kops update cluster
  15. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. command line tool for interacting with a Kubernetes cluster to launch applications and application resources in it kubectl
  16. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. kubectl Kubernetes API Cluster Pod Worker Nodes Masters
  17. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Important kubectl commands kubectl apply -f <file.yml> kubectl scale --replicas=3 <resource> kubectl get <resource> kubectl describe <resource> kubectl delete <resource>
  18. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. kubectl apply –f service.yml Pod Template Service, for exposing pod’s port to the rest of the cluster Replication controller, for scaling number of pods
  19. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. kubectl get pods kubectl get pods NAME READY STATUS RESTARTS AGE guestbook-hwjfx 1/1 Running 0 1d guestbook-mn2lz 1/1 Running 0 4d guestbook-tgz98 1/1 Running 0 4d redis-master-5n95w 1/1 Running 0 1d redis-slave-796mm 1/1 Running 0 4d redis-slave-tt4f6 1/1 Running 0 4d
  20. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. kubectl describe service guestbook Public address of my service
  21. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. cloud based IDE and development environment we will use for the workshop AWS Cloud9
  22. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. kubectl Kubernetes API Cluster Pod Worker Nodes Masters Cloud9 IDE
  23. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. There are a variety of different ways to run Kubernetes
  24. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. How much do you want to manage? Your container Worker Nodes Masters State Store
  25. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Created by kops, but still your responsibility Your container Worker Nodes Masters State Store kops (available today)
  26. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Managed control plane (in preview) Amazon EKS Your container Masters State Store You Worker Nodes
  27. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Fully managed (available in 2018) Amazon EKS Your container Masters State Store AWS Fargate You Worker Nodes
  28. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. virtual-kubelet (available today) AWS Fargate Master Worker Worker virtual-kubelet https://aws.amazon.com/blogs/opensource/aws-fargate-virtual-kubelet/
  29. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Provision a cluster using kops Deploy an application using kubectl Explore Kubernetes features for scaling and monitoring the application What we will do today
  30. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. kubectl Kubernetes API Cluster Pod Worker Nodes Masters Cloud9 IDE kops
  31. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. TIME TO GET STARTED! https://amzn.to/k8s-on-aws