- Kubernetes for Developers
- Joseph Heck
- 171字
- 2021-08-27 19:04:16
Proxy
Since this is an HTTP-based application, we can also use the kubectl proxy command to get access to the responses from our code:
kubectl proxy
And the output will show something akin to the following:
Starting to serve on 127.0.0.1:8001
As a reminder, you won't get a prompt back in the Terminal window until the proxy terminates. Just as with the Python example, we can determine the URL to use that the proxy will use to forward to our container based on the Pod name and the namespace that we used when invoking the kubectl run command. Since we did not specify a namespace, it used the default, which is called default. The URL pattern for accessing the Pod is the same as the Python example:
http://localhost:8001/api/v1/proxy/namespaces/<NAME_OF_NAMESPACE>/pods/<POD_NAME>/
And in the case of our Pod, this would be:
http://localhost:8001/api/v1/proxy/namespaces/default/pods/nodejs-568183341-2bw5v/
If you open a URL in your browser created with the Pod name that your Kubernetes cluster assigned, it should show you the same output that you saw using the port-forward command.
- 后稀缺:自動化與未來工作
- Dreamweaver CS3網頁制作融會貫通
- Hands-On Neural Networks with Keras
- ROS機器人編程與SLAM算法解析指南
- STM32G4入門與電機控制實戰:基于X-CUBE-MCSDK的無刷直流電機與永磁同步電機控制實現
- 80x86/Pentium微型計算機原理及應用
- 悟透AutoCAD 2009完全自學手冊
- Enterprise PowerShell Scripting Bootcamp
- Linux:Powerful Server Administration
- 啊哈C!思考快你一步
- 電腦上網入門
- HBase Essentials
- 大數據素質讀本
- Python語言從入門到精通
- 特征工程入門與實踐