Skip to content

Commit

Permalink
create namespace and invert emojivoto deployment and trafficsplit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Porta authored and Ivan Porta committed Jan 13, 2025
1 parent 8029b03 commit 727c6e8
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 140 deletions.
49 changes: 29 additions & 20 deletions linkerd.io/content/2-edge/tasks/automatic-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,13 @@ them in that cluster:
> helm --kube-context=west install linkerd-failover -n linkerd-failover --create-namespace --devel linkerd-edge/linkerd-failover
```

## Installing and Exporting Emojivoto
## Create the emojivoto namespace

We'll now install the Emojivoto example application into both clusters:
First, we need to create the namespace where we will deploy our application and the `TrafficSplit` resource.

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
> kubectl --context=west create ns emojivoto
> kubectl --context=east create ns emojivoto
```

## Creating the Failover TrafficSplit
Expand Down Expand Up @@ -106,6 +90,31 @@ This TrafficSplit indicates that the local (west) `web-svc` should be used as
the primary, but traffic should be shifted to the remote (east) `web-svc-east`
if the primary becomes unavailable.

## Installing and Exporting Emojivoto

We'll now install the Emojivoto example application into both clusters:

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
```

## Testing the Failover

We can use the `linkerd viz stat` command to see that the `vote-bot` traffic
Expand Down
49 changes: 29 additions & 20 deletions linkerd.io/content/2.11/tasks/automatic-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,13 @@ them in that cluster:
> helm --kube-context=west install linkerd-failover -n linkerd-failover --create-namespace --devel linkerd-edge/linkerd-failover
```

## Installing and Exporting Emojivoto
## Create the emojivoto namespace

We'll now install the Emojivoto example application into both clusters:
First, we need to create the namespace where we will deploy our application and the `TrafficSplit` resource.

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
> kubectl --context=west create ns emojivoto
> kubectl --context=east create ns emojivoto
```

## Creating the Failover TrafficSplit
Expand Down Expand Up @@ -106,6 +90,31 @@ This TrafficSplit indicates that the local (west) `web-svc` should be used as
the primary, but traffic should be shifted to the remote (east) `web-svc-east`
if the primary becomes unavailable.

## Installing and Exporting Emojivoto

We'll now install the Emojivoto example application into both clusters:

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
```

## Testing the Failover

We can use the `linkerd viz stat` command to see that the `vote-bot` traffic
Expand Down
49 changes: 29 additions & 20 deletions linkerd.io/content/2.12/tasks/automatic-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,13 @@ them in that cluster:
> helm --kube-context=west install linkerd-failover -n linkerd-failover --create-namespace --devel linkerd-edge/linkerd-failover
```

## Installing and Exporting Emojivoto
## Create the emojivoto namespace

We'll now install the Emojivoto example application into both clusters:
First, we need to create the namespace where we will deploy our application and the `TrafficSplit` resource.

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
> kubectl --context=west create ns emojivoto
> kubectl --context=east create ns emojivoto
```

## Creating the Failover TrafficSplit
Expand Down Expand Up @@ -106,6 +90,31 @@ This TrafficSplit indicates that the local (west) `web-svc` should be used as
the primary, but traffic should be shifted to the remote (east) `web-svc-east`
if the primary becomes unavailable.

## Installing and Exporting Emojivoto

We'll now install the Emojivoto example application into both clusters:

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
```

## Testing the Failover

We can use the `linkerd viz stat` command to see that the `vote-bot` traffic
Expand Down
49 changes: 29 additions & 20 deletions linkerd.io/content/2.13/tasks/automatic-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,13 @@ them in that cluster:
> helm --kube-context=west install linkerd-failover -n linkerd-failover --create-namespace --devel linkerd-edge/linkerd-failover
```

## Installing and Exporting Emojivoto
## Create the emojivoto namespace

