KubernetesService与Endpoint指向外部服务

编程

--------------------------------------------------

kubectl apply -f - <<EOF

kind: Service

apiVersion: v1

metadata:

name: snake-demo-svc

namespace: base

spec:

ports:

- port: 30018

protocol: TCP

name: http

type: ClusterIP

externalIPs: [192.168.48.92]

---

kind: Endpoints

apiVersion: v1

metadata:

name: snake-demo-svc

namespace: base

subsets:

- addresses:

- ip: 192.168.32.8

ports:

- port: 8080

name: http

EOF

# kubectl describe svc snake-demo-svc -n base

# Endpoint与Service的metadata.name一致

# Endpoints.subsets[x].ports[x].name与Service.spec.ports[x].name一致

--------------------------------------------------

以上是 KubernetesService与Endpoint指向外部服务 的全部内容, 来源链接: utcz.com/z/519277.html

回到顶部