Rancher Virtual Rodeo Japan 2020/07「入門編」

3218b28de1401d518a2fdfa198bec1b5?s=47 cheng
July 02, 2020

Rancher Virtual Rodeo Japan 2020/07「入門編」

Rancher Virtual Rodeosは、DevOpsおよびITチームがKubernetesをどこにでもデプロイして管理するために、必要かつ実践的なスキルを提供するように設計された無料のオンラインワークショップです。コンテナおよびKubernetesの使用方法について興味がある方に向けたこのワークショップはRancherのテクニカルエキスパートによって実施されます。テクニカルエキスパートがRancher、Docker、Kubernetesをご紹介、Kubernetesクラスタをデプロイするための手順をご説明します。

今回はRancher Virtual Rodeo Japan「入門編」を実施します。コンテナ、KubernetesのメリットからRodeoのご紹介をメインにハンズオンも行います。今後は実践編なども企画しますので、このワークショップへのご理解を深めていただく内容とします。

Rancher Virtual Rodeoが実施する主要なトピックには次のものが含まれます。
DockerおよびKubernetesおさらい
Lab環境(HobbyFarm)説明
RKEによるクラスター構築
Rancher Server構築
Rancherによるクラスター構築
hello-worldアプリケーションをクラスターにデプロイ
WordPressをクラスターにデプロイ

3218b28de1401d518a2fdfa198bec1b5?s=128

cheng

July 02, 2020
Tweet

