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

Japan International Kubernetes Day

cheng
January 28, 2021

Japan International Kubernetes Day

KubernetesとRancherの紹介

cheng

January 28, 2021
Tweet

More Decks by cheng

Other Decks in Technology

Transcript

  1. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 1
    © Copyright 2020 Rancher Labs. All Rights Reserved.
    KubernetesとRancherの紹介
    2021/01/28 JAPAN
    Japan International Kubernetes Day

    View full-size slide

  2. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 2
    1
    2
    3
    概要
    K3sのインストール
    Kubernetes概要
    4
    5
    Rancherのインストール
    Rancherの操作
    アジェンダ
    6 Q&A

    View full-size slide

  3. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 3
    共に学びましょう
    本⽇のクラスのリポジトリ︓
    https://github.com/qiang1981cn/k8s-training

    View full-size slide

  4. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 4
    リソース︓ドキュメント
    https://rancher.com/docs/
    #rancherk8s

    View full-size slide

  5. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 5
    リソース︓コミュニティサポート
    http://forums.rancher.com
    #rancherk8s
    http://slack.rancher.io

    View full-size slide

  6. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 6
    リソース︓ ⽇本のRacherコミュニティ
    #rancherk8s
    http://slack.rancher.jp/

    View full-size slide

  7. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 9
    K3sについて
    • CNCF認証付きの超軽量K8sディストリビューション
    • minikube/microk8s/kindと異なって、K3sは本番環境
    でも使⽤できる
    • 軽量なバイナリ︓約512MBメモリ
    • K3supで簡単にインストール
    https://k3s.io
    https://k3sup.dev

    View full-size slide

  8. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 10
    K3dについて
    • DockerでマルチノードのK3sクラスタを構築
    • 開発⽤のツール
    • Kubernetesの学習を簡単にする
    https://k3d.io/

    View full-size slide

  9. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 11
    Demo K3s cluster installation

    View full-size slide

  10. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 12
    ü K8s Intro & Architecture
    ü Pods
    ü Deployments
    ü Services
    ü Ingresses
    ü Configmaps
    Kubernetes 101
    #rancherk8s

    View full-size slide

  11. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 13
    Kubernetes
    l
    Kubernetes͸ɺίϯςφԽ͞ΕͨϫʔΫϩʔυ΍αʔϏεΛ؅ཧ͢ΔͨΊͷɺ
    ϙʔλϒϧͰ֦ுੑͷ͋ΔΦʔϓϯιʔεϓϥοτϗʔϜͰ͢
    l
    Kubernetes͸ɺYAMLܗࣜ΍JSONܗࣜͰهड़ͨ͠એݴతͳίʔυʢظ଴ͳঢ়
    ଶʣʹΑͬͯɺσϓϩΠ͢Δίϯςφ΍पลϦιʔεΛ؅ཧ͠·͢

    View full-size slide

  12. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 14
    Kubernetes Architecture
    API / CLI
    l
    ControlplaneΫϥε
    λʔ؅ཧػೳɺ"1*Πϯ
    λϑΣʔεΛఏڙ
    l
    Etcd: ΩʔόϦϡʔετ
    ΞͰɺKubernetesͷશͯ
    ͷΫϥελʔ৘ใͷอଘ
    ৔ॴ
    l
    Worker: ίϯςφʢϫʔ
    Ϋϩʔυʣ͕࣮ࡍʹσϓ
    ϩΠ͞ΕΔϚγϯ

    View full-size slide

  13. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 15 15
    Pods

    View full-size slide

  14. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 16
    Kubernetes Resources - Pod
    l
    ϫʔΫϩʔυͷ࠷খ୯Ґ
    l
    αʔόʔԾ૝Խʹ͓͍ͯɺhypervisor্ͷ1ͭͷ
    VM૬౰ͷײ͡
    l
    1ͭҎ্ͷίϯςφΛؚΉ
    l
    ԼهϦιʔε΋ؚΉ:
    l
    Storage (ie shared volumes)
    l
    Networking
    l
    1ͭͷϊʔυׂ͕Γ౰ͯΒΕ͍ͯΔ

    View full-size slide

  15. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 17
    apiVersion: v1
    kind: Pod
    metadata:
    name: myapp-pod
    labels:
    app: myapp
    spec:
    containers:
    - name: myapp-container
    image: busybox
    command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 1']
    Basic Pod Spec

    View full-size slide

  16. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 18
    Declarative and Repeatable Actions
    • infrastructure-as-code方式でクラスタとワークロードを
    デプロイ管理

    Terraform

    Ansible

    Kustomize
    • Yamlコードはコードリポジトリに管理
    • コードリポジトリにsecretsを保存しないよう

    View full-size slide

  17. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 19 19
    Deployments

    View full-size slide

  18. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 20
    Kubernetes Resources - Deployment
    l
    Pod؅ཧ͢ΔͨΊͷ্Ґͷந৅Ϧιʔε
    l
    ෳ਺ͷಉ͡ͷ1PEΛάϧʔϓͰ؅ཧ
    l
    Updating
    l
    Scaling
    l
    Rollback
    l
    ϫʔΫϩʔυͷݱঢ়ଶ͔ΒϢʔβʔظ଴ͷঢ়ଶ΁ࣗ
    ಈʹมߋ

    View full-size slide

  19. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 21
    Kubernetes – Declarative Syntax

    View full-size slide

  20. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 22
    Click to add text
    Demo: Deployments with the K8s CLI

    View full-size slide

  21. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 23 23
    Services

    View full-size slide

  22. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 24
    Kubernetes Resources - Service
    l
    Pod͸ඞͣ͠΋Ӭଓੑ͕ߴ͍΋ͷͰ͸ͳ͍
    l
    Podʹ௚઀ΞΫηε͠ͳ͍Ͱʂ
    l
    Podsͷू߹Ͱ࣮ߦ͞Ε͍ͯΔΞϓϦέʔγϣϯΛ
    ωοτϫʔΫαʔϏεͱͯ͠ެ։͢Δந৅తͳํ๏
    l
    Podͷηοτʹର͢Δ୯ҰͷIP/DNS໊Λఏڙ
    l
    Services͸಺෦ΞΫηε޲͚(ClusterIP)ͱ ֎෦ΞΫη
    ε޲͚(NodePort & Loadbalancer)ͷ2छྨ

    View full-size slide

  23. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 25
    Kubernetes Resources - Service
    10.42.0.4 10.42.0.5 10.42.0.6
    Endpoints:
    10.42.0.4
    10.42.0.5
    10.42.0.6
    Type : LoadBalancer
    10.42.0.7
    Endpoints:
    10.42.0.4
    10.42.0.5
    10.42.0.7

    View full-size slide

  24. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 26 26
    Ingresses

    View full-size slide

  25. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 27
    Kubernetes Resources - Ingress
    l
    Ϋϥελʔ಺෦ͷServiceʹର͢Δ֎෦͔ΒͷΞΫηε
    Λ؅ཧ
    l
    ओʹHTTP
    l
    Serviceʹରͯ͠ɺ֎෦͔ΒΞΫηεͳՄೳURLΛఏڙ
    l
    ໊લϕʔεͷԾ૝ϗεςΟϯάͷػೳΛఏڙ
    l
    ෛՙ෼ࢄ(Load Balance traffic) ͷػೳΛఏڙ
    l
    SSLऴ୺(Terminate) ͷػೳΛఏڙ

    View full-size slide

  26. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 28
    Kubernetes Resources - Ingress
    Kubernetes Cluster
    /bar
    /foo
    ServiceA ServiceB
    foo.bar.com/bar
    foo.bar.com/foo

    View full-size slide

  27. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 29
    Demo: Exposing
    applications in K8s

    View full-size slide

  28. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 30 30
    Configmaps

    View full-size slide

  29. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 31
    ConfigMaps
    l
    ΞϓϦઃఆΛΞϓϦ͔Β੾཭͢࢓૊ΈΛఏڙ
    l
    ࢖༻͢Δͱ͜Ζɿ
    ΞϓϦ؀ڥม਺
    ΞϓϦͷઃఆσʔλ
    l
    όʔδϣϯ؅ཧɺઃఆ৘ใҰݩ؅ཧ
    l
    ύεϫʔυɺೝূτʔΫϯɺAPIΩʔͳͲͷػີ
    σʔλͷอଘʹ͸࢖༻͠ͳ͍Α͏

    View full-size slide

  30. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 32
    Injecting application configuration with a ConfigMap

    View full-size slide

  31. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 33 33
    ConfigMaps / Rolling Updates

    View full-size slide

  32. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 34
    Rapid growth of Kubernetes is exposing the need for
    centralized Management
    Shared Tooling & Services
    Security & Authentication
    Simplified Cluster Operations & Infrastructure Management
    Policy management
    Pod & network
    security policies
    CIS benchmark
    monitoring
    RBAC
    policies
    Configuration
    enforcement
    Visibility &
    diagnostics
    Centralized
    audit
    Monitoring
    & alerting
    Kubernetes version
    management
    Node pool
    management
    Cluster
    provisioning
    Amazon
    EKS
    Azure
    AKS
    Google
    GKE
    Cloud
    Datacenter Dev Branch Edge
    Secure Application Deployment
    Routing Autoscaling
    Metrics
    Load Balancing Canary Git Deployments

    View full-size slide

  33. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 35
    Rancher Demo Time

    View full-size slide

  34. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 36
    Rancher Academy is here!
    • Video introductions
    • Theory work
    • Demonstrations
    • Hands-on labs
    • Quizzes
    • A graded final exam
    • Certification
    Gain in-depth knowledge and the
    confidence to best deploy, use, and
    manage Kubernetes with Rancher.
    Go to: academy.rancher.com

    View full-size slide

  35. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 37
    1000+ sign-ups on launch day!

    View full-size slide

  36. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 38
    Join other Rancher users in Slack
    https://slack.rancher.io
    http://slack.rancher.jp/
    #Kubernetes channel

    View full-size slide

  37. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 39 39
    ご参加ありがとうございました

    View full-size slide