Skip to content

Commit

Permalink
Merge pull request #1434 from aFlyBird0/fix-e2e-gitlabci-argocd
Browse files Browse the repository at this point in the history
ci: fix e2e test && argocdapp svc port in gitops docs
  • Loading branch information
daniel-hutao authored Jan 13, 2023
2 parents 0e335c4 + ab3ba9b commit e06ea23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ jobs:
- name: test 2 - check if pod is ready
run: while [[ $(kubectl get pods -l app=dtm-e2e-go -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "pod not ready yet..."; sleep 3; done
timeout-minutes: 10
- name: test 2 - check flask app can be reached
- name: test 2 - check gin app can be reached
run: |
# get cluster ip of the service created by the argocd
clusterIP=$(kubectl get svc dtm-e2e-go -n default -o jsonpath='{.spec.clusterIP}')
# curl flask url and check if it returns "Hello, World!", if not, echo error and exit 1
curl -s http://$clusterIP:8080 | grep "Hello, World!" || (echo "failed to access to flask app" && exit 1)
# curl gin url and check if it returns content which contains "Blue Train", if not, echo error and exit 1
curl -s http://$clusterIP:8080/albums/1 | grep "Blue Train" || (echo "failed to access to gin app" && exit 1)
- name: test 2 - clean
run: ./dtm delete -f e2e-apps.yaml -y
# test3 is gitlabci-argocd
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/gitops/2-gitops-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ NAME READY STATUS RESTARTS AGE
helloworld-69b5586b94-wjwd9 1/1 Running 0 5m18s
tiexin@mbp ~/work/devstream-io/test $ kubectl get services -n default
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
helloworld ClusterIP 10.96.73.97 <none> 80/TCP 5m27s
helloworld ClusterIP 10.96.73.97 <none> 8080/TCP 5m27s
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 8m2s
```

If you do a port-forwarding:

```bash
kubectl port-forward -n default svc/helloworld 8080:80
kubectl port-forward -n default svc/helloworld 8080:8080
```

And accesses `localhost:8080` in your browser, you can see the deployed app return a "Hello, World!" to you. Hooray!
Expand Down
4 changes: 2 additions & 2 deletions docs/use-cases/gitops/2-gitops-tools.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ NAME READY STATUS RESTARTS AGE
helloworld-69b5586b94-wjwd9 1/1 Running 0 5m18s
tiexin@mbp ~/work/devstream-io/test $ kubectl get services -n default
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
helloworld ClusterIP 10.96.73.97 <none> 80/TCP 5m27s
helloworld ClusterIP 10.96.73.97 <none> 8080/TCP 5m27s
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 8m2s
```
我们可以通过端口转发来访问这个应用:
```bash
kubectl port-forward -n default svc/helloworld 8080:80
kubectl port-forward -n default svc/helloworld 8080:8080
```
在浏览器中访问 `localhost:8080`,你可以看到应用返回了一个 "Hello, World!"。大功告成!
Expand Down

0 comments on commit e06ea23

Please sign in to comment.