Transcript

  1. © Copyright 2019 Rancher Labs. All Rights Reserved. Confidential 1

    © Copyright 2020 Rancher Labs. All Rights Reserved. 1 Rancher Rodeo Online Workshop Cheng Rancher Labs
  2. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 2

    Objectives for the day l Docker͓ΑͼKubernetes͓͞Β͍ l Lab؀ڥ HobbyFarm આ໌ l RKEʹΑΔΫϥελʔߏங l Rancher Serverߏங l RancherʹΑΔΫϥελʔߏங l hello-worldΞϓϦέʔγϣϯΛΫϥελʔʹσϓϩΠ l WordPressΛΫϥελʔʹσϓϩΠ
  3. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 3

    Forewarning l ͜ͷRodeo͸ɺKubernetesͱRancherͷॳ৺ऀ޲͚ʹઃܭ͞Ε͍ͯ·͢ l ͜͜ʹ঺հ͞Ε͍ͯΔ಺༰͸ɺඞͣ͠΋ຊ൪؀ڥͰͷӡ༻ํ๏Ͱ͸͋Γ·ͤ Μ͕ɺຊ൪؀ڥ޲͚ͷجૅ஌ࣝͱߟ͍͖͍͑ͯͨͩͨͰ͢
  4. © Copyright 2019 Rancher Labs. All Rights Reserved. Confidential 4

    4 Container Images
  5. © Copyright 2020 Rancher Labs. All Rights Reserved. 5 Container

    Image Application Code Application Dependencies Container Image
  6. © Copyright 2020 Rancher Labs. All Rights Reserved. 6 Container

    Image Container Image Container Container Container
  7. © Copyright 2019 Rancher Labs. All Rights Reserved. Confidential 7

    7 Containers
  8. © Copyright 2020 Rancher Labs. All Rights Reserved. 8 Containers

    l ΠϝʔδΛݩʹ࡞੒͞ΕΔԾ૝؀ڥͷ࣮ߦ෦෼ʢinstanceʣ l ϙʔλϏϦςΟr ΞϓϦέʔγϣϯΛ̍ճϏϧυ͢Ε͹ɺͲ͜Ͱ΋ಉ࣮͘͡ߦͰ͖Δ l ΞϓϦέʔγϣϯΛɺܰྔͳִ཭͞Εͨ؀ڥʹ࣮ߦͰ͖Δ l ΞϓϦέʔγϣϯͷΠϯελϯεΛਫฏํ޲ʹ؆୯ʹεέʔϦϯάͰ͖Δ
  9. © Copyright 2020 Rancher Labs. All Rights Reserved. 9 Containers

    Source : https://www.docker.com/resources/what-container
  10. © Copyright 2019 Rancher Labs. All Rights Reserved. Confidential 10

    10 Registries
  11. © Copyright 2020 Rancher Labs. All Rights Reserved. 11 Registries

  12. © Copyright 2020 Rancher Labs. All Rights Reserved. 12 Registries

    l ΠϝʔδΛ֨ೲ͢ΔͨΊͷ৔ॴ l Public l Private l On-prem / Cloud l ੡඼ྫ l Amazon Elastic Container Registry l Azure Container Registry l Docker Hub l Ұ෦ͷ੡඼͸ػೳ֦ு΋͍ͯ͠Δ l Vulnerability scanning l LDAP / AD Support l Auditing l Replication l etc
  13. © Copyright 2020 Rancher Labs. All Rights Reserved. 13 Containers

    are great……..but Managing a couple – no problem
  14. © Copyright 2020 Rancher Labs. All Rights Reserved. 14 Containers

    are great……..but How about managing many? How do we address: Networking, Security, Scheduling, Automation, etc?
  15. © Copyright 2019 Rancher Labs. All Rights Reserved. Confidential 15

    15 K8s – Container Orchestration
  16. © Copyright 2020 Rancher Labs. All Rights Reserved. 16 Kubernetes

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

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

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

    Resources - Deployment l ෳ਺ͷಉ͡ Pod Λ؅ཧ͢ΔͨΊͷϦιʔε l ෳ਺ͷಉ͡ 1PEΛάϧʔϓͰ؅ཧ l Updating l Scaling l Rollback l ݱࡏͷঢ়ଶΛࢦఆ͞Εͨঢ়ଶ΁มߋ
  20. © Copyright 2020 Rancher Labs. All Rights Reserved. 20 Kubernetes

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

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

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

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

    KubernetesΤίγεςϜ͕ɺ๲େͳ΋ͷͰ͢ - https://landscape.cncf.io (These are just the Storage projects)
  26. © Copyright 2020 Rancher Labs. All Rights Reserved. 26 RancherがKubernetesにもたらすもの

    26 Network & Storage Registry App Catalog Monitoring Kubernetes Container Runtime CI/CD Service Mesh Logging Security RBAC & PSP Authentication What Rancher takes an SLA on Manage all this? … or this? Rancher Certified Integrations Cloud Datacenter Dev Branch Edge Google GKE Azure AKS Amazon EKS
  27. © Copyright 2020 Rancher Labs. All Rights Reserved. 27 Lab環境(HobbyFarm)説明

    l https://learn.eu1.hobbyfarm.io/login ΁ΞΫηε l [e-mail] ɺ [Access Code]ɺٴͼ[password] ͰϢʔβʔΛొ࿥ l Access Code:
  28. © Copyright 2020 Rancher Labs. All Rights Reserved. 28 Lab環境(HobbyFarm)説明

    l [e-mail] ɺ [password] ͰϩάΠϯ
  29. © Copyright 2020 Rancher Labs. All Rights Reserved. 29 Lab環境(HobbyFarm)説明

    l [Start Scenario] Ͱ։࢝
  30. © Copyright 2020 Rancher Labs. All Rights Reserved. 30 Lab環境(HobbyFarm)説明

    l ؀ڥߏ੒ αʔόʔɿrancher01 αʔόʔɿcluster01
  31. © Copyright 2020 Rancher Labs. All Rights Reserved. 31 31

    What is RKE RKE͸ɺΫϥ΢υɺΦϯϓϨϛεɺٴͼϩʔΧϧ؀ڥʹkubernetesΫϥελ Λ؆୯ʹσϓϩΠͰ͖ΔCLIπʔϧͰ͢ɻ
  32. © Copyright 2020 Rancher Labs. All Rights Reserved. 32 32

    What is RKE ಛ௃ • ର৅ϊʔυʹ44)઀ଓͯ͠ϓϩϏδϣχϯάΛ࣮ࢪ • LVCFSOFUFTͷ֤छίϯϙʔωϯτ FUDE΍BQJTFSWFSͳ Ͳ Λίϯςφͱͯ͠ىಈ • )"ͳΫϥελΛߏஙՄೳ
  33. © Copyright 2020 Rancher Labs. All Rights Reserved. 33 33

    What is RKE ࢖͍ํ • ࣄલʹΫϥελʔ༻ͷϊʔυΛ༻ҙ • SLFఆٛϑΝΠϧΛ࡞੒ • SLF VQ࣮ߦͰΫϥελʔߏங
  34. © Copyright 2020 Rancher Labs. All Rights Reserved. 34 34

    What is RKE
  35. © Copyright 2019 Rancher Labs. All Rights Reserved. Confidential 35

    © Copyright 2020 Rancher Labs. All Rights Reserved. 35 Intermission