Skip to content

Commit

Permalink
Update getting started guides to latest linkerd (linkerd#55)
Browse files Browse the repository at this point in the history
* Update getting started guides to latest linkerd

* Update other examples to 0.8.3 as well
  • Loading branch information
klingerf authored Nov 9, 2016
1 parent 4f6a1af commit d883d25
Show file tree
Hide file tree
Showing 27 changed files with 116 additions and 232 deletions.
4 changes: 2 additions & 2 deletions dcos/ingress/linkerd-dcos.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"container": {
"type": "DOCKER",
"docker": {
"image": "buoyantio/linkerd:0.8.2",
"image": "buoyantio/linkerd:0.8.3",
"network": "HOST",
"privileged": true
}
Expand Down Expand Up @@ -38,5 +38,5 @@
}
],
"requirePorts": true,
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"namers\\\":[{\\\"kind\\\":\\\"io.l5d.marathon\\\",\\\"host\\\":\\\"marathon.mesos\\\",\\\"port\\\":8080,\\\"prefix\\\":\\\"/io.l5d.marathon\\\",\\\"experimental\\\":true}],\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"linkerd_proxy\\\"},{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4242,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId/*=>/#/io.l5d.marathon/webapp;/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"external\\\"}]}\"|/io.buoyant/linkerd/0.8.2/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"namers\\\":[{\\\"kind\\\":\\\"io.l5d.marathon\\\",\\\"host\\\":\\\"marathon.mesos\\\",\\\"port\\\":8080,\\\"prefix\\\":\\\"/io.l5d.marathon\\\",\\\"experimental\\\":true}],\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"linkerd_proxy\\\"},{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4242,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId/*=>/#/io.l5d.marathon/webapp;/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"external\\\"}]}\"|/io.buoyant/linkerd/0.8.3/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
}
4 changes: 2 additions & 2 deletions dcos/linker-to-linker/linkerd-dcos.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"container": {
"type": "DOCKER",
"docker": {
"image": "buoyantio/linkerd:0.8.2",
"image": "buoyantio/linkerd:0.8.3",
"network": "HOST",
"privileged": true
}
Expand Down Expand Up @@ -38,5 +38,5 @@
}
],
"requirePorts": true,
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"namers\\\":[{\\\"kind\\\":\\\"io.l5d.marathon\\\",\\\"host\\\":\\\"marathon.mesos\\\",\\\"port\\\":8080,\\\"prefix\\\":\\\"/io.l5d.marathon\\\",\\\"experimental\\\":true}],\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"outgoing\\\",\\\"interpreter\\\":{\\\"kind\\\":\\\"default\\\",\\\"transformers\\\":[{\\\"kind\\\":\\\"io.l5d.port\\\",\\\"port\\\":4141}]}},{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4141,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"label\\\":\\\"incoming\\\",\\\"dstPrefix\\\":\\\"/\\\",\\\"identifier\\\":{\\\"kind\\\":\\\"io.l5d.header\\\",\\\"header\\\":\\\"l5d-dst-concrete\\\"},\\\"interpreter\\\":{\\\"kind\\\":\\\"default\\\",\\\"transformers\\\":[{\\\"kind\\\":\\\"io.l5d.localhost\\\"}]}}]}\"|/io.buoyant/linkerd/0.8.2/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"namers\\\":[{\\\"kind\\\":\\\"io.l5d.marathon\\\",\\\"host\\\":\\\"marathon.mesos\\\",\\\"port\\\":8080,\\\"prefix\\\":\\\"/io.l5d.marathon\\\",\\\"experimental\\\":true}],\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"outgoing\\\",\\\"interpreter\\\":{\\\"kind\\\":\\\"default\\\",\\\"transformers\\\":[{\\\"kind\\\":\\\"io.l5d.port\\\",\\\"port\\\":4141}]}},{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4141,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"label\\\":\\\"incoming\\\",\\\"dstPrefix\\\":\\\"/\\\",\\\"identifier\\\":{\\\"kind\\\":\\\"io.l5d.header\\\",\\\"header\\\":\\\"l5d-dst-concrete\\\"},\\\"interpreter\\\":{\\\"kind\\\":\\\"default\\\",\\\"transformers\\\":[{\\\"kind\\\":\\\"io.l5d.localhost\\\"}]}}]}\"|/io.buoyant/linkerd/0.8.3/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
}
4 changes: 2 additions & 2 deletions dcos/namerd-linkerd/linkerd-dcos.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"container": {
"type": "DOCKER",
"docker": {
"image": "buoyantio/linkerd:0.8.2",
"image": "buoyantio/linkerd:0.8.3",
"network": "HOST",
"privileged": true
}
Expand All @@ -33,5 +33,5 @@
}
],
"requirePorts": true,
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"label\\\":\\\"linkerd_proxy\\\",\\\"interpreter\\\":{\\\"kind\\\":\\\"io.l5d.namerd\\\",\\\"dst\\\":\\\"/$/inet/namerd.marathon.mesos/4100\\\"}}]}\"|/io.buoyant/linkerd/0.8.2/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"label\\\":\\\"linkerd_proxy\\\",\\\"interpreter\\\":{\\\"kind\\\":\\\"io.l5d.namerd\\\",\\\"dst\\\":\\\"/$/inet/namerd.marathon.mesos/4100\\\"}}]}\"|/io.buoyant/linkerd/0.8.3/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
}
4 changes: 2 additions & 2 deletions dcos/simple-proxy/linkerd-dcos.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"container": {
"type": "DOCKER",
"docker": {
"image": "buoyantio/linkerd:0.8.2",
"image": "buoyantio/linkerd:0.8.3",
"network": "HOST",
"privileged": true
}
Expand All @@ -33,5 +33,5 @@
}
],
"requirePorts": true,
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"namers\\\":[{\\\"kind\\\":\\\"io.l5d.marathon\\\",\\\"host\\\":\\\"marathon.mesos\\\",\\\"port\\\":8080,\\\"prefix\\\":\\\"/io.l5d.marathon\\\",\\\"experimental\\\":true}],\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"linkerd_proxy\\\"}]}\"|/io.buoyant/linkerd/0.8.2/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
"cmd": "echo \"{\\\"admin\\\":{\\\"port\\\":9990},\\\"namers\\\":[{\\\"kind\\\":\\\"io.l5d.marathon\\\",\\\"host\\\":\\\"marathon.mesos\\\",\\\"port\\\":8080,\\\"prefix\\\":\\\"/io.l5d.marathon\\\",\\\"experimental\\\":true}],\\\"routers\\\":[{\\\"protocol\\\":\\\"http\\\",\\\"servers\\\":[{\\\"port\\\":4140,\\\"ip\\\":\\\"0.0.0.0\\\"}],\\\"baseDtab\\\":\\\"/marathonId=>/#/io.l5d.marathon;/http/1.1/*=>/$/io.buoyant.http.domainToPathPfx/marathonId;\\\",\\\"label\\\":\\\"linkerd_proxy\\\"}]}\"|/io.buoyant/linkerd/0.8.3/bundle-exec -log.level=DEBUG -com.twitter.finagle.tracing.debugTrace=true -- -"
}
3 changes: 0 additions & 3 deletions getting-started/aurora/README.md

