Headless Service 和Service
定于spec:clusterIP: None
还记得Service的Cluster IP是做什么的吗?对,一个Service可能对应多个EndPoint(Pod),client访问的是Cluster IP,通过iptables规则转到Real Server,从而达到负载均衡的效果(实现原理请见这里)。如下:
有头service
kubectl get service
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-service 10.107.124.218 192.168.128.158 /TCP,/TCP 1d
kubectl describe service nginx-service
Name: nginx-service
Namespace: default
Labels:
Selector: component=nginx
Type: ClusterIP
IP: 10.107.124.218
External IPs: 192.168.128.158
Port: nginx-http 80/TCP
Endpoints: 10.244.2.9:80
Port: nginx-https 443/TCP
Endpoints: 10.244.2.9:443
nslookup nginx-service.default.svc.cluster.local 10.96.0.10 #这个ip为k8s dns的ip
Server: 10.96.0.10
Address: 10.96.0.10#53 Name: nginx-service.default.svc.cluster.local
Address: 10.107.124.218
虽然service有2个endpoint,但是dns查询时只会返回service的地址。具体client访问的是哪个Real Server,是由iptables来决定的。
无头service
kubectl get service
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx None /TCP 1h
kubectl describe service nginx
Name: nginx
Namespace: default
Labels: app=nginx
Selector: app=nginx
Type: ClusterIP
IP: None
Port: web 80/TCP
Endpoints: 10.244.2.17:80,10.244.2.18:80 #通过web获取到pod的ip地址
nslookup nginx.default.svc.cluster.local 10.96.0.10
Server: 10.96.0.10
Address: 10.96.0.10#53 Name: nginx.default.svc.cluster.local
Address: 10.244.2.17
Name: nginx.default.svc.cluster.local
Address: 10.244.2.18
dns查询会如实的返回2个真实的endpoint
Headless Service 和Service的更多相关文章
- kubernetes中headless类型的service
目录 初识headless类型的service 开始研究headless类型的service headless类型的service之我的理解 初识headless类型的service 第一次使用ran ...
- (转)内置系统账户:Local system/Network service/Local Service 区别
最近会转载一些 MSSQL 基础相关的文章. 参考文献: http://www.cnblogs.com/xianspace/archive/2009/04/05/1429835.html 前言 今天在 ...
- SSRS2:Reporting Service 配置Service Account
1,Service Account SSRS以一个Service方式实现,有三部分组成:Web Service,Report Manager和一个后台的进程,这个Service运行的账号就是Servi ...
- Android 核心分析 之六 IPC框架分析 Binder,Service,Service manager
IPC框架分析 Binder,Service,Service manager 我首先从宏观的角度观察Binder,Service,Service Manager,并阐述各自的概念.从Linux的概念空 ...
- Local System/Network Service/Local Service
// The name of the account under which the service should run// 1 NT AUTHORITY\\SYSTEM 2 NT AUTHORIT ...
- Service(Local Service)简介
一.Service的作用 主要用于在后台处理一些耗时的逻辑操作,或者去执行某些长期运行的操作. 二.Service的创建 1.主要方法 IBinder onBind(Intent intent):必须 ...
- windows 7 memcached报failed to install service or service already installed的解决方案
今天心血来潮捣鼓一下memcache,由于系统是windows 7,我参考了 Windows下安装Memcache 使用memcached for Win32. 在运行memcached.exe -d ...
- 【Android开发日记】第一个任务Android Service!Service靴+重力感应器+弹出窗口+保持执行
前言: 近期在写一个小程序,需求是手机摇一摇就弹窗出来.第一次使用了Service,学习了两天,实现了Service弹窗,开机启动,Service启动和销毁,Service保持一直执行. 满足了自己的 ...
- win7下安装memcached出现failed to install service or service already installed解决办法
安装memcached时总是提示“failed to install service or service already installed”,开始以为是版本问题,就下了好几个不同版本,可还是老问题 ...
- [转帖]内置系统账户:Local system/Network service/Local Service 区别
内置系统账户:Local system/Network service/Local Service 区别 学习使用 xp_cmdshell 的时候 发现必须 sqlserver 的服务运行在local ...
随机推荐
- shunting-yard 调度场算法、中缀表达式转逆波兰表达式
中缀表达式 1*(2+3) 这就是一个中缀表达式,运算符在数字之间,计算机处理前缀表达式和后缀表达式比较容易,但处理中缀表达式却不太容易,因此,我们需要使用shunting-yard Algorith ...
- JAVA 11初体验
JAVA 11初体验 随着JAVA没半年发布一次新版本,前几天JAVA 11隆重登场.在JAVA 11中,增加了一些新的特性和api, 同时也删除了一些特性和api,还有一些性能和垃圾回收的改进. 作 ...
- sql server导出数据,本地数据库远程连接不上,怎样设置防火墙(自用)
控制面板——>系统安全——>windows防火墙——>高级设置 新建入站规则: 将一下两个应用 允许入站: D:\Program Files (x86)\Microsoft SQL ...
- Linux常用操作指令(面试专用)
Linux:免费开源,多用户多任务,衍生出很多附属版本,例如常用的RedHat... 常用指令 ls 显示文件或目录 -l 列出文件详细信息l(list) -a ...
- ltp-ddt nor qspi spi调试中需要修改的地方
1 blk_device_dd_readwrite_test.sh before SRC_FILE="/home/root/srctest_file_${DEVICE_TYPE}_$$&qu ...
- 推荐!PlayGround:可视化神经网络
https://cloud.tencent.com/developer/news/190352 http://playground.tensorflow.org PlayGround是一个在线演示.实 ...
- 【题解】Luogu P4198 楼房重建
原题传送门 根据斜率来建线段树,线段树维护区间最大斜率以及区间内能看见的楼房的数量(不考虑其他地方的原因,两个节点合并时再考虑) 细节见程序 #include <bits/stdc++.h> ...
- jQuery Validate和Thymeleaf相关
jQuery Validate https://www.cnblogs.com/liuhongfeng/p/5135676.html https://www.cnblogs.com/linjiqin/ ...
- Git仓库删除大文件
Git仓库删除大文件 背景 当用Git久了,难免会手误或临时添加一些大文件到仓库中,即使以后添加进了.gitignore,甚至做了git rm,但是Git为了保证版本可回退,history pack里 ...
- 生信工具汇总--OMICtools
各种生信工具: https://omictools.com/