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
  2. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 2

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

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

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

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

    リソース︓ ⽇本のRacherコミュニティ #rancherk8s http://slack.rancher.jp/
  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
  8. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 10

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

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

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

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

    Declarative and Repeatable Actions • infrastructure-as-code方式でクラスタとワークロードを デプロイ管理 • Terraform • Ansible • Kustomize • Yamlコードはコードリポジトリに管理 • コードリポジトリにsecretsを保存しないよう
  15. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 20

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

    Click to add text Demo: Deployments with the K8s CLI
  17. © 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छྨ
  18. © 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
  19. © 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) ͷػೳΛఏڙ
  20. © 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
  21. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 31

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

    Injecting application configuration with a ConfigMap
  23. © 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
  24. © 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
  25. © 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
  26. © Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 39

    39 ご参加ありがとうございました