We'll now install the Emojivoto example application into both clusters:
First, we need to create the namespace where we will deploy our application and the `TrafficSplit` resource.

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
> kubectl --context=west create ns emojivoto
> kubectl --context=east create ns emojivoto
```

## Creating the Failover TrafficSplit
Expand Down Expand Up @@ -106,6 +90,31 @@ This TrafficSplit indicates that the local (west) `web-svc` should be used as
the primary, but traffic should be shifted to the remote (east) `web-svc-east`
if the primary becomes unavailable.

## Installing and Exporting Emojivoto

We'll now install the Emojivoto example application into both clusters:

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
```

## Testing the Failover

We can use the `linkerd viz stat` command to see that the `vote-bot` traffic
Expand Down
49 changes: 29 additions & 20 deletions linkerd.io/content/2.14/tasks/automatic-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,13 @@ them in that cluster:
> helm --kube-context=west install linkerd-failover -n linkerd-failover --create-namespace --devel linkerd-edge/linkerd-failover
```

## Installing and Exporting Emojivoto
## Create the emojivoto namespace

We'll now install the Emojivoto example application into both clusters:
First, we need to create the namespace where we will deploy our application and the `TrafficSplit` resource.

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
> kubectl --context=west create ns emojivoto
> kubectl --context=east create ns emojivoto
```

## Creating the Failover TrafficSplit
Expand Down Expand Up @@ -106,6 +90,31 @@ This TrafficSplit indicates that the local (west) `web-svc` should be used as
the primary, but traffic should be shifted to the remote (east) `web-svc-east`
if the primary becomes unavailable.

## Installing and Exporting Emojivoto

We'll now install the Emojivoto example application into both clusters:

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
```

## Testing the Failover

We can use the `linkerd viz stat` command to see that the `vote-bot` traffic
Expand Down
49 changes: 29 additions & 20 deletions linkerd.io/content/2.15/tasks/automatic-failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,13 @@ them in that cluster:
> helm --kube-context=west install linkerd-failover -n linkerd-failover --create-namespace --devel linkerd-edge/linkerd-failover
```

## Installing and Exporting Emojivoto
## Create the emojivoto namespace

We'll now install the Emojivoto example application into both clusters:
First, we need to create the namespace where we will deploy our application and the `TrafficSplit` resource.

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
> kubectl --context=west create ns emojivoto
> kubectl --context=east create ns emojivoto
```

## Creating the Failover TrafficSplit
Expand Down Expand Up @@ -106,6 +90,31 @@ This TrafficSplit indicates that the local (west) `web-svc` should be used as
the primary, but traffic should be shifted to the remote (east) `web-svc-east`
if the primary becomes unavailable.

## Installing and Exporting Emojivoto

We'll now install the Emojivoto example application into both clusters:

```bash
> linkerd --context=west inject https://run.linkerd.io/emojivoto.yml | kubectl --context=west apply -f -
> linkerd --context=east inject https://run.linkerd.io/emojivoto.yml | kubectl --context=east apply -f -
```

Next we'll "export" the `web-svc` in the east cluster by setting the
`mirror.linkerd.io/exported=true` label. This will instruct the
multicluster extension to create a mirror service called `web-svc-east` in the
west cluster, making the east Emojivoto application available in the west
cluster:

```bash
> kubectl --context=east -n emojivoto label svc/web-svc mirror.linkerd.io/exported=true
> kubectl --context=west -n emojivoto get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
emoji-svc ClusterIP 10.96.41.137 <none> 8080/TCP,8801/TCP 13m
voting-svc ClusterIP 10.96.247.68 <none> 8080/TCP,8801/TCP 13m
web-svc ClusterIP 10.96.222.169 <none> 80/TCP 13m
web-svc-east ClusterIP 10.96.244.245 <none> 80/TCP 92s
```

## Testing the Failover

We can use the `linkerd viz stat` command to see that the `vote-bot` traffic
Expand Down
Loading

0 comments on commit 727c6e8

Please sign in to comment.