Files
weave-scope/site/installing.md
2016-05-12 17:44:54 +01:00

12 KiB
Raw Permalink Blame History

title, menu_order
title menu_order
Installing Weave Scope 20

Weave Scope consists of three parts: the probe, the app and the user interface. It can be deployed either as a standalone configuration, or if you dont want to manage the administration yourself, you can sign up for Weave Scope as a service.

The following topics are discussed:

##Installing Scope on Docker

To install Scope on your local Docker machine in Standalone Mode, run the following commands:

sudo wget -O /usr/local/bin/scope https://git.io/scope
sudo chmod a+x /usr/local/bin/scope
sudo scope launch

This script downloads and runs a recent Scope image from the Docker Hub. Scope needs to be installed onto every machine that you want to monitor. Once launched, Scope doesnt require any other configuration and it also doesnt depend on Weave Net.

After its been launched, open your browser to http://localhost:4040.

Note: If you're using boot2docker, replace localhost with the output of boot2docker IP.

Scope allows anyone with access to the UI control over your containers: as such, the Scope app endpoint (port 4040) should not be made accessible on the Internet. Additionally traffic between the app and the probe is currently insecure and should also not traverse the Internet.

###In Service Mode

To install Scope on your local Docker machine in Service Mode, run the following commands:

sudo wget -O /usr/local/bin/scope https://git.io/scope
sudo chmod a+x /usr/local/bin/scope
sudo scope launch --service-token=<token>

Where --service-token=<token> is the token that was sent to you when you signed up.

This script downloads and runs a recent Scope docker image from the Docker Hub. Scope needs to be installed onto every machine that you want to monitor. Once launched, Scope doesnt require any other configuration and it also doesnt depend on Weave Net.

After its been launched, open your web browser to scope.weave.works and login using your email. Click on 'My Scope' in the top right-hand corner to see the Scope UI.

### Using Weave Net

If Scope is running on the same machine as the Weave Network, then the probe uses weaveDNS to automatically discover any other apps on the network. Scope does this by registering itself under the address scope.weave.local.

Each probe sends its reports to every app registered at this address. If you have weaveDNS set up and running, no further steps are necessary.

If you dont want to use weaveDNS, then Scope can be instructed to cluster with other Scope instances on the command line. Hostnames and IP addresses are acceptable, both with and without ports, for example:

# scope launch scope1:4030 192.168.0.12 192.168.0.11:4030

Hostnames will be regularly resolved as A records, and each answer used as a target.

###Using Docker Compose

To install Scope on your local Docker machine in Standalone Mode using Docker Compose, run the following commands using one of the two fragments below.

docker-compose up -d

Scope needs to be installed onto every machine that you want to monitor. Once launched, Scope doesnt require any other configuration and it also doesnt depend on Weave Net.

After its been launched, open your browser to http://localhost:4040.

Docker Compose Format Version 1:

probe:
  image: weaveworks/scope:0.15
  net: "host"
  pid: "host"
  privileged: true
  labels:
    - "works.weave.role=system"
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock:rw"
  command:
    - "--probe.docker"
    - "true"

Docker Compose Format Version 2:

version: '2'
services:
  probe:
    image: weaveworks/scope:0.15
    network_mode: "host"
    pid: "host"
    privileged: true
    labels:
      - "works.weave.role=system"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:rw"
    command:
      - "--probe.docker"
      - "true"

Version 2 of this YAML file supports networks and volumes as defined by any plugins you might be using. See Compose File Reference for more information.

###Using Docker Compose in Service Mode

To install Scope on your local Docker machine in Service Mode using Docker Compose, run the following commands using one of the two fragments below.

SCOPE_SERVICE_TOKEN=<token>  docker-compose up -d

Where SCOPE_SERVICE_TOKEN=<token> is the token that was sent to you when you signed up.

Scope needs to be installed onto every machine that you want to monitor. Once launched, Scope doesnt require any other configuration and it also doesnt depend on Weave Net.

After its been launched, open your web browser to scope.weave.works and login using your email. Click on 'My Scope' in the top right-hand corner to see the Scope UI.

Docker Compose Format Version 1:

probe:
  image: weaveworks/scope:0.15
  net: "host"
  pid: "host"
  privileged: true
  labels:
    - "works.weave.role=system"
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock:rw"
  command:
    - "--probe.docker"
    - "true"
    - "--service-token"
    - "${SCOPE_SERVICE_TOKEN}"

Docker Compose Format Version 2:

version: '2'
services:
  probe:
    image: weaveworks/scope:0.15
    network_mode: "host"
    pid: "host"
    privileged: true
    labels:
      - "works.weave.role=system"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:rw"
    command:
      - "--probe.docker"
      - "true"
      - "--service-token"
      - "${SCOPE_SERVICE_TOKEN}"

Version 2 of this YAML file supports networks and volumes as defined by any plugins you might be using. See Compose File Reference for more information.

##Installing Scope on Kubernetes

To install Scope on a Kubernetes cluster in Standalone Mode, follow these instructions:

Before You Begin

Ensure that the cluster allows privileged pods - this is required by the Scope probes. By default, privileged pods are allowed from Kubernetes 1.1 and up. If you are running an earlier version or a non-default configuration, ensure that your API Server and all of your Kubelets are launched with the flag --allow_privileged.

Your cluster must also support DaemonSets. DaemonSets are necessary to ensure that each Kubernetes node can run a Scope Probe.

To enable DaemonSets in an existing cluster, add the --runtime-config=extensions/v1beta1/daemonsets=true argument to the apiserver's configuration. This is normally found in the /etc/kubernetes/manifest/kube-apiserver.manifestfile after a restart of the apiserver and controller manager has occurred. If you are creating a new cluster, set KUBE_ENABLE_DAEMONSETS=true in your cluster configuration.

Note: Prior to Kubernetes version 1.2 DaemonSets would fail to schedule pods on unschedulable nodes (typically the master). This will result in the probe not running on that node. See #1030 for more information. It is advised that you use Kubernetes version 1.2 or higher.

Install Scope on Your Cluster

It is recommended that you run Scope natively in your Kubernetes cluster using kubectl with launch URL as show below.

The simplest way to get the latest release of Scope deployed onto a Kubernetes cluster is the following:

kubectl create -f 'https://scope.weave.works/launch/k8s/weavescope.yaml' --validate=false

The --validate=false flag is currently required due to a bug in Kubernetes (see kubernetes/kubernetes#24089 for more details

Allowable parameters for the launcher URL:

  • v - Weave Scope version or tag, e.g. latest or 0.15.0, current release is the default
  • service-token - Weave Scope Cloud Service token
  • k8s-service-type - Kubernetes service type (for running Scope in Standalone mode), can be either LoadBalancer or NodePort, by default this is unspecified (only internal access)

To download and read the Scope manifest:

curl --silent --remote-name https://scope.weave.works/launch/k8s/weavescope.yaml

This runs a recent Scope image from the Docker Hub and will launch a probe onto every node as well as a single app. Once launched, Scope doesnt require any other configuration and it also doesnt depend on Weave Net.

Open Scope in Your Browser

kubectl port-forward $(kubectl get pod --selector=weavescope-component=weavescope-app -o jsonpath={.items..metadata.name}) 4040

Open http://localhost:4040 in your browser. This allows you to access the Scope UI securely, without opening it to the Internet.

##Installing Scope on Amazon ECS

There are currently three options for launching Weave Scope in ECS:

The AWS CloudFormation template is the easiest way to get started with Weave Net and Weave Scope. CloudFormation templates provide developers and systems administrators a simple way to create a collection or a stack of related AWS resources, and it provisions and updates them in an orderly and predictable fashion.

Use this specially created Weaveworks CloudFormation template to create an EC2 instance with all of the resources you need, including Weave Net and Weave Scope.

Before launching the stack:

The link below will launch a sample app using a Cloudformation template, but you can swap out the IdentiOrca app and use your own app instead.

Ready to launch a stack?  Click here to launch a stack to AWS:

For step by step instructions on how to configure the stack, see: Install Weave to AWS with One-Click

##Installing Scope as a DC/OS Package

Scope can be installed as a DC/OS Package through the open Universe.

DC/OS is short for Datacenter Operating System, a distributed operating system using Apache Mesos as its kernel. The easiest way to get start with DC/OS in the public-cloud is to deploy it on Amazon Web Services (AWS).

For more information see, Deploying Weave Scope on DC/OS

See Also