kubernetes - Use of containerPort in kubernetes POD definition
问题描述
What is the use of specifying containerPort in the kubernetes POD definition ? Does it provide any extra benefit if we specify the container port in the yaml definition file ?
I observed that i can still access the port inside the container even if i omit it in POD yaml definition file.
解决方案
这是信息性的。
要从容器公开的端口列表。在此处公开端口可为系统提供有关容器使用的网络连接的附加信息,但主要是信息性的。此处不指定端口不会阻止该端口被暴露。任何侦听容器内默认“0.0.0.0”地址的端口都可以从网络访问。无法更新。
推荐阅读
- python - 用python解析一个像字符串一样的元组
- python - Pandas - 如何根据多个二进制列中的条件对比率进行分组?
- apache - JMeter - 如何从 CSV 中选择给定数量的行以在 HTTP 请求正文中发送
- javascript - Jquery 到纯 javascript
- angular - Rxjs 连接示例
- android - 原因:jarsigner.exefailed with exit code 1 : jarsigner error: java.lang.RuntimeException: keystore load: Invalid keystore format
- opencv - OpenCV 不会调整窗口大小(即使使用 WINDOW_NORMAL)
- string - Kotlin:尝试拆分多个空间时的奇怪行为
- javascript - 如何只更新一些行项目而不在 NetSuite 上保存整条记录?
- laravel - 你如何将变量传递给 Laravel 中的工厂?