Skip to content

Commit

Permalink
change to refs, fix ci error (#7346)
Browse files Browse the repository at this point in the history
* change to refs, fix ci error

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>

* Fix port

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>

* Create/delete control-plane directory

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
  • Loading branch information
ThetaDR authored Sep 19, 2022
1 parent 219d42c commit bdb03c0
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions examples/interdomain/nsm_kuma_universal_vl3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
## Run
1. Start vl3
```bash
kubectl --kubeconfig=$KUBECONFIG1 apply -k ./vl3-dns
kubectl --kubeconfig=$KUBECONFIG1 -n ns-dns-vl3 wait --for=condition=ready --timeout=2m pod -l app=vl3-ipam
kubectl --kubeconfig=$KUBECONFIG1 apply -k https://github.com/networkservicemesh/deployments-k8s/examples/interdomain/nsm_kuma_universal_vl3/vl3-dns?ref=8c7217843c12ffeb9eee8e6ba5ac916c7e475f18
kubectl --kubeconfig=$KUBECONFIG1 -n ns-dns-vl3 wait --for=condition=ready --timeout=5m pod -l app=vl3-ipam
```

2. Install kumactl
Expand All @@ -28,7 +28,21 @@ kumactl generate tls-certificate --hostname=control-plane-kuma.my-vl3-network --
cp ./tls.crt ./ca.crt
```
```bash
kubectl --kubeconfig=$KUBECONFIG1 apply -f namespace.yaml
mkdir -p control-plane
cat > ./control-plane/kustomization.yaml <<EOF
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- control-plane.yaml
patchesStrategicMerge:
- https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/8c7217843c12ffeb9eee8e6ba5ac916c7e475f18/examples/interdomain/nsm_kuma_universal_vl3/control-plane/patch-control-plane.yaml
EOF
```
```bash
kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/8c7217843c12ffeb9eee8e6ba5ac916c7e475f18/examples/interdomain/nsm_kuma_universal_vl3/namespace.yaml
kubectl --kubeconfig=$KUBECONFIG1 create secret generic general-tls-certs --namespace=kuma-system --from-file=./tls.key --from-file=./tls.crt --from-file=./ca.crt
```
```bash
Expand All @@ -42,36 +56,34 @@ kubectl --kubeconfig=$KUBECONFIG1 apply -k ./control-plane

5. Start redis database with the sidecar on the first cluster
```bash
kubectl --kubeconfig=$KUBECONFIG1 apply -f demo-redis.yaml
kubectl --kubeconfig=$KUBECONFIG1 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/8c7217843c12ffeb9eee8e6ba5ac916c7e475f18/examples/interdomain/nsm_kuma_universal_vl3/demo-redis.yaml
kubectl --kubeconfig=$KUBECONFIG1 -n kuma-demo wait --for=condition=ready --timeout=3m pod -l app=redis
```

6. Start counter page with the sidecar on the second cluster
```bash
kubectl --kubeconfig=$KUBECONFIG2 apply -f demo-app.yaml
kubectl --kubeconfig=$KUBECONFIG2 apply -f https://raw.githubusercontent.com/networkservicemesh/deployments-k8s/8c7217843c12ffeb9eee8e6ba5ac916c7e475f18/examples/interdomain/nsm_kuma_universal_vl3/demo-app.yaml
kubectl --kubeconfig=$KUBECONFIG2 -n kuma-demo wait --for=condition=ready --timeout=3m pod -l app=demo-app
```


7. Forward ports to open counter page
```bash
kubectl --kubeconfig=$KUBECONFIG2 port-forward svc/demo-app -n kuma-demo 5000:5000 &
```
```bash
response=$(curl -X POST localhost:5000/increment)
kubectl --kubeconfig=$KUBECONFIG2 port-forward svc/demo-app -n kuma-demo 8081:5000 &
```

8. Check the response for no errors
8. Send the request and check the response for no errors
```bash
response=$(curl -X POST localhost:8081/increment)
echo $response | grep '"err":null'
```

You can also go to [locahost:5000](https://localhost:5000) to get the counter page and test the application yourself.

## Cleanup
```bash
pkill -f "port-forward"
kubectl --kubeconfig=$KUBECONFIG1 delete ns kuma-system kuma-demo ns-dns-vl3
kubectl --kubeconfig=$KUBECONFIG2 delete ns kuma-demo
rm tls.crt tls.key ca.crt
rm -rf kuma-1.7.0
rm -rf kuma-1.7.0 control-plane
```

0 comments on commit bdb03c0

Please sign in to comment.