访问应用service-这里主要是内部访问、有点对外暴露,nodeport形式
服务发现,service可以做多端口映射,标签选择确定关联关系,除了填写的内容之外,kubernates帮助补充其他内容
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586249360858.png)
enter description here
如何对外服务的补充,没有配置默认就是clusterip,只能在集群内部访问
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586249427236.png)
enter description here
有selector的service
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586250142911.png)
enter description here
![enter description here enter description here](./images/1586250145664.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586250150185.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586250152455.png)
无selector的service怎么选择后台的
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586256224232.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586256226948.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586256230807.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586256234433.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586256237777.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586256242461.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586256246087.png)
service对外暴露服务,而不是用ingress
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257351713.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257354925.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257360071.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257369220.png)
创建一个deployment的简单方式以及服务暴露的简单方式
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257395328.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257399907.png)
创建结果以及解释
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257672881.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586257674939.png)
创建两个不同的 namespace, 在两个 namespace 下各自创建一个服务( busybox 或 curl 即可),然后从一个服务的 pod 里用域名访问另一个服务( curl 或 nslookup ) 。