更新README.md

This commit is contained in:
120L021230 2022-07-17 16:42:38 +08:00
parent ea0102b264
commit 15c3da3aad
5 changed files with 35 additions and 0 deletions

BIN
Picture/deletepage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
Picture/getpage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
Picture/homepage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
Picture/putpage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -32,6 +32,16 @@ cd PCGBigHomeworkClient
go run main.go
```
### 运行截图
![homepage](https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/TPCGJYProject/120L021230_chenbogeng/raw?filepath=Picture/homepage.png&ref=master)
![getpage](https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/TPCGJYProject/120L021230_chenbogeng/raw?filepath=Picture/getpage.png&ref=master)
![putpage](https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/TPCGJYProject/120L021230_chenbogeng/raw?filepath=Picture/putpage.png&ref=master)
![deletepage](https://www.gitlink.org.cn/attachments/entries/get_file?download_url=https://www.gitlink.org.cn/api/TPCGJYProject/120L021230_chenbogeng/raw?filepath=Picture/deletepage.png&ref=master)
## 镜像 & Minikube配置文件
### 简介
@ -71,3 +81,28 @@ Minikube配置文件放在了repo根目录下文件名为`k8s.yml`
kubectl apply -f k8s.yml
```
### 验证工作正常
```bash
ubuntu@VM-0-10-ubuntu:~$ kubectl get pod
NAME READY STATUS RESTARTS AGE
client-66554d7ffd-4znrb 1/1 Running 0 175m
client-66554d7ffd-59kcq 1/1 Running 0 175m
client-66554d7ffd-kgf5j 1/1 Running 0 176m
server-5fb78c447-mtcxq 1/1 Running 0 5h5m
ubuntu@VM-0-10-ubuntu:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
afbc3c8c2c1c gcr.io/k8s-minikube/kicbase:v0.0.32 "/usr/local/bin/entr…" 5 hours ago Up 5 hours 127.0.0.1:49162->22/tcp, 127.0.0.1:49161->2376/tcp, 127.0.0.1:49160->5000/tcp, 127.0.0.1:49159->8443/tcp, 127.0.0.1:49158->32443/tcp minikube
# 这里印证了上方提到的“节点是minikube通过一个docker容器模拟出来的”这一观点。因而只有先进入该容器节点才能通过指定的节点的30080端口访问客户端服务。
ubuntu@VM-0-10-ubuntu:~$ docker exec -it minikube bash
root@minikube:/# curl -d 'type=1&name=WangWang' -X POST localhost:30080/put
{"code":0,"message":"success","pet":{"pet_type":1,"pet_id":"11","name":"WangWang","created_at":{"year":2022,"month":7,"day":17,"hours":8,"minutes":32,"seconds":14,"nanos":566029499,"TimeOffset":null}}}
root@minikube:/# curl localhost:30080/get?id=11
{"code":0,"message":"success","pet":{"pet_type":1,"pet_id":"11","name":"WangWang","created_at":{"year":2022,"month":7,"day":17,"hours":8,"minutes":32,"seconds":14,"nanos":566029499,"TimeOffset":null}}}
root@minikube:/# curl -d 'id=11' -X POST localhost:30080/delete
{"code":0,"message":"success"}
# 各接口服务正常,与服务端之间的连接正常。
```