Curso Deploy and Run Apps with Docker Kubernetes Helm Rancher
24 horasVisão Geral
Neste Curso Deploy and Run Apps with Docker Kubernetes Helm Rancher, pegaremos um aplicativo Angular Client simples que se comunica com um servidor Node.JS, implantá-lo e executá-lo como contêineres Docker. Aprenderemos como construir imagens Docker de desenvolvimento e produção para esses tipos de aplicativos. Em seguida, seremos apresentados à orquestração básica de contêineres com Docker Compose.
Após isso iremos refatorar a aplicação para ser mais desacoplada, resiliente e escalável usando uma arquitetura de microsserviços, tornando a aplicação mais nativa da nuvem. Aprenderemos como podemos construir imagens Docker e publicá-las no Docker Hub automaticamente com Travis CI. Implantaremos o aplicativo conteinerizado na nuvem com a ajuda do serviço Amazon Elastic Beanstalk. Também veremos como automatizar a implantação no Elastic Beanstalk com Travis CI. Quando implantarmos o aplicativo no Elastic Beanstalk, também veremos como podemos usar serviços da AWS, como AWS RDS, AWS Elasticsearch e AWS Elasticache, em vez de executá-los como nossos próprios contêineres.
Então é hora do Kubernetes. Passaremos muito tempo no Kubernetes, pois é a escolha preferida da maioria das pessoas quando desejam executar uma carga de trabalho de contêiner em produção. Escreveremos arquivos de manifesto do Kubernetes (YAML) para implantar o aplicativo em um cluster do Kubernetes. Veremos a implantação em um cluster Kubernetes de nó único do Docker for Desktop local e em um cluster Kubernetes de vários nós na nuvem (Google GKE, Amazon Kops, Amazon EKS).
Em seguida, veremos o Kubernetes Helm, que pode ser usado para empacotar os arquivos de manifesto do Kubernetes para que possam ser versionados e lançados como uma entidade. Aprenda como usar o Travis CI para criar imagens docker e implantar automaticamente em clusters Kubernetes. Por fim, veja como você pode gerenciar vários clusters Kubernetes com o Rancher.
Objetivo
Após realizar este Curso Deploy and Run Apps with Docker Kubernetes Helm Rancher, você será capaz de:
- Fundamentos do Docker
- Construindo imagens Docker de desenvolvimento e produção
- Comunicação de serviço em uma rede Docker
- Construindo automaticamente imagens Docker com Travis CI e publicando no Docker Hub
- Usando Docker Compose para orquestração básica de contêineres
- Implantação de contêiner Docker no Amazon Elastic Beanstalk
- Conceitos de Kubernetes, como Pod, Serviço, Implantação, StatefulSet, ConfigMap, Secret etc.
- Arquitetura Kubernetes e abstrações de hardware, armazenamento e rede
- Executando Kubernetes localmente com Docker for Desktop no Mac e Windows e MicroK8s no Linux Desktop
- Comunicação de microsserviços em ambiente Kubernetes
- Usando Helm para empacotar seus aplicativos para implantação no cluster Kubernetes
- Configurando seu próprio repositório Helm para seus gráficos
- Implante gráficos do Helm automaticamente no repositório do Helm com Travis CI
- Executando Kubernetes na nuvem com Google Cloud Platform e GKE
- Executando Kubernetes na nuvem com Amazon Web Services e Kops e EKS
- Usando o Travis CI para implantar no cluster Kubernetes na nuvem
- Gerenciando vários clusters Kubernetes com Rancher
Publico Alvo
- Desenvolvedores
- Arquitetos
- DevOps
- ISTO
Pre-Requisitos
- Os alunos devem estar interessados em aprender mais sobre como construir, executar e implantar aplicativos como contêineres
- Os alunos devem estar interessados em Kubernetes e querer aprender mais sobre ele tanto localmente quanto na nuvem
Materiais
Português/Inglês + Exercícios + Lab PraticoConteúdo Programatico
Introduction
- Introduction
- Visualizar
Docker
- What is Docker?
- Visualizar
- Installing Docker and Kubernetes on Mac
- Installing Docker and Kubernetes on Windows Professional and Enterprise editions
- Installing Docker and Kubernetes on Linux
- Running a Docker Container
- Exposing Ports for External Access
- Docker Volumes
- Looking inside a Docker Container
- Environment Variables
- Docker Container Logs
- Listing Running Docker Containers
- Stopping a Docker Container
- Listing Stopped Docker Containers
- Removing a Stopped Docker Container
- Docker Networks and Multiple Containers
- Docker Images
- Docker Image Repositories
Course Application
- Application Architecture Overview
- Visualizar
- Clone Source Code Project
- Create your own GitHub Project for the Source Code
- Walkthrough of Source Code
Run the Course Application
- Introduction and Development Framework installations
- Visualizar
- Check available ports
- Create a Docker Network
- Start a PostgreSQL Database Container
- Start a Redis Cache Container
- Start an Elasticsearch Search Container
- Start the App Backend (API)
- Start the App Client (Angular) and Test the App
"Dockerizing"/"Containerizing" the App Solution
- Introduction
- Visualizar
- Creating a Dev Dockerfile for the App Backend (API)
- Change App Backend (API) to use Docker Network
- Building an App Backend (API) Docker Image
- Creating a Dev Dockerfile for the App Client (Angular)
- Change App Client (Angular) to use Proxy
- Building an App Client (Angular) Docker Image
- Creating a Dev Dockerfile for the Proxy (Nginx) including Custom Configuration
- Building a Proxy (Nginx) Docker Image
- Commit and push changes to GitHub
Run the fully "containerized" App Solution
- Start the App Backend (API) Container
- Start the App Client (Angular) Container
- Start the Proxy (Nginx) Container
- Test it out (also changing code)
- Stop everything and clean up
Basic Container Orchestration (Docker Compose) and Initial App Redesign
- Introduction
- Visualizar
- Writing a Docker Compose file for App Solution
- Start the App Solution and Test
- Source Code for API Server Update
- Update App Backend (API) Source Code
- Creating a Dev Dockerfile for Postgres that Creates Todo db
- Create App Backend (API) Start Script that Checks Elasticsearch Connection
- Update Docker Compose file so it Builds Images and Sets Start Script for API
- Start the App Solution with Initial Build and Test
- Stop Redis and See if it Works with just Database
- Add Named Volumes for Persistent Data
- Save App Solution Project
- Stateless vs Stateful Containers
- A bit about Health checks
- Desired App State and Actual App State
- Accessing a Container and Executing a Command
- Docker Compose seems Powerful, why do we need anything else, such as Kubernetes?
Re-design of App to be Cloud Native (Microservices)
- Introduction
- Visualizar
- Clone Source Code Project
- Create your own GitHub Project for the Source Code
- Walkthrough of Source Code
- Docker Compose file Walkthrough
- Service to Service Intercommunication
- Start the App Solution with Initial Build and Test
- Stopping the Todo Cache Ingestion, add new Todo, start Todo Cache Ingestion
- Scaling the Todo Cache Ingestion
Create Production Images and Push to Docker Hub
- Introduction
- Visualizar
- Change to Development Tag in Docker Compose
- Creating a Production Dockerfile for the App Backend Services (Node.JS)
- Creating a Production Dockerfile for the App Client (Angular)
- Docker Registries
- Pushing Images to Docker Hub
- Create Production Docker Compose File
- Run App Solution with Production Images via Docker Compose
- Push all built Production Images to Docker Hub
- Save the Project
Creating an Automated Build (CI) and Push Production Images to Docker Hub
- Introduction
- Visualizar
- Setting up a Travis CI account and Associate with GitHUb project
- Source Code for Travis CI configuration
- Enable Travis CI (.travis.yml) in GitHub Project
- Code to Install Google Chrome in Todo View Dev Image
- Commit changes and Watch Travis CI Build
- Show Travis CI build status in GitHub project
Creating an Automated Deployment (CD) to Amazon Elastic Beanstalk
- Introduction
- Visualizar
- Overview of AWS VPC and Security Groups
- Create an AWS Account
- What does the cost / billing look like for this development / test deployment?
- Create an AWS Security Group for App
- Create AWS ElastiCache Instance - replaces todo-redis
- Create AWS RDS Database Instance - replaces todo-postgres
- Download PgAdmin and set up Todo table
- Create AWS Elasticsearch Instance - replaces todo-elastic
- Create App Environment in AWS Elastic Beanstalk
- Create AWS PEM File and access Elastic Beanstalk EC2 instance
- Source code for Elastic Beanstalk Deployment Description (Dockerrun.aws.json)
- Create Elastic Beanstalk Deployment file (Dockerrun.aws.json)
- Documentation for Dockerrun.aws.json
- Configure Environment Properties in Elastic Beanstalk Console
- Source code for Travis CI (.travis.yml) deployment section
- Configure Travis CI (.travis.yml) to Deploy to Elastic Beanstalk
- Commit Changes and Watch Deployment
- Troubleshooting Deployments to Elastic Beanstalk
- Clean up AWS Services
Kubernetes - Getting Started
- Introduction
- Visualizar
- Taking it for a test run
- Hardware representation: CPU and RAM
- Hardware representation: Storage
- Hardware representation: Network
- Namespaces - partition your applications
- Pods and ReplicaSets - package your applications
- Deployments - controlling pods
- Services - make your apps available externally
- Nginx Ingress Controller installation and testing
- Ingress - consolidate access to services
- ConfigMap Example YAML
- ConfigMap - configure your application
- Secret - configure passwords, tokens etc in a secure way
- Liveness and Readiness Probes Example YAML
- Liveness and Readiness Probes - check the health of your application
- Persistent Volume Example YAML
- Persistent Volumes (PV) and Persistent Volume Claims (PVC)
- StatefulSet Example YAML
- StatefulSets - running stateful containers
Kubernetes - Running the Todo App in a local K8s cluster
- Introduction
- Visualizar
- Introducing Kompose
- Clone Todo App project with Kubernetes YAML
- Create your own GitHub Project for the Source Code
- Walkthrough and Update Todo Kubernetes YAML
- Update Account Name for Docker Images
- Build and Publish Docker Images to Docker Hub
- Running the Todo App Solution in Kubernetes
- Troubleshooting the Todo App Deployment (NEW 2020-01)
- Troubleshooting Kubernetes Deployments
Kubernetes - using Dynamic Storage Provisioning locally
- Introduction
- Updating PVCs to use default storage class
- Run and see the PVs being dynamically provisioned
Development Environment
- A word about what development environment to use
Helm - Package and Release the Application
- Introduction
- Visualizar15:36
- Installing Helm
- Installing Kubernetes Dashboard with Helm
- Create Helm Chart for Todo App
- Install Todo App with Helm Chart
Helm - Setting up your own Repository to host Charts
- Introduction
- Visualizar
- Creating a GitHub Repository to host Helm Charts
- Publish the Todo App Chart to the Repository
- Deploy Todo App Chart from Remote Repository
- CI / CD Pipeline overview
- Move Todo Chart Source Code to helm-charts master branch
- Source code for .travis.yaml file
- Publish Charts automatically with Travis CI
Kubernetes in AWS - Introduction
- Introduction
- Visualizar1
- Provision EC2 Instance to install from
- Install Scripts Source
- Install aws client, kubectl, and helm
Kubernetes in AWS - Create Cluster with Kops
- Introduction
- Visualizar
- Create kops IAM users
- Configure AWS client (config and credentials in ~/.aws)
- Installing kops (used to create clusters)
- Create S3 Bucket to hold Cluster configuration
- Define a cluster with kops
- Create a cluster with kops
- Install Helm Server (Tiller)
- Check default StorageClass
- Fix Elastic data permissions and Postgres data location
- Commands for creating a Tiller Service Account
- Create Service Account for Tiller with Role Cluster-Admin
- Deploy Todo App with Helm
- Upgrade Todo App with Helm - change chart
- Upgrade Todo App with Helm - change source code
- Auto Healing - What happens during a Worker Node failure?
- YOU ARE BEING BILLED NOW - THIS AWS CLUSTER COSTS MONEY!
Kubernetes in AWS - Auto Deploying with Travis CI5
- Introduction
- Visualizar
- Source code for updated .travis.yml
- Update .travis.yml to Tag with Build Number and deploy to AWS k8s cluster
- Update Travis CI my-todo-cloud-k8s project with new Env Vars and Deploy
- Delete cluster
Kubernetes in AWS - Create Cluster with EKS
- Introduction
- Visualizar
- Extra AWS Policies JSON
- Create extra AWS Policies
- Create eks IAM user
- Configure AWS client (config and credentials in ~/.aws)
- Install eksctl and aws-iam-authenticator tools
- Create a cluster with eksctl
- Install Helm Server (Tiller)
- Deploy Todo App with Helm
- Delete cluster
Kubernetes in Google Cloud Platform (GCP) - GKE
- Introduction
- Visualizar
- Introduction to Google Cloud Console
- Create a TodoApp Project and Enable Billing
- Install and Configure gcloud CLI
- Create GKE cluster from UI and gcloud CLI
- Connect to cluster with gcloud CLI and kubectl
- Check default StorageClass
- Install Helm Server (Tiller)
- Deploy Todo App with Helm
- Delete cluster
Kubernetes Cluster Management with Rancher
- What is Rancher?
- Provision EC2 instance to run Rancher Server on
- Install Docker on EC2 instance (Rancher will be installed via Docker)
- Install Rancher and Access UI
- Rancher UI Walkthrough
- Configure Authentication with GitHub
- Create Google GKE Cluster from Google Cloud Console
- Import Google GKE Cluster
- Inspect the imported Google GKE Cluster
- Create Google GKE Cluster
- Create Amazon EKS Cluster
- Install Helm Server (Tiller)
- Remove Namespace Definitions from Todo App Chart
- Add Catalog with Todo App
- Deploy Todo App to Single Cluster
- Upgrade Rancher to version 2.3
- Deploy Todo App to Multiple Clusters
- Monitor the health of Clusters
- Delete clusters