Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's Rio.pdf

cyberblack28
September 07, 2018
37

What's Rio.pdf

This document is about Rio, a new project by Rancher Labs.

cyberblack28

September 07, 2018
Tweet

Transcript

  1. Profile Twitter:cyberblack28 Hatena Blog:https://cyberblack28.hatenablog.com/ Job Infrastructure Engineer Frontend Engineer Educational

    Solution Architect  Hobby1: Music,Live,FES !! Hobby2: 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
  2. What’s Rio ? 1.Rio is … https://github.com/rancher/rio New Project of

    Rancher Labs “Cloud Native Container Distribution”
  3. What’s Rio ? 2.Who’s Developer ? Darren Shepherd Co-founder and

    Chief Architect at Rancher Labs, Inc. @ibuildthecloud
  4. What’s Rio ? Service Mesh made Docker Simple Service mesh

    is the missing piece in most container deployments. Many organizations have seen increased agility by Dockerizing their applications and deploying in Kubernetes. Service mesh enables more complex deployment scenarios (A/B, circuit breaker), stricter security (mTLS), and better visibility. In it’s current state service mesh is difficult to leverage and adds a lot more concepts to your deployments. In this talk we will present a new tool that builds on the simplicity of Docker Compose to deploy and run your service mesh. Darren Shepherd (Rancher Labs)
  5. What’s Rio ? Using Containers in Production shoudn’t be this

    Hard. Darren Shepherd (Rancher Labs) It was Docker's ease of use that sparked the creativity of users, and lead to its abundant adoption for development and testing.
  6. What’s Rio ? 4.What’s Concept of Rio ? 1.Simple, fun,

    end-to-end container experience 2.Cloud Native Container Distribution Rio is a user oriented end-to-end container solution with a focus on keeping containers simple and combating the current trend of complexity. It's kept fun and simple through it's familiar and opinionated user experience. Additionally, Rio is a "Cloud Native Container Distribution" meaning is includes builtin Cloud Native technologies such as Kubernetes, Istio, Containerd, etc. so that the user need not be an expert in installing, using, and maintaining these system.
  7. What’s Rio ? 5.What’s Status of Rio ? Current Status:

    Early Preview This is an early preview, features may be broken, not work as described, and has been known to be irresistibly drawn to large cities, where it will back up sewers, reverse street signs, and steal everyone's left shoe. Please try it out and file bugs. Goals 1. Fun 2. Simple 3. Portable 4. Secure 5. Product Grade 6. Cloud Native Distribution
  8. What’s Rio ? 7.What’s technical concepts of Rio ? Service

    The main unit that is being dealt with in Rio are services. Services are just a collection of containers that provide a similar function. Stack A stack is a group of services and their related resources, such as configuration files, volumes and routes. A stack ends up typically representing one application. Workspace A workspace is a collection of stacks, and other resources such as secrets.
  9. What’s Rio ? Service Mesh Rio has a built in

    service mesh, powered by Istio and Envoy. Rio specifically does not require the user to understand much about the underlying service mesh. Just know that all communication is going through the service mesh.
  10. Let’s try Rio !! 1. Get start Rio Quick Start

    • Recommendation Laptop : Minikube, Docker for Mac/Windows • Others Linux VM or Linux itself
  11. Let’s try Rio !! Installation • Rio Standalone • Run

    on Kubernetes Rio will run in two different modes In this mode Rio comes will all the container tech you need built in. Rio does not need Docker, Kubernetes or anything else installed on the host. All you need are modern Linux servers. (Linux 4.x+ that support overlay, SquashFS, and containers in general) In this mode Rio will use an existing Kubernetes cluster. The advantages of this approach is that you get more flexibility in terms of networking, storage, and other components at the cost of greatly increased complexity. 18.04 LTS
  12. Let’s try Rio !! 2. Rio Release (As of August

    2018 ) Release Category Version Pre-release v0.0.1-rc1 Pre-release v0.0.1-rc2 Pre-release v0.0.1-rc3 Latest release V0.0.1 Pre-release V0.0.2-rc1 Latest release V0.0.2 Pre-release V0.0.3-rc1 Pre-release V0.0.3-rc2 Pre-release V0.0.3-rc3 Pre-release V0.0.3-rc4 Pre-release V0.0.3-rc5 Pre-release V0.0.3-rc6 https://github.com/rancher/rio/releases
  13. Let’s try Rio !! 2. Prepare 01 Item Setting value

    Name rio Region asia-northeast1Tokyo Zone asia-northeast1-b Machine type 4 vCPUs Boot disk Ubuntu 18.04 LTS Size(GB) 80 Firewall Allow HTTP traffic, Allow HTTPS traffic Make one VM Instance
  14. Let’s try Rio !! 3. Standalone 1.Download Rio v0.0.2 $

    curl -LO https://github.com/rancher/rio/releases/download/v0.0.2/rio-v0.0.2-linux-amd64.tar.gz 2.Expansion $ tar zxvf rio-v0.0.2-linux-amd64.tar.gz 3.Move $ sudo mv rio-v0.0.2-linux-amd64/rio /usr/local/bin/ 4.Excute $ sudo rio server
  15. Let’s try Rio !! 3. Prepare 02 rancher-server rio Server

    Item Setting value Name rio Region asia-northeast1Tokyo Zone asia-northeast1-b Machine type 4 vCPUs Boot disk Ubuntu 16.04 LTS Size(GB) 80 Firewall Allow HTTP traffic, Allow HTTPS traffic Item Setting value Name rancher-server Region asia-northeast1Tokyo Zone asia-northeast1-b Machine type 1 vCPUs Boot disk Ubuntu 16.04 LTS Size(GB) 80 Firewall Allow HTTP traffic, Allow HTTPS traffic Agent kubectl rio Sample App
  16. Let’s try Rio !! 1.Download $ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s

    https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl 2.Execution authority $ chmod +x ./kubectl 3.Move $ sudo mv ./kubectl /usr/local/bin/kubectl kubectl install 4.Confirm node (※Pre-set kubeconfig) $ kubectl get nodes NAME STATUS ROLES AGE VERSION rio Ready controlplane,etcd,worker 10m v1.11.2 rancher-server
  17. Let’s try Rio !! 4. On Kubernetes 1.Download $ curl

    -LO https://github.com/rancher/rio/releases/download/v0.0.2/rio-v0.0.2-linux-amd64.tar.gz 2.Expansion $ tar zxvf rio-v0.0.2-linux-amd64.tar.gz 3.Move $ sudo mv rio-v0.0.2-linux-amd64/rio /usr/local/bin/ 4.Excute rio $ rio login [1] Connect to remote Rio server [2] Install Rio in existing Kubernetes Select Number [1] 2 INFO[0805] Installing Rio INFO[0808] Waiting to connect to Rio INFO[0819] Log in successful rancher-server
  18. Let’s try Rio !! 5.kubectl by rio $ rio kubectl

    get services --all-namespaces NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE default kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 1h ingress-nginx default-http-backend ClusterIP 10.43.151.86 <none> 80/TCP 1h istio-095b8502 istio-citadel ClusterIP 10.43.61.240 <none> 80/TCP 1h istio-095b8502 istio-gateway ClusterIP 10.43.95.95 <none> 80/TCP 1h istio-095b8502 istio-pilot ClusterIP 10.43.170.37 <none> 15007/TCP,15010/TCP 1h kube-system kube-dns ClusterIP 10.43.0.10 <none> 53/UDP,53/TCP 1h kube-system metrics-server ClusterIP 10.43.228.86 <none> 443/TCP 1h rio-system rio ClusterIP 10.43.251.160 <none> 443/TCP 1h
  19. Let’s try Rio !! $ rio -h NAME: rio -

    Containers made simple, as they should be USAGE: rio [global options] command [command options] [arguments...] VERSION: v0.0.2 COMMANDS: ps List services and containers run Create and run a new service create Create a new service scale Scale a service rm Delete a service or stack inspect Print the raw API output of a resource edit Edit a service or stack up Bring up a stack export Export a stack cat Print the contents of a config exec Run a command in a running container attach Attach to a running process in a container logs Print logs from containers stage Stage a new revision of a service promote Promote a staged version to latest weight Weight a percentage of traffic to a staged service routes, route Route traffic across the mesh wait Wait for resources service, stack login Login into Rio help, h Shows a list of commands or help for one command
  20. Let’s try Rio !! CLUSTER RUNTIME: server Run management server

    agent Run node agent SUB COMMANDS: configs, config Operations on configs volumes, volume Operations on volumes stacks, stack Operations on stacks nodes, node Operations on nodes GLOBAL OPTIONS: --debug Turn on debug logs --wait, -w Wait for resource to reach resting state --wait-timeout value Timeout in seconds to wait (default: 600) --wait-state value State to wait for (active, healthy, etc) --server value Specify the Rio API endpoint URL [$RIO_URL] --token value Specify Rio API token [$RIO_TOKEN] --kubeconfig value Specify Kubeconfig to use to connect to Kubernetes [$RIO_KUBECONFIG] --workspace value Specify which workspace to use (default: "default") [$RIO_WORKSPACE] --help, -h show help --version, -v print the version
  21. Let’s try Rio !! 5.Service Mesh 1.Create a new service

    $ rio run -p 80/http --name test/svc --scale=3 ibuildthecloud/demo:v1 2.Ensure service is running and determine public URL $ rio ps NAME IMAGE CREATED SCALE STATE ENDPOINT DETAIL test/svc ibuildthecloud/demo:v1 5 hours ago 3 active http://svc.test.10.146.0.3.nip.io rancher-server $ rio ps NAME IMAGE CREATED SCALE STATE ENDPOINT DETAIL test/svc ibuildthecloud/demo:v1 17 seconds ago 3 active http://svc.test.8gr18g.lb.rancher.cloud ENDPOINT’s HOSTNAME is <ServiceName>.<StackName>.<ClusterID>.<ROOT domain> ROOT domain (case of standalone) is lb.rancher.cloud. ROOT domain (case of Docker for Mac/Win etc.) is 127.0.0.1.nip.io Compare Tutorial
  22. Let’s try Rio !! 3.Stage new version, updating just the

    docker image and assigning it to "v3" version. $ rio stage --image=ibuildthecloud/demo:v3 test/svc:v3 4.Notice a new URL was created for your staged service $ rio ps NAME IMAGE CREATED SCALE STATE ENDPOINT DETAIL test/svc ibuildthecloud/demo:v1 5 hours ago 3 active http://svc.test.10.146.0.3.nip.io test/svc:v3 ibuildthecloud/demo:v3 5 hours ago 3 active http://svc-v3.test.10.146.0.3.nip.io 5.Access current service $ curl -s http://svc.test.10.146.0.3.nip.io default backend - 404 6.Access staged service under new URL $ curl -s http://svc-v3.test.10.146.0.3.nip.io default backend - 404 $ curl -s http://svc.test.8gr18g.lb.rancher.cloud Hello World $ curl -s http://svc-v3.test.8gr18g.lb.rancher.cloud Hello World v3 Compare Tutorial
  23. Let’s try Rio !! By making an ingress with rancher,

    we were able to access it with the browser. http://svc.test-124a4837.35.200.68.156.xip.io/ http://svc-v3.test-124a4837.35.200.68.156.xip.io/ 7.Export to see stack file format $ rio export test services: svc: image: ibuildthecloud/demo:v1 ports: - 80/http revisions: v3: image: ibuildthecloud/demo:v3 scale: 3 scale: 3
  24. Let’s try Rio !! 8.Send some production traffic to new

    version $ rio weight test/svc:v3=50% 9.See that 50% of traffic goes to new service Updated the browser many times but v3 is not displayed. . $ curl -s http://svc.test.8gr18g.lb.rancher.cloud Hello World $ curl -s http://svc.test.8gr18g.lb.rancher.cloud Hello World v3 Compare Tutorial
  25. Let’s try Rio !! 11.All new traffic is v3 v3

    is displayed even if the browser is updated many times $ curl -s http://svc.test.8gr18g.lb.rancher.cloud Hello World v3 $ curl -s http://svc.test.8gr18g.lb.rancher.cloud Hello World v3 Compare Tutorial 10. Happy with the new version we promote the stage version to be the primary $ rio promote test/svc:v3
  26. ! !