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

Intro to the cloud-native world of Kubernetes -...

Intro to the cloud-native world of Kubernetes -- January 2019

An update of the similar presentation I delivered last year, reflecting the current state of the ecosystem, and serving as the first talk in a new meetup group (previous slide deck at https://speakerdeck.com/luxas/intro-to-the-cloud-native-world-of-kubernetes-november-2018)
Google Docs link to this presentation: https://docs.google.com/presentation/d/1e1KQQVzSzbCuuqtWZdyAtl-6vcyqw6I_TiPzaAcCVHA/edit#slide=id.p

I gave this talk at the first Kubernetes & CNCF meetup in Tampere.
The meetup link is here: https://www.meetup.com/Kubernetes-Tampere/events/257164934/
The talk was recorded here: https://youtu.be/szPr2-PXUJo
Location: Cybercom, Tampere, Finland

Lucas Käldström

January 17, 2019
Tweet

More Decks by Lucas Käldström

Other Decks in Technology

Transcript

  1. 1 Intro to the cloud-native world with Kubernetes Lucas Käldström

    - CNCF Ambassador 17th of January, 2019 - Tampere Image credit: @ashleymcnamara
  2. 2 $ whoami Lucas Käldström, High School Student, 19 years

    old CNCF Ambassador, Certified Kubernetes Administrator and Kubernetes SIG Lead KubeCon Speaker in Berlin, Austin, Copenhagen, Shanghai & Seattle Kubernetes approver and subproject owner, active in the community for ~3 years. Got kubeadm to GA. Driving luxas labs which currently performs contracting for Weaveworks A guy that has never attended a computing class
  3. 5 Cloud Native Computing Foundation • Nonprofit, part of the

    Linux Foundation; founded Dec 2015 • Platinum members: Incubating Service Mesh Storage Service Discovery Distributed Tracing Software Update Spec Security Graduated Package Management Orchestration Networking API Service Proxy Logging Remote Procedure Call Distributed Tracing API Container Runtime Container Runtime Messaging Monitoring Registry Storage Key/Value Store Source
  4. 6 CNCF Project Maturities INNOVATORS “TECHIES” EARLY MAJORITY “PRAGMATISTS” LAGGARDS

    “SKEPTICS” “THE CHASM” LATE MAJORITY “CONSERVATIVES” SANDBOX GRADUATED INCUBATING EARLY ADOPTERS “VISIONARIES” SANDBOX Identity Spec Identity Policy Tooling Metrics Spec Key/Value Store Monitoring Serverless Packaging Spec Container Security Image Distribution Nodeless Source
  5. 7

  6. 8 What is CNCF? A non-profit foundation for getting Cloud

    Native: a) open source projects b) companies c) enthusiasts to come together in a neutral place. CNCF was founded in December 2015 and is a part of The Linux Foundation. CNCF curates and promotes a toolkit of trusted projects for modern applications. Helps hosted projects to succeed in various ways, one of them is by organizing events where the community can meet in person.
  7. 10 CNCF Cloud Native Definition v1.0 Cloud native technologies empower

    organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach. These techniques enable loosely coupled systems that are resilient, manageable, and observable. Combined with robust automation, they allow engineers to make high-impact changes frequently and predictably with minimal toil. The Cloud Native Computing Foundation seeks to drive adoption of this paradigm by fostering and sustaining an ecosystem of open source, vendor-neutral projects. We democratize state-of-the-art patterns to make these innovations accessible for everyone. Source
  8. 11 Online, Proctored Kubernetes Exams • Certified Kubernetes Administrator (CKA)

    – Over 3,500 registrations already – https://www.cncf.io/certification/expert/cka/ • Certified Kubernetes Application Developer (CKAD) – Certifies that users can design, build, configure, and expose cloud native applications for Kubernetes – https://www.cncf.io/certification/expert/cka/ckad/ • Both tests – Tests consist of a set of scenarios to resolve from the command line over 3 hours; there is no multiple choice – Each exam is $300 – Quarterly exam updates to match K8s releases` Source
  9. 12 Certified Kubernetes Conformance • CNCF runs a software conformance

    program for Kubernetes – Implementations run conformance tests and upload results – New mark and more flexible use of Kubernetes trademark for conformant implementations – cncf.io/ck Source
  10. 14 Kubernetes Certified Service Provider A pre-qualified tier of vetted

    service providers who have deep experience helping enterprises successfully adopt Kubernetes through support, consulting, professional services and/or training. Benefits • Placement at the top of https://kubernetes.io/partners/ • Monthly private meetings with cloud native project leaders, TOC members, and representatives from the Governing Board • Access to leads from the kubernetes.io for end users looking for support Requirements • Three or more certified engineers • Business model to support enterprise end users • Be a CNCF member https://www.cncf.io/certification/kcsp/
  11. 15 KubeCon + CloudNativeCon • Europe 2019 (sponsorships and CFP

    open) – Barcelona: May 20-23, 2019 • China 2019 (sponsorships open) – Shanghai: June 24-26, 2019 • North America 2019 (sponsorships open) – San Diego: November 18-21, 2019 Source
  12. 19 What is Kubernetes? = A Production-Grade Container Orchestration System

    Google-grown, based on Borg and Omega, systems that run inside of Google right now and are proven to work at Google for over 10 years. Google spawns 2 billion containers per week with these systems. Created by three Google employees initially during the summer of 2014; grew exponentially and became the first project to get donated to the CNCF. Hit the first production-grade version v1.0.1 in July 2015. Has continually released a new minor version every three months since v1.2.0 in March 2016. Lately v1.13.0 was released in December 2018.
  13. 20 So what does Kubernetes actually do? It abstracts away

    the underlying hardware, abstracts away the concept Node. Principle: Manage your applications like Cattle (generic, bulk operations) instead of like Pets (every operation is customized with care and love for the individual) Kubernetes is the Linux for distributed systems. In the same manner Linux (an OS) abstracts away the hardware differences (with different CPU types, etc.), Kubernetes abstracts away the fact that you have 5 000 nodes in the node pool and provides consistent UX and operation methods for apps You (the admin) declares the desired state, Kubernetes' main task is to make the desired state the actual state.
  14. 21 Nodes Control Plane Kubernetes’ high-level component architecture Node 3

    OS Container Runtime Kubelet Networking Node 2 OS Container Runtime Kubelet Networking Node 1 OS Container Runtime Kubelet Networking API Server (REST API) Controller Manager (Controller Loops) Scheduler (Bind Pod to Node) etcd (key-value DB, SSOT) User Legend: CNI CRI OCI Protobuf gRPC JSON
  15. 22 kubeadm = A tool that sets up a minimum

    viable, best-practice Kubernetes cluster Master 1 Master N Node 1 Node N kubeadm kubeadm kubeadm kubeadm Cloud Provider Load Balancers Monitoring Logging Cluster API Spec Cluster API Cluster API Implementation Addons Kubernetes API Bootstrapping Machines Infrastructure Layer 2 The scope of kubeadm Layer 3 Layer 1
  16. 23 kubeadm vs kops or kubespray Two different projects, two

    different scopes Master 1 Master N Node 1 Node N kubeadm kubeadm kubeadm kubeadm Cloud Provider Load Balancers Monitoring Logging Cluster API Spec Cluster API Cluster API Implementation Addons Kubernetes API Bootstrapping Machines Infrastructure kops
  17. 24 Fresh docs on how to extend Kubernetes Brand new

    docs on how to extend Kubernetes Kubernetes has many extension mechanisms: • API Aggregation (GA) • kubectl plugins (beta) • CustomResourceDefinitions, Example intro (beta) • Container Network Interface plugins (stable) • Scheduler webhook & multiple (beta) • Device plugins (GA) • Admission webhooks (beta) • External Cloud Provider Integrations (beta) • API Server authn / authz webhooks (stable) • Container Runtime Interface plugins (alpha) • Container Storage Interface plugins (GA)
  18. 25 Kubernetes in Search Trends WeChat Kubernetes OpenStack Google Trends

    Kubernetes OpenStack Mesos Docker Swarm Cloud Foundry July-18 Aug-18 Sept-18 Oct-18 Source
  19. 26 Kubernetes’ incredible velocity (last 365 days!) 32 000+ human

    commits 15 000+ contributors 51 000+ opened Pull Requests 73 000+ opened issues 88 000+ Kubernetes professionals 35 000+ Kubernetes jobs 55 000+ users on Slack 50 000+ edX course enrolls Source 5 Source 4 Last updated: 09.01.2019 Source 2 318 000+ Github comments Source 1 Source 3
  20. 28 The core primitive: A Pod The basic, atomically deployable

    unit in Kubernetes. A Pod consists of one or many co-located containers. A Pod represents a single instance of an application. The containers in a Pod share the loopback interface (localhost) and can share mounted directories. Each Pod has it’s own, uniquely assigned and internal IP. Pods are mortal, which means that if the node the Pod runs on becomes unavailable, the workload also goes unavailable. apiVersion: v1 kind: Pod metadata: name: nginx namespace: default labels: app: nginx spec: containers: - image: nginx:1.13.9 name: nginx ports: - name: http containerPort: 80
  21. 29 A replicated, upgradeable set of Pods: A Deployment With

    a Deployment, you can manage Pods in a declarative and upgradable manner. Note the replicas field. Kubernetes will make sure that amount of Pods created from the template always are available. When the Deployment is updated, Kubernetes will perform an rolling update of the Pods running in the cluster. Kubernetes will create one new Pod, and remove an old until all Pods are new. apiVersion: apps/v1 kind: Deployment metadata: labels: app: nginx name: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - image: nginx:1.13.9-alpine name: nginx ports: - name: http containerPort: 80 The Pod Template
  22. 30 Various possible Deployment upgrade strategies The built-in Deployment behavior

    The other strategies can be implemented fairly easily by talking to the API. Picture source: Kubernetes effect by Bilgin Ibryam
  23. 31 Access your replicated Pods via a Service A Service

    exposes one or many Pods via a stable, immortal, internal IP address. It’s also accessible via cluster-internal DNS: {service}.{namespace}.svc.cluster.local, e.g. nginx.default.svc.cluster.local The Service selects Pods based on the label key-value selectors (here app=nginx) A Service may expose multiple ports. This ClusterIP can be declaratively specified, or dynamically allocated. apiVersion: v1 kind: Service metadata: name: nginx namespace: default labels: app: nginx spec: type: ClusterIP ports: - name: http port: 80 targetPort: 80 selector: app: nginx The Pod Selector
  24. 32 Expose your Service to the world with an Ingress

    A Service is only accessible inside of the cluster. In order to expose the Service to the internet, you must deploy an Ingress controller, like Traefik, and create an Ingress Rule The Ingress rule is the Kubernetes-way of mapping hostnames and paths from internet requests to cluster-internal Services. The Ingress controller is a loadbalancer that’s creating forwarding rules based on the Ingress Rules in the Kubernetes API. apiVersion: extensions/v1beta1 kind: Ingress metadata: name: nginx namespace: default labels: app: nginx spec: rules: - host: nginx.demo.kubernetesfinland.com http: paths: - path: / backend: serviceName: nginx servicePort: 80 The Service reference
  25. 33 Isolate your stuff in a Namespace Internet nginx.demo.kubernetesfinland.com Traefik

    as Ingress Controller Namespace: default nginx Ingress Rule nginx Service nginx Pod 1 nginx Pod 2 nginx Pod 3 nginx Deployment A Namespace is a logical isolation method, most resources are namespace-scoped. You can group logically similar workloads in one namespace and enforce different policies. You can e.g. have one namespace per team, and let them play in their own virtual environment. Role Based Access Control (RBAC) can be used to control what Kubernetes users can do, and what resources in what namespaces an user can access is one of the parameters to play with there.
  26. 35 How do I kick the tires with Kubernetes? Play

    with Kubernetes right away in your browser! Create a single-node cluster on your workstation with minikube Create a production-ready cluster on any machines with kubeadm Test out Kubernetes easily locally with kind (Kubernetes IN Docker) Explore Kubernetes Certified Service Providers’ solutions
  27. 36 Create a cluster with kubeadm 1. Provision a Linux

    machine with Ubuntu, Debian, RHEL, CentOS or Fedora 2. Install kubeadm: 3. Make kubeadm set up a master node for you: 4. Install a Pod Network solution from a third-party provider: 5. Repeat step 1 & 2 on an other node and join the cluster: curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - echo “deb http://apt.kubernetes.io/ kubernetes-xenial main” > /etc/apt/sources.list.d/kubernetes.list apt-get update && apt-get install -y kubeadm docker.io kubeadm init kubectl apply -f https://git.io/weave-kube-1.6 kubeadm join --token <token> <master-ip>:6443
  28. 37 Everything is done in Special Interest Groups Special Interest

    Groups (SIGs) manage Kubernetes’ various components and features. All code in the Kubernetes Github organization should be owned by one or more SIGs; with directory-level granularity. SIGs have regular (often weekly) video meetings where the attendees discuss design decisions, new features, bugs, testing, onboarding or whatever else that is relevant to the group. Attending these meetings is the best way to get to know the project Image source
  29. 38 Where is the community doing work? 1. On Slack:

    https://kubernetes.slack.com & http://slack.k8s.io 2. On Github: https://github.com/kubernetes (in ~150 repositories) 3. In weekly Special Interest Group (SIG), Working Group (WG) and Subproject meetings Check out the community repo: https://github.com/kubernetes/community Youtube archive of ALL meetings available in the Kubernetes Youtube channel 4. In the Kubernetes Community Meeting every Thursday 6pm - 7pm UTC https://github.com/kubernetes/community/blob/master/events/community-meeting.md 5. On the Discuss Kubernetes site: https://discuss.kubernetes.io/ 6. In Google Groups in #kubernetes-*, e.g. https://groups.google.com/forum/#!forum/kubernetes-dev 7. At meetups worldwide (~170 meetups / ~40 countries): https://www.meetup.com/pro/cncf/ 8. In the community Office Hours and Meet Our Contributors - Ask Us Anything series
  30. 39 How to start contributing? 1. Read as much of

    https://github.com/kubernetes/community as you can!! 2. Read the CONTRIBUTORS GUIDE 3. Find a SIG you’re interested to contribute to (e.g. SIG Cluster Lifecycle) 4. Create a Github account if you haven’t done so and sign up to the Kubernetes Slack: slack.k8s.io 5. Join the #sig-foo channels in Slack you’re interested in and #kubernetes-dev 6. Sign up to the #kubernetes-dev, #kubernetes-announce and #kubernetes-sig-foo mailing lists 7. Watch the New Contributor Series on Youtube from a New Contributor Summit 8. Check out the Codebase Tour in the “Meet Our Contributors” Youtube series 9. Learn how to use Kubernetes in more detail in this Free Kubernetes Course on edx.org 10. Join a weekly SIG meeting using Zoom and let them know you’d like to contribute :)
  31. 40 Kubernetes An Introduction Kubernetes v1.12 11/2018 CC-BY 4.0 Next

    step: Check out this AWESOME 182-slide Kubernetes workshop presentation, made by Bob Killen and Jeffrey Sica from the University of Michigan.