标签:nts 其他 lpm main docke 客户 affinity lin some
apiVersion: v1
kind: Service
metadata:
name: kubia
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: kubia
apiVersion: v1
kind: Service
metadata:
name: kubia
spec:
sessionAffinity: ClientIP
apiVersion: v1
kind: Service
metadata:
name: kubia
spec:
ports:
- name: http
port: 80
targetPort: 8080
- name: https
port: 443
target: 8443
selector:
app: kubia
kind: Pod
metadata:
name: kubia
spec:
containers:
- name: kubia
ports:
- name: http
containerPort: 8080
- name: https
containerPort: 8443
apiVersion: v1
kind: Service
spec:
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: https
selector:
app: kubia
apiVersion: v1
kind: Service
metadata:
name: external-service
spec:
ports:
- port: 80
apiVersion: v1
kind: Endpoints
metadata:
name: external-service 这里的名称一定和service的一致
subsets:
- addresses:
- ip: 1.1.1.1
- ip: 2.2.2.2
ports:
- port: 80 这里的port是endpoint的目标端口,是service中的targetPort
apiVersion: v1
kind: Service
matedata:
name: external-service
spec:
type: ExternalName 代码的type被设置成ExternalName
externalName: someapi.somecompany.com 实际服务的完全限定名
ports:
- port: 80
标签:nts 其他 lpm main docke 客户 affinity lin some
原文地址:https://www.cnblogs.com/zhming26/p/11719499.html