Share
Embed
Transcript
37 slides
-
© 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 -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 2
1 2 3 概要 K3sのインストール Kubernetes概要 4 5 Rancherのインストール Rancherの操作 アジェンダ 6 Q&A -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 3
共に学びましょう 本⽇のクラスのリポジトリ︓ https://github.com/qiang1981cn/k8s-training -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 4
リソース︓ドキュメント https://rancher.com/docs/ #rancherk8s -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 5
リソース︓コミュニティサポート http://forums.rancher.com #rancherk8s http://slack.rancher.io -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 6
リソース︓ ⽇本のRacherコミュニティ #rancherk8s http://slack.rancher.jp/ -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 9
K3sについて • CNCF認証付きの超軽量K8sディストリビューション • minikube/microk8s/kindと異なって、K3sは本番環境 でも使⽤できる • 軽量なバイナリ︓約512MBメモリ • K3supで簡単にインストール https://k3s.io https://k3sup.dev -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 10
K3dについて • DockerでマルチノードのK3sクラスタを構築 • 開発⽤のツール • Kubernetesの学習を簡単にする https://k3d.io/ -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 11
Demo K3s cluster installation -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 12
ü K8s Intro & Architecture ü Pods ü Deployments ü Services ü Ingresses ü Configmaps Kubernetes 101 #rancherk8s -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 13
Kubernetes l KubernetesɺίϯςφԽ͞ΕͨϫʔΫϩʔυαʔϏεΛཧ͢ΔͨΊͷɺ ϙʔλϒϧͰ֦ுੑͷ͋ΔΦʔϓϯιʔεϓϥοτϗʔϜͰ͢ l KubernetesɺYAMLܗࣜJSONܗࣜͰهड़ͨ͠એݴతͳίʔυʢظͳঢ় ଶʣʹΑͬͯɺσϓϩΠ͢ΔίϯςφपลϦιʔεΛཧ͠·͢ -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 14
Kubernetes Architecture API / CLI l ControlplaneΫϥε λʔཧػೳɺ"1*Πϯ λϑΣʔεΛఏڙ l Etcd: ΩʔόϦϡʔετ ΞͰɺKubernetesͷશͯ ͷΫϥελʔใͷอଘ ॴ l Worker: ίϯςφʢϫʔ Ϋϩʔυʣ͕࣮ࡍʹσϓ ϩΠ͞ΕΔϚγϯ -
© 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ͭͷϊʔυׂ͕ΓͯΒΕ͍ͯΔ -
© 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 -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 18
Declarative and Repeatable Actions • infrastructure-as-code方式でクラスタとワークロードを デプロイ管理 • Terraform • Ansible • Kustomize • Yamlコードはコードリポジトリに管理 • コードリポジトリにsecretsを保存しないよう -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 20
Kubernetes Resources - Deployment l Podཧ͢ΔͨΊͷ্ҐͷநϦιʔε l ෳͷಉ͡ͷ1PEΛάϧʔϓͰཧ l Updating l Scaling l Rollback l ϫʔΫϩʔυͷݱঢ়ଶ͔ΒϢʔβʔظͷঢ়ଶࣗ ಈʹมߋ -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 21
Kubernetes – Declarative Syntax ✓ -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 22
Click to add text Demo: Deployments with the K8s CLI -
© 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छྨ -
© 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 -
© 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) ͷػೳΛఏڙ -
© 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 -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 29
Demo: Exposing applications in K8s -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 31
ConfigMaps l ΞϓϦઃఆΛΞϓϦ͔Β͢ΈΛఏڙ l ༻͢Δͱ͜Ζɿ ΞϓϦڥม ΞϓϦͷઃఆσʔλ l όʔδϣϯཧɺઃఆใҰݩཧ l ύεϫʔυɺೝূτʔΫϯɺAPIΩʔͳͲͷػີ σʔλͷอଘʹ༻͠ͳ͍Α͏ -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 32
Injecting application configuration with a ConfigMap -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 33
33 ConfigMaps / Rolling Updates -
© 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 -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 35
Rancher Demo Time -
© 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 -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 37
1000+ sign-ups on launch day! -
© 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 -
© Copyright 2020 Rancher Labs. All Rights Reserved. Confidential 39
39 ご参加ありがとうございました