kdeng / my-blogs

Kefeng's blogs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A service points to an external IP

kdeng opened this issue · comments

This is a service definition, which creates a service in LB type, and points the service to an external IP.

---
apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 8080
  type: LoadBalancer
---
apiVersion: v1
kind: Endpoints
metadata:
  name: my-service
subsets:
- addresses:
  - ip: xxx.xxx.xxx.xxx
  ports:
  - name: http
    port: 8080
    protocol: TCP