This file was deleted.

4 changes: 4 additions & 0 deletions getting-started/dcos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Getting Started with linkerd and DC/OS

See the [Running in DC/OS](https://linkerd.io/getting-started/dcos/) guide on
linkerd.io
34 changes: 6 additions & 28 deletions getting-started/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,26 @@ For more information on linkerd, please visit linkerd.io

## Downloading

Start by cloning this repo and pulling the nginx and linkerd docker images:
Start by cloning this repo:

```
git clone https://github.com/BuoyantIO/linkerd-examples.git
cd linkerd-examples/getting-started/docker
docker pull nginx
docker pull buoyantio/linkerd:0.7.0
```

## Start nginx and linkerd

The included `docker-compose.yml` starts up an nginx service that serves static
content from the www directory and a linkerd.
content from the www directory and a linkerd. Running docker-compose will pull
the required images automatically:

```
docker-compose up -d
```

`linkerd.yaml` is a config file that controls linkerd's behavior:

```
# The filesystem namer (io.l5d.fs) watches the disco directory for changes.
# Each file in this directory represents a concrete name and contains a list
# of hostname/port pairs.
namers:
- kind: io.l5d.fs
rootDir: disco
routers:
- protocol: http
# Incoming requests to linkerd with a Host header of "hello" get assigned a
# name like /http/1.1/GET/hello. This dtab transforms that into
# /#/io.l5d.fs/hello which indicates that the filesystem namer should be used
# and should look for a file named "hello". linkerd will then load balance
# over the entries in that file.
baseDtab: |
/http/1.1/* => /#/io.l5d.fs
servers:
- ip: 0.0.0.0
port: 4140
```
When linkerd starts, it loads the [linkerd.yaml](linkerd.yaml) to configure
a linkerd router that routes traffic to the nginx service, using file-system
backed service discovery.

## Send requests

Expand Down
2 changes: 1 addition & 1 deletion getting-started/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:

# linkerd
l5d:
image: buoyantio/linkerd:0.7.0
image: buoyantio/linkerd:0.8.3
ports:
- "4140:4140"
- "9990:9990"
Expand Down
2 changes: 1 addition & 1 deletion getting-started/docker/linkerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# of hostname/port pairs.
namers:
- kind: io.l5d.fs
rootDir: disco
rootDir: /io.buoyant/disco

routers:
- protocol: http
Expand Down
54 changes: 11 additions & 43 deletions getting-started/k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,60 +18,27 @@ kubectl cluster-info

## Starting nginx

We create a simple nginx app that simply serves a static file on port 80.
To do this in Kubernetes, we create a replication controller and service. The
service is what allows linkerd to discover the nginx pods and load balance over
them.
We create a simple nginx app that simply serves a static file on port 80. To do
this in Kubernetes, we create a replication controller and service, defined in
[nginx.yml](nginx.yml). The service is what allows linkerd to discover the nginx
pods and load balance over them. To create nginx in the default namespace, run:

```
kubectl apply -f nginx-rc.yml
kubectl apply -f nginx-svc.yml
kubectl apply -f nginx.yml
```

## Starting linkerd

Before we can launch linkerd itself, we need to create a linker config file.
`linkerd.yml` creates a config file that controls linkerd's behavior and stores
it in Kubernetes as a config map.

```yaml
# The Kubernetes namer (io.l5d.k8s) queries the Kubernetes master API
# for a list of pods with a given name.
namers:
- kind: io.l5d.k8s
experimental: true
# kubectl proxy forwards localhost:8001 to the Kubernetes master API
host: localhost
port: 8001
routers:
- protocol: http
# Incoming requests to linkerd with a Host header of "hello" get assigned
# a name like /http/1.1/GET/hello. This dtab transforms that into
# /#/io.l5d.k8s/default/service/hello which indicates that the kubernetes
# namer should query the API for ports named "service" on pods in the
# "default" namespace named "hello". linkerd will then load balance over
# those pods.
baseDtab: |
/http/1.1/* => /#/io.l5d.k8s/default/service
servers:
- ip: 0.0.0.0
port: 4140
```
Create the config map with
linkerd stores its config file in a Kubernetes
[ConfigMap](http://kubernetes.io/docs/user-guide/configmap/). The config map,
replication controller, and service for running linkerd are defined in
[linkerd.yml](linkerd.yml). To create linkerd in the default namespace, run:

```
kubectl apply -f linkerd.yml
```

Now we're ready to launch linkerd into Kubernetes.

```
kubectl apply -f l5d-rc.yml
kubectl apply -f l5d-svc.yml
```

Kuberenets should create an external ip for linkerd which you can view with
Kubernetes will create an external ip for linkerd which you can view with:

```
kubectl get svc/linkerd
Expand All @@ -86,6 +53,7 @@ nginx service.

```
curl -H "Host: nginx" <linkerd external ip>:4140
Hello, linkerd!
```

## Admin dashboard
Expand Down
40 changes: 0 additions & 40 deletions getting-started/k8s/l5d-rc.yml

This file was deleted.

16 changes: 0 additions & 16 deletions getting-started/k8s/l5d-svc.yml

This file was deleted.

56 changes: 56 additions & 0 deletions getting-started/k8s/linkerd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,59 @@ data:
servers:
- ip: 0.0.0.0
port: 4140
---
kind: ReplicationController
apiVersion: v1
metadata:
name: linkerd
spec:
replicas: 1
selector:
app: linkerd
template:
metadata:
labels:
app: linkerd
spec:
containers:
- name: l5d
image: buoyantio/linkerd:0.8.3
args:
- "/io.buoyant/linkerd/config/config.yml"
ports:
- name: incoming
containerPort: 4140
- name: admin
containerPort: 9990
volumeMounts:
- name: "linkerd-config"
mountPath: "/io.buoyant/linkerd/config"
readOnly: true
# We run a kubectl proxy container so that linkerd can talk to the
# Kubernetes master API.
- name: kubectl
image: buoyantio/kubectl:v1.4.0
args:
- proxy
- "-p"
- "8001"
volumes:
- name: linkerd-config
configMap:
name: linkerd-config
---
kind: Service
apiVersion: v1
metadata:
name: linkerd
spec:
selector:
app: linkerd
type: LoadBalancer
ports:
- name: incoming
port: 4140
targetPort: 4140
- name: admin
port: 9990
targetPort: 9990
13 changes: 0 additions & 13 deletions getting-started/k8s/nginx-svc.yml

This file was deleted.

13 changes: 13 additions & 0 deletions getting-started/k8s/nginx-rc.yml → getting-started/k8s/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,16 @@ spec:
ports:
- name: service
containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
name: nginx
spec:
selector:
app: nginx
clusterIP: None
ports:
- name: service
port: 80
targetPort: 80
Loading

0 comments on commit d883d25

Please sign in to comment.