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
posted @ 2020-07-23 22:52  名字很长容易被惦记  阅读(1870)  评论(0编辑  收藏  举报