Kubernetes Networking
External IP
apiVersion: v1
kind: Service
metadata:
name: nginxstor
labels:
app: nginxstor
spec:
ports:
- name: http
protocol: TCP
#port is loadbalancer port
port: 8001
# targetport is container port
targetPort: 8000
externalIPs:
- 192.168.51.200
selector:
app: nginxstor
It only works on external IP we set with port.
onahwude-MacBook-Pro:~ jonahwu$ curl http://192.168.51.200:8001
nginxstor-3684888594-9btw5
No comments:
Post a Comment