Getting Started with Kubernetes and Rancher 2 0
Getting Started with Kubernetes and Rancher 2. 0 Rancher Labs Training © 2018 Rancher Labs, Inc. #rancherk 8 s
Today’s objectives • Technical introduction to Kubernetes using Rancher • Keep the slides to a minimum • Demo, then demo some more • Questions are always welcome • We won’t leave until all your questions are answered! 1 © 2018 Rancher Labs, Inc.
2 Matthew Scheer Rajashree Mandaogane Community Advocate @matthew_scheer Slack: @matthew Software Engineer Twitter: @rajashree_28 Slack: rajashree Github: mrajashree © 2018 Rancher Labs, Inc.
For the purpose of this training, we’re assuming you understand basic Docker concepts…. 3 © 2018 Rancher Labs, Inc. #rancherk 8 s
Resources - docs https: //rancher. com/docs/rancher/v 2. x/en/quick-start-guide/ 4 © 2018 Rancher Labs, Inc. #rancherk 8 s
Resources - forums http: //slack. rancher. io 5 © 2018 Rancher Labs, Inc. http: //forums. rancher. com #rancherk 8 s
6 © 2018 Rancher Labs, Inc.
7 © 2018 Rancher Labs, Inc.
8 © 2018 Rancher Labs, Inc.
9 © 2018 Rancher Labs, Inc.
10 © 2018 Rancher Labs, Inc.
11 © 2018 Rancher Labs, Inc.
Rancher & Kubernetes - better together Open source container manager used to run Kubernetes in production ü Easy-to-use interface for k 8 s configuration and deployment ü Infrastructure management across multiple clusters and clouds ü Automated deployment of the latest k 8 s release ü Workload, RBAC, policy, and project management ü 24 x 7 enterprise-grade support 7 © 2018 Rancher Labs, Inc. Rancher Kubernetes Distribution Certified and supported distribution that closely follows the upstream Kubernetes project Rancher Infrastructure Services Storage, networking, load balancing, security, etc.
13 © 2018 Rancher Labs, Inc.
14 © 2018 Rancher Labs, Inc.
Kubernetes 101 ü ü ü 15 Pods Deployments Services Config maps Ingresses © 2018 Rancher Labs, Inc. #rancherk 8 s
Pods • • 8 Smallest unit that can be deployed in Kubernetes Consist of one or more containers that are always scheduled together Each pod is given a unique IP address Containers in a pod can speak to each other via localhost © 2018 Rancher Labs, Inc. #rancherk 8 s
Pods are confusing • • • 17 If the explanation is confusing, don’t worry too much Pods typically contain only a single container Try to think of pods as containers for the remainder of the training © 2018 Rancher Labs, Inc. #rancherk 8 s
Pods 18 © 2018 Rancher Labs, Inc.
19 © 2018 Rancher Labs, Inc.
Replication Controller and Replica Set • • 20 Defines the desired scale and state of a group of pods SOT for driving the current state to the desired state (in controller manager) © 2018 Rancher Labs, Inc.
Replica Set 21 © 2018 Rancher Labs, Inc.
Replica Set 22 © 2018 Rancher Labs, Inc.
Replica Set 23 © 2018 Rancher Labs, Inc.
Deployments • • • 24 Level of abstraction above Replica. Sets Deployments create and update Replica. Sets Allow you to easily scale and perform rolling upgrades © 2018 Rancher Labs, Inc. #rancherk 8 s
Deployments 25 © 2018 Rancher Labs, Inc.
Deployments 26 © 2018 Rancher Labs, Inc.
Deployments 27 © 2018 Rancher Labs, Inc.
Deployments 28 © 2018 Rancher Labs, Inc.
Deployments 29 © 2018 Rancher Labs, Inc.
Services • • • 30 Define a DNS entry that can be used to refer to a group of pods Provide a consistent endpoint for the group of pods Different types: node. Port, cluster. IP, loadbalancer © 2018 Rancher Labs, Inc. #rancherk 8 s
Services 123. 456. 789 Service IP 31 © 2018 Rancher Labs, Inc.
Config maps • • • 32 Allow storing of arbitrary configuration values and files Exposed in pods as either environment variables or as local storage Decoupled storage of configuration from pod spec © 2018 Rancher Labs, Inc. #rancherk 8 s
Config Maps api. Version: v 1 kind: Config. Map metadata: name: dev-config namespace: default data: Item 1: dev-stuff Item 2: more dev stuff 33 © 2018 Rancher Labs, Inc. api. Version: v 1 kind: Config. Map metadata: name: dev-config namespace: default data: Item 1: qa-stuff Item 2: more qa stuff api. Version: v 1 kind: Config. Map metadata: name: dev-config namespace: default data: Item 1: prod-stuff Item 2: more prod stuff
Ingresses • • 34 Define how traffic outside the cluster is routed to inside the cluster Used to expose Kubernetes services to the world Route traffic to internal services based on factors such as host and path Ingress is usually implemented by a load balancer (Nginx, HAProxy, AWS ELB, etc…) © 2018 Rancher Labs, Inc. #rancherk 8 s
Ingresses Ingress Controller https: //my-nginx-app. cluster. com https: //cluster. com/my-nginx-app 35 © 2018 Rancher Labs, Inc. Service IP
Rancher 2. 0 101 1. 2. 3. 4. 5. 6. 7. 8. Setting up Rancher Clusters Authentication & Security Storage Projects Namespaces Catalogs CLI/API/Kubectl © 2018 Rancher Labs, Inc.
Demo Time 37 © 2018 Rancher Labs, Inc.
Join other Rancher users in Slack https: //slack. rancher. io #Kubernetes channel 15 © 2018 Rancher Labs, Inc.
Thank you rancher. com/kubernetes #rancherk 8 s © 2018 Rancher Labs, Inc.
- Slides: 40