Slide 1

Slide 1 text

Azure Tech Lab #2 2019.3.6 © 2019 cyberblack28 Azure with rancher !!

Slide 2

Slide 2 text

Profile Twitter:cyberblack28 Hatena Blog:https://cyberblack28.hatenablog.com/ Job Educational Solution Architect Developer Advocate / Technical Evangelist Infrastructure Engineer Frontend Engineer Community Music,Live,FES !! Take a picture !! https://www.flickr.com/photos/cyberblack ISBN-10: 4798155373 ISBN-13: 978-4798155371 I wrote the Chapter 6 Rancher 2.0 part. Release on March 15, 2018 #rancherjp #kujiraya #deepcn

Slide 3

Slide 3 text

Profile http://bit.ly/thinkit_rancher

Slide 4

Slide 4 text

AP Communications Co., Ltd We’re hireling !! Docker Kubernetes Rancher CloudNative

Slide 5

Slide 5 text

1. What’s Rancher 2. Azure with Rancher 3. Multi-Cluster Apps 4. Information Agenda

Slide 6

Slide 6 text

What’s RancheR

Slide 7

Slide 7 text

What’s Rancher ? • クラウド、オンプレミス問わずコンテナー環境の構築、運用するためのコンテナー管理プラット フォーム • ホスト(ノード)とコンテナーの管理、アプリケーションのデプロイ、オーケストレーション環 境の自動構築を実現 • 開発はRancher Labs(http://rancher.com/) • オープンソースソフトウェア(サポート付の有償版あり)

Slide 8

Slide 8 text

Difference between Rancher 1.6 and 2.1 1.6 2.1 • カタログ機能(docker-compose対応)によるワンクリッ クデプロイ • Networkとして、ipsec,vxlanをサポート • Storageとして、NFS,EBSをサポート • Architectureとして、Dockerベース • JavaとGoで書かれ、MySQLを使用 • マルチオーケストレーションサポート • Architectureとして、kubernetesベース • 100%Goで書かれ、etcdを使用 • オーケストレーションは、100% kubernetes • カタログ機能(Helm対応)によるワンクリックデプロイ • Networkは、flannel,canal,Calico等、kubernetesプラグイ ンを随時対応予定 • Storageは、kubernetesで利用可能なものは随時対応予定

Slide 9

Slide 9 text

Feature of Rancher2.1 Kubernetes Clusters Create Import EKS GKE AKS vSphere Bare Metal Create,Import,Manage Kubernetes Clusters !! Manage “Kubernetes Everywhere”

Slide 10

Slide 10 text

Feature of Rancher2.1 Kubernetes Clusters Create Import EKS GKE AKS vSphere Bare Metal Create,Import,Manage Kubernetes Clusters !! Manage Kubernetes is becoming the Linux of the cloud by Jim Zemlin (The Linux Foundation)

Slide 11

Slide 11 text

Feature of Rancher2.1 Kubernetes Clusters Create Import EKS GKE AKS vSphere Bare Metal Create,Import,Manage Kubernetes Clusters !! Manage Kubernetes is becoming the Linux of the cloud by Jim Zemlin (The Linux Foundation) Multi Cloud to Multi Kubernetes CloudNtive to KubernetesNative

Slide 12

Slide 12 text

Feature of Rancher2.1 Kubernetes Clusters Create Import EKS GKE AKS vSphere Bare Metal Create,Import,Manage Kubernetes Clusters !! Manage Kubernetes is becoming the Linux of the cloud by Jim Zemlin (The Linux Foundation) Multi Cloud to Multi Kubernetes CloudNtive to KubernetesNative

Slide 13

Slide 13 text

Feature of Rancher2.1 One Click Deployment ! ! カタログ一覧から選択して、起動ボタンをクリックするだ けで、アプリケーションをデプロイできます。 Creating Private Catalogs ! ! 個人で作成したカタログも登録できます。

Slide 14

Slide 14 text

Feature of Rancher2.1 Major developer catalogs

Slide 15

Slide 15 text

Rancher v2.1.0 • Rancher1系のCattle OrchestratorからRancher2系のKubernetesのマイグレーション機能 • Windows Kubernetesクラスタの実験的サポート 「Rancher 2.1を使ってWindows NodeをKubernetesクラスタに参加させる」http://ur0.link/PjA3 Main outline • Latest - v2.1.6 - rancher/rancher:latest • Stable - v2.1.6 - rancher/rancher:stable Version Rancher Release - v2.1.0 http://urx3.nu/MJA0 Details

Slide 16

Slide 16 text

Rancher 2.1 Technical Architecture Kubelet Kubelet Cluster Controller Auth Proxy Rancher Server RKE Nodes Kubectl Kubernetes API Rancher UI CLI API Rancher Component Other Kubernetes Master Legend Rancher API Server etcd Cluster Agent 1 Cluster Agent 2 RKE Kubernetes Master GKE Nodes GKE Kubernetes Master Kubelet Kubelet Kubelet Kubelet コンポーネント 概要 Rancher API Server ユーザー管理機能、認証機能、名前空間のグループ化、全 NodeのIDを追跡 Cluster Controller クラスタ、プロジェクトへのアクセス制御ポリシー管理、 クラスタセットアップ Cluster Agents ワークロード管理、グローバルポリシーで定義されている ロールと制約のクラスタ適用、クラスタからRancher Serverへ情報伝播 Auth Proxy 全てのkubernetes APIの呼び出しをプロキシし、ローカル 認証、AD、GitHub等の認証サービスと統合

Slide 17

Slide 17 text

Rancher 2.1 Technical Architecture https://www.slideshare.net/linecorp/lets-unbox-rancher-20-v200

Slide 18

Slide 18 text

Rancher Labs New Project “Rio” Kubernetes, Istio, Service Mesh like Docker Darren Shepherd Co-founder and Chief Architect at Rancher Labs, Inc. @ibuildthecloud https://github.com/rancher/rio https://www.slideshare.net/cyberblackvoom/whats-rio-112779732 Rioの資料はこちら!!

Slide 19

Slide 19 text

Get started with Rancher 2.1 OS Hardware Software Ubuntu 16.04 (64-bit) Memory: 4GB • 1.12.6 • 1.13.1 • 17.03.X Red Hat Enterprise Linux 7.5 (64-bit) RancherOS 1.3.0 (64-bit) Step 2: Start the server $ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher Web Access!! https:// Step 1: Prepare a Linux Host

Slide 20

Slide 20 text

Azure with Rancher

Slide 21

Slide 21 text

Azure with Rancher Create Import Manage AKS Virtual Machines “Kubernetes Everywhere”

Slide 22

Slide 22 text

2.Azure Setup Azure with Rancher 3.Azure VM Provisioning & WordPress Deploy by Catalog 5.Prometheus Setup 4.AKS Provisioning & GuestBook Deploy by kubectl 1.Rancher Server Setup

Slide 23

Slide 23 text

Azure with Rancher 1.Rancher Server Setup 1.Virtual Machines 項目 入力概要 リソースグループ (新規)rancher 仮想マシン名 rancher-server 地域 東日本 イメージ Ubuntu Server 16.04 LTS サイズ Standard D2s v3 認証の種類 パスワード ユーザー名 ubuntu パスワード 任意のパスワード パスワード確認 任意のパスワード パブリック受信ポート 選択したポートを許可する 受信ポート選択 SSH,HTTP,HTTPS ※上記以外はデフォルト設定

Slide 24

Slide 24 text

Azure with Rancher 2.Docker Install $ curl https://releases.rancher.com/install-docker/17.03.2.sh | sh 3.Rancher v2.2.0-Alpha6 Server Install $ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:v2.2.0-alpha6 4.RancherUI Access https://パブリックIPアドレス/ adminユーザのパスワード作成 Rancher Server URLの登録 ログイン完了 5.初回ログイン

Slide 25

Slide 25 text

Azure with Rancher 2.Azure Setup 1.Subscription Check 左メニュー「すべてのサービス」 > 「サブスクリプション」 サブスクリプションIDはRancherと連携 する際に必要となるのでテキストエディ タなどに保存しておきます。

Slide 26

Slide 26 text

Azure with Rancher 2.Application Register 左メニュー「Azure Active Directory」 > 「アプリの登録」>「新しいアプリケーションの登録」

Slide 27

Slide 27 text

Azure with Rancher 名前に「rancher」、サインオンURLに「https://パブリックIPアドレス/」(Rancher Server URL)を入力して、「作成」ボタンを押下

Slide 28

Slide 28 text

Azure with Rancher 「設定」を選択して、「キー」を選択 アプリケーションIDはRancherと連携す る際に必要となるのでテキストエディタ などに保存しておきます。

Slide 29

Slide 29 text

Azure with Rancher 説明に「rancher」と入力、有効期限「1年」と入力して、「保存」ボタンを押下 値はRancherと連携する際に必要となる のでテキストエディタなどに保存してお きます。

Slide 30

Slide 30 text

Azure with Rancher 3.Role Setup 左メニュー「すべてのサービス」 > 「サブスクリプション」>「利用中のサブスクリプション選択」 「アクセス制御(IAM)」を選択 「ロールの割り当ての追加」を選択 名前に「所有者」、選択「rancher」と 入力して、「rancher」アイコンをク リック、「保存」ボタンが青色に変わる ので押下

Slide 31

Slide 31 text

Azure with Rancher 4.DirectoryID Check 左メニュー「Azure Active Directory」 > 「プロパティ」 ディレクトリIDはRancherと連携する際 に必要となるのでテキストエディタなど に保存しておきます。

Slide 32

Slide 32 text

Azure with Rancher 3. Azure VM Provisioning & WordPress Deploy by Catalog 1.上部メニュー「Catalogs」を選択して、Helm Stableを「Enabled」に変更

Slide 33

Slide 33 text

Azure with Rancher 2.「Add Cluster」ボタンを押下

Slide 34

Slide 34 text

Azure with Rancher 3.「Azure」を選択、「Cluster Name」に任意名を入力

Slide 35

Slide 35 text

Azure with Rancher 4.「Add Node Template」ボタンを押下

Slide 36

Slide 36 text

Azure with Rancher 5.1~5を入力して、「Create」ボタンを押下 1.「Japan East」を選択 2.サブスクリプションIDを入力 3.アプリケーションIDを入力 4.アプリケーション登録時に作 成したキーを入力 5.任意名を入力

Slide 37

Slide 37 text

Azure with Rancher 6.1~2を入力して、「Create」ボタンを押下 1.任意名を入力 2.「etcd」,「Control Plane」, 「Worker」にチェック

Slide 38

Slide 38 text

Azure with Rancher 7.クラスタ名をクリック

Slide 39

Slide 39 text

Azure with Rancher 8.リソース状況を確認

Slide 40

Slide 40 text

Azure with Rancher 9.Firewall設定 左メニュー「Virtual Machines」 > 「azure-kubernetes-cluster1」>「ネットワーク」-「受信ポートの規則を追加する」 1.「*」と入力 2.「all」と入力 3.「追加」ボタンを押下

Slide 41

Slide 41 text

Azure with Rancher 10.上部メニュー「azure-kubernetes-cluster」-「Default」を選択

Slide 42

Slide 42 text

Azure with Rancher 11.上部メニュー「Catalog Apps」を選択して、「Launch」ボタンを押下

Slide 43

Slide 43 text

Azure with Rancher 12.検索フィールド「weave」と入力して、weave-scopeの「View Details」ボタンを押下

Slide 44

Slide 44 text

Azure with Rancher 13. 「Launch」ボタンを押下

Slide 45

Slide 45 text

Azure with Rancher 14.weavescopeがデプロイされたことを確認し、上部メニュー「Workloads」を選択

Slide 46

Slide 46 text

Azure with Rancher 15.ナビゲーションメニュー「Load Balancing」を選択し、「Add Ingress」ボタンを押下

Slide 47

Slide 47 text

Azure with Rancher 16.1~4を設定して、「Save」ボタンを押下 1.任意名を入力 2.「weave-scope」 を選択 3.「weave-scope-frontend-weave-scope」を選択 4.「4040」を入力

Slide 48

Slide 48 text

Azure with Rancher 17.生成されたURLをクリック

Slide 49

Slide 49 text

Azure with Rancher 18.weavescopeにアクセス完了

Slide 50

Slide 50 text

Azure with Rancher 4.AKS Provisioning & GuestBook Deploy by kubectl 1.「Add Cluster」ボタンを押下

Slide 51

Slide 51 text

Azure with Rancher 2.1~4を入力して、「Next: Authenticate & configure nodes」ボタンを押下 2.サブスクリプ ションIDを入力 4.アプリケーショ ンIDを入力 5.アプリケーション登 録時に作成したキーを 入力 3.ディレクトリID を入力 1.任意名を入力

Slide 52

Slide 52 text

Azure with Rancher 3.Cloud Shellを有効 1.「Cloud Shell」アイコンを クリック 2.「bash」を選択

Slide 53

Slide 53 text

Azure with Rancher 4.「ストレージの作成」ボタンを押下

Slide 54

Slide 54 text

Azure with Rancher 5.Cloud Shellで鍵を作成 $ ssh-keygen -t rsa -b 2048 Generating public/private rsa key pair. Enter file in which to save the key (/home/iyutaka2018/.ssh/id_rsa): Created directory '/home/iyutaka2018/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/iyutaka2018/.ssh/id_rsa. Your public key has been saved in /home/iyutaka2018/.ssh/id_rsa.pub. The key fingerprint is: SHA256:4pcttK54q2eQV20X6vk0zp1fv2TB98pAAKYr1VTMovc iyutaka2018@cc-ede459bd-77c44fd696-ztl9q The key's randomart image is: +---[RSA 2048]----+ | ++. | | =..o . | | o..o.. . | | ...o +.. . | | ..ooS+ o. o.| | oo.o +E.o +| | o. = .=.o +o| | .+o . +o=.o| | o=oo. oo+| +----[SHA256]-----+ 6.Cloud Shellで鍵を作成 $ cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmGXLVGIdT016+z52PcV0nak4Ju3BhER6fEZv07M59dmfROv0av1u2A+xv5+EX RIbk1EkToLp00WsS3MxuMmzJt6VgUUQXsf3Hv6z9ElRs3rOFV9dZPje5EpIOWKsiLBo3epdWtadUhe91xgL4l2j+/1Ah/O+6trTgd svzkxM1ZnVoeLkVfV8w4J4nbWzDUSfAD6s+c3hQ4DManW37arJG1koV8KsqhBoX6p5NUMLWLzdzqr/dfzAVNS81sIuxlYrI0B7 UcH1Vn+OmZ2HCIZ3jCEva6rEcBHG+29/xaWwMNXnFPrSm9Nd68tZrmQafNmQYESpfpmzJGQLaOltP4CsX iyutaka2018@cc-f163abae-78c69bb888-jgmkm

Slide 55

Slide 55 text

Azure with Rancher 7.1~3を入力して、「Create」ボタンを押下 1.任意名を入力 2.「2」と入力 3.Cloud Shellで作成した公開鍵を入力

Slide 56

Slide 56 text

Azure with Rancher 8.AKSクラスタ名をクリック

Slide 57

Slide 57 text

Azure with Rancher 9.AKSクラスタのリソース状況を確認 Controller Managerと Schedulerが unhealthyなのは AKS側の問題のよ うでissue対応中

Slide 58

Slide 58 text

Azure with Rancher 10.「Launch kubectl」ボタンを押下

Slide 59

Slide 59 text

Azure with Rancher 11.「Launch kubectl」ボタンを押下

Slide 60

Slide 60 text

Azure with Rancher 12.AKSクラスタのNode状況確認 # Run kubectl commands inside here # e.g. kubectl get all > kubectl get nodes NAME STATUS ROLES AGE VERSION aks-ranche-31062791-0 Ready agent 3h v1.12.5 aks-ranche-31062791-1 Ready agent 3h v1.12.5 > 13.Guestbookアプリケーションをデプロイ > kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook/all-in-one/guestbook-all-in- one.yaml service "redis-master" unchanged deployment.apps "redis-master" unchanged service "redis-slave" unchanged deployment.apps "redis-slave" unchanged service "frontend" unchanged deployment.apps "frontend" unchanged > 14.「Close」ボタンを押下

Slide 61

Slide 61 text

Azure with Rancher 15.上部メニュー「aks-kubernetes-cluster」-「Default」を選択

Slide 62

Slide 62 text

Azure with Rancher 16.ナビゲーションメニュー「Service Discovery」を選択して、frontendの「View/Edit YAML」を選択

Slide 63

Slide 63 text

Azure with Rancher 17.「ClusterIP」を「LoadBalancer」に変更して、「Save」ボタンを押下

Slide 64

Slide 64 text

Azure with Rancher 18.しばらくすると「80/tcp」と表示されるので、クリック

Slide 65

Slide 65 text

Azure with Rancher 19.Guestbookにアクセス完了

Slide 66

Slide 66 text

Azure with Rancher 1.「aks-kubernetes-cluster」リソース画面で上部メニューから「Tools」-「Monitoring」を選択 5.Prometheus Setup

Slide 67

Slide 67 text

Azure with Rancher 2.「Enabled」を選択して、「Save」ボタンを押下

Slide 68

Slide 68 text

Azure with Rancher 3.上部メニュー「aks-kubernetes-cluster」を選択

Slide 69

Slide 69 text

Azure with Rancher 4.Grafanaボタンが追加されていることを確認

Slide 70

Slide 70 text

Azure with Rancher 5.上部メニュー「azure-kubernetes-cluster」を選択

Slide 71

Slide 71 text

Azure with Rancher 6.上部メニュー「Tools」-「Monitoring」を選択

Slide 72

Slide 72 text

Azure with Rancher 7.「Enabled」を選択して、「Save」ボタンを押下

Slide 73

Slide 73 text

Azure with Rancher 8.上部メニュー「azure-kubernetes-cluster」を選択

Slide 74

Slide 74 text

Azure with Rancher 9.Grafanaボタンが追加されていることを確認(しばらく時間要)

Slide 75

Slide 75 text

Azure with Rancher 10.アコーディオンメニューを展開(azure-kubernetes-cluster) グラフをクリックすること で詳細情報を確認できます。

Slide 76

Slide 76 text

Azure with Rancher 11.Grafana Node & Cluster (azure-kubernetes-cluster) Node Cluster

Slide 77

Slide 77 text

http://ur0.link/PjJn • December 2018 Online Meetup Introducing Rancher's New Multi Tenant Prometheus Support Webinar • Rancher v2.2.0-Alpha3 Multi-Tenant Prometheus Supportについて Docs http://ur0.link/PjK6 Azure with Rancher

Slide 78

Slide 78 text

Multi-Cluster apps

Slide 79

Slide 79 text

Multi-Cluster Apps 複数のKubernetesクラスタへアプリをまとめてデプロイ、 ローリングアップデートなどの新機能を搭載した 「Rancher 2.2」が登場 by Publickey 2019.2.15 https://rancher.com/blog/ https://www.publickey1.jp/blog/19/kubernetesrancher_22.html

Slide 80

Slide 80 text

http://urx3.nu/RYwU • February 2019 Online Meetup: Multi Cluster Applications, Global DNS, and Multi Tenant Catalogs Webinar • Rancher 2.2 Tech Preview Multi-Cluster App Docs http://urx3.nu/UYcM Multi-Cluster Apps

Slide 81

Slide 81 text

Multi-Cluster Apps Rancher2.2の新機能としてMulti Kubernetes Clusterに対して、一括にカタログからアプリケーションをデプ ロイする機能が追加されます。

Slide 82

Slide 82 text

Rancherと連携して、AKS,EKS,GKEにクラスタを構築したところからMulti-Cluster Appsを実行します。 Multi-Cluster Apps

Slide 83

Slide 83 text

1.上部メニュー「Multi-Cluster Apps」を選択し、「Launch」ボタンを押下します。 Multi-Cluster Apps

Slide 84

Slide 84 text

2.検索フィールドで「word」と入力して、「wordpress」の「View Details」ボタンを押下 Multi-Cluster Apps

Slide 85

Slide 85 text

3.1~3を設定 1.任意名を入力 2.「Add Target」ボタンを2回押下 3.「aks-kubernetes-cluster」,「eks- kubernetes-cluster」,「gke-kubernetes- cluster」のDefaultを選択 デプロイするkubernetesク ラスタのネームスペースを 選択することで マルチkubernetesクラスタ に対するデプロイを実現で きます。 Multi-Cluster Apps

Slide 86

Slide 86 text

4.1~4を設定して、「Launch」ボタンを押下 1.任意パスワードを入力 3.「False」を選択 2.任意パスワードを入力 4.「L4 Balancer」を選択 Multi-Cluster Apps

Slide 87

Slide 87 text

5.aks-kubernetes-cluster,eks-kubernetes-cluster,gke-kubernetes-clusterにwordpressデプロイ完了 Multi-Cluster Apps

Slide 88

Slide 88 text

6.AKS,EKS,GKEのServiceで443/tcp,80/tcpをクリックしてWordPressにアクセス Multi-Cluster Apps

Slide 89

Slide 89 text

7.https or http://ExternalIP/wp-login.php (Username:user Password:your set password) Multi-Cluster Apps

Slide 90

Slide 90 text

Information

Slide 91

Slide 91 text

Information Rancher2.0 Kubernetes Workshop in Osaka #02 2019/3/16 (sat) 10:00~12:30 Spacee 大阪府大阪市北区芝田2-8-15 北梅田ビル2階 B号室 Rancher Meetup in Osaka #07 2019/3/16 (sat) 13:30~14:45 Spacee 大阪府大阪市北区芝田2-8-15 北梅田ビル2階 B号室

Slide 92

Slide 92 text

Information Rancher Meetup Tokyo #18 (モニタリングについて語ろう会) 2019/3/19 (tue) 19:00~21:00 株式会社リクルートテクノロジーズ 東京都中央区京橋1-6-1 8階 三井住友テプコビル

Slide 93

Slide 93 text

Information Cloud Native Kansai #2 2019/3/15 (fri) 19:00~21:30 エムオーテックス株式会 大阪府大阪市淀川区西中島5-12-12 エムオーテックス新大阪ビル

Slide 94

Slide 94 text

Information Cloud Native Hiroshima #02 2019/3/8 (fri) 18:00~20:00 広島市広島市中区大手町2丁目2-13 ( ザ・ガーデンプレイス紙屋町 5F)

Slide 95

Slide 95 text

Docker / Kubernetes / Rancher One Day Training 2019.4.15 https://eventregist.com/e/cndf2019training 10:00〜10:20(20min):【概要編】コンテナーを取り巻く市場動向 10:20〜12:00(60min):【環境構築】 12:00〜13:00(60min):【昼休憩】セットアップ補助(お弁当をご用意します) 13:00〜15:00(110min+10min):【基礎編】Docker基礎 15:00〜16:30(80min+10min):【基礎編】Kubernetes(オーケストレーション) 16:30〜17:30(60min):【実践編】Rancher & Kubernetes #rancherjp Coupon Code rancherjp1000 #kujiraya Coupon Code kujiraya1000 2019.4.16 https://eventregist.com/e/cndf2019 JapanContainerDaysでも好評で完売した「1日でDocker/Kubernetesを基礎から学べる少数限定ト レーニング」を実施します。トレーニングを受けてカンファレンスに臨みましょう! CloudNative Days 2019 CloudNative Days Tokyo 2019 OpenStack Days Tokyo 2019 Toranomon Hills Forum, July 22-23, 2019 CloudNative Days Kansai 2019

Slide 96

Slide 96 text

KubeCon + CloudNativeCon China 2018 Recap http://u0u0.net/PGHs KubeCon CloudNativeCon China 2018 Recap Lets go to Seattle !! Rancher Yes !!

Slide 97

Slide 97 text

KubeCon + CloudNativeCon NA 2018 Recap http://ur0.link/PkTG http://ur0.link/PkUm

Slide 98

Slide 98 text

Thank you for your attention !!