Slide 1

Slide 1 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 1/54 Multi-Cluster Management with Rancher

Slide 2

Slide 2 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 2/54 Kyohei Mizumoto(@kyohmizu) C# Software Engineer Interests Docker/Kubernetes Go Security whoami

Slide 3

Slide 3 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 3/54 Target People who: haven't used Rancher are interested in multi-cluster management

Slide 4

Slide 4 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 4/54 Preferred The basic knowledge of: Docker Kubernetes Microsoft Azure

Slide 5

Slide 5 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 5/54 Agenda What is Rancher? Get Started Manage Clusters Add Clusters Deploy WordPress from Catalog

Slide 6

Slide 6 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 6/54 What is Rancher?

Slide 7

Slide 7 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 7/54 Container packaging and runtime standard Build container images from Dockerfiles(IaC) Distribute container images from Docker registries Docker

Slide 8

Slide 8 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 8/54 Container orchestration standard Manage resources as manifest files(IaC) OSS which CNCF hosts (Graduated) Kubernetes

Slide 9

Slide 9 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 9/54 Container management platform Open source software Deliver Kubernetes as a Service(KaaS) Paid support Rancher

Slide 10

Slide 10 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 10/54 Features GUI based management Add clusters Deploy resources using catalogs Easy to start No need to have in-depth knowledge of Kubernetes

Slide 11

Slide 11 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 11/54 Run Kubernetes Everywhere Create Kubernetes clusters with: Rancher Kubernetes Engine (RKE) Cloud Kubernetes services(e.g. GKE, AKS, EKS) Import & manage existing Kubernetes clusters

Slide 12

Slide 12 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 12/54 Empower DevOps Teams Each team deploys their applications on the public/ private clouds they choose

Slide 13

Slide 13 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 13/54 Architecture

Slide 14

Slide 14 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 14/54 Get Started

Slide 15

Slide 15 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 15/54 Installation Single Node Install Install by running a single Docker container For development and testing environments High Availability (HA) Install Install in a Kubernetes cluster For production environments

Slide 16

Slide 16 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 16/54 Installation Single Node Install Install by running a single Docker container For development and testing environments High Availability (HA) Install Install in a Kubernetes cluster For production environments

Slide 17

Slide 17 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 17/54 Create VM on Azure

Slide 18

Slide 18 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 18/54 Install ssh to the VM Install Docker with the following command: $ curl https://releases.rancher.com/install-docker/18.09.sh | sh Install Rancher with the following command: $ sudo docker run -d --restart=unless-stopped -p 80:80 \ -p 443:443 rancher/rancher:v2.2.2

Slide 19

Slide 19 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 19/54 Access to VM https://[IP address of VM]

Slide 20

Slide 20 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 20/54 Settings Set a password Save the URL(default)

Slide 21

Slide 21 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 21/54 Done :)

Slide 22

Slide 22 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 22/54 Manage Clusters

Slide 23

Slide 23 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 23/54 Sample Add Clusters Custom AKS Deploy WordPress from Catalog

Slide 24

Slide 24 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 24/54 Create Custom Cluster

Slide 25

Slide 25 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 25/54 Advance Preparation Create an another VM for node on Azure name: rancher-node image: Ubuntu Server 18.04 LTS OS-disk-type: Standard SSD auto-shutdown: off Add inbound port rules 22, 443

Slide 26

Slide 26 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 26/54 Select Custom

Slide 27

Slide 27 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 27/54 Set IPs of VM

Slide 28

Slide 28 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 28/54 Create a Cluster Run the copied command on VM $ sudo docker run -d --privileged --restart=unless-stopped --net=host \ -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.2.2 \ --server https://xx.xx.xxx.xx --token 666ltr6qntjz2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ --ca-checksum f707d53266d14e03ff3452896dxxxxxxxxxxxxxxxxxxxxxxxxxxx --address xx.xx.xxx.xx \ --internal-address 10.x.x.x --etcd --controlplane --worker

Slide 29

Slide 29 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 29/54 Provisioning...

Slide 30

Slide 30 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 30/54 Done :)

Slide 31

Slide 31 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 31/54 View Resources

Slide 32

Slide 32 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 32/54 Create AKS Cluster

Slide 33

Slide 33 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 33/54 Advance Preparation(on Azure) Create a new resource group for AKS rancher-aks-sample Create a service principal $ az ad sp create-for-rbac --skip-assignment -n sp-aks-sample appId: 03f94503-xxxx-xxxx-xxxx-xxxxxxxxxxxx displayName: sp-aks-sample name: http://sp-aks-sample password: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx tenant: 2bdec7af-xxxx-xxxx-xxxx-xxxxxxxxxxxx $ az role assignment create --assignee 03f94503-xxxx-xxxx-xxxx-xxxxxxxxxxxx \ --role Contributor --resource-group rancher-aks-sample

Slide 34

Slide 34 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 34/54 Advance Preparation(on Azure) Register resource providers $ az provider register -n Microsoft.OperationalInsights $ az provider register -n Microsoft.OperationsManagement https://docs.microsoft.com/en-us/azure/azure-resource- manager/resource-manager-register-provider-errors

Slide 35

Slide 35 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 35/54 Select AKS

Slide 36

Slide 36 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 36/54 Set Credentials Client ID is appId Client secret is the password value

Slide 37

Slide 37 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 37/54 Done :)

Slide 38

Slide 38 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 38/54 But...

Slide 39

Slide 39 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 39/54 Unsolved Problem

Slide 40

Slide 40 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 40/54 Issue AKS https://github.com/Azure/AKS/issues/173 Rancher https://github.com/rancher/rancher/issues/11496

Slide 41

Slide 41 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 41/54 Deploy WordPress from Catalog

Slide 42

Slide 42 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 42/54 Deploy on Custom Cluster

Slide 43

Slide 43 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 43/54 Select WordPress

Slide 44

Slide 44 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 44/54 Settings Set Password, and change others if necessary

Slide 45

Slide 45 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 45/54 Launch Endpoint is created http://xip.io-wordpress.wordpress.00.000.000.000.xip.io

Slide 46

Slide 46 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 46/54 Access to Endpoint

Slide 47

Slide 47 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 47/54 Deploy on AKS Cluster Deploy WordPress without L7 Load Balancer

Slide 48

Slide 48 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 48/54 Because...

Slide 49

Slide 49 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 49/54 Need to deploy LB on Azure Deploy nginx-ingress with helm(by default) Deploy wordpress-ingress.yaml apiVersion: extensions/v1beta1 kind: Ingress metadata: name: wordpress-ingress annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/ssl-redirect: "false" nginx.ingress.kubernetes.io/rewrite-target: / spec: rules: - http: paths: - path: / backend: serviceName: wordpress-wordpress servicePort: 80

Slide 50

Slide 50 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 50/54 Access to Public IP

Slide 51

Slide 51 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 51/54 What I Felt Good for cluster management Can deploy many applications on GUI Can start monitoring & logging on GUI Not a few things we have to know But useful to manage multi-clusters on different platforms

Slide 52

Slide 52 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 52/54 Thank you!

Slide 53

Slide 53 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 53/54 Links マルチクラウド時代の最強コンビ RancherによるKubernetes 活⽤ガイド https://thinkit.co.jp/series/8740 Official - Rancher 2.x https://rancher.com/docs/rancher/v2.x/en/

Slide 54

Slide 54 text

2019/4/25 Multi-Cluster Management with Rancher 127.0.0.1:5500/#54 54/54 Actually, everything is here... Azure with Rancher !! https://speakerdeck.com/cyberblack28/azure-with-rancher