k8s映射外部服务Endpoints

直接贴yaml,自己修改

apiVersion: v1
kind: Service
metadata:
  name: mysql-production
  namespace: mytest
spec:
  type: NodePort
  ports:
    - port: 3306
      targetPort: 3306
      nodePort: 31000
---
kind: Endpoints
apiVersion: v1
metadata:
  name: mysql-production
  namespace: mytest
subsets:
  - addresses:
      - ip: 192.168.2.22
    ports:
      - port: 3306
--------------------------------------------------------- 恐惧是因为努力的还不够,加油 ~~---------------------------------------------
原文地址:https://www.cnblogs.com/zhaobowen/p/13369381.html