1. 使用swaggui访问指定的接口(以根据名称查询l3vpn为例):

  2. 点击F12,打开监控界面,在swaggui上点击查询;

  3. 在监控界面上找到并copy对应的url:

  4. 将内容copy到nodepad++中:

curl 'https://172.171.10.30:30002/bbc/l3vpn/query?vpnName=sjktest%407516cb' \
  -H 'authority: 172.171.10.30:30002' \
  -H 'accept: application/json;charset=UTF-8' \
  -H 'accept-language: zh-CN,zh;q=0.9' \
  -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' \
  -H 'cookie: XXL_JOB_LOGIN_IDENTITY=7b226964223a312c22757365726e616d65223a2261646d696e222c2270617373776f7264223a226531306164633339343962613539616262653536653035376632306638383365222c22726f6c65223a312c227065726d697373696f6e223a6e756c6c7d; grafana_session=1dfe7667b3b9dea967f82448618216a4' \
  -H 'referer: https://172.171.10.30:30002/bbc/doc.html' \
  -H 'request-origion: SwaggerBootstrapUi' \
  -H 'sec-ch-ua: "Chromium";v="110", "Not A(Brand";v="24", "Google Chrome";v="110"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36' \
  -H 'x-requested-with: XMLHttpRequest' \
  --compressed \
  --insecure

5. 查询pod对应的IP:

![在这里插入图片描述](https://img-blog.csdnimg.cn/abfb7ddf0bab4fdbadbb4b784796f327.png)

6. 将虚ip和端口号修改为pod对应的IP和服务对应的端口号,https改为http:
![在这里插入图片描述](https://img-blog.csdnimg.cn/56bbe44d6c994251927760c4713144c1.png#pic_center)

7. 将修改后的内容,copy到pod所在的node节点上执行:
![在这里插入图片描述](https://img-blog.csdnimg.cn/bb9992e7f86046cfa94f4718bd78a620.png)

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