k8s yaml服务转发

服务转发

1.1 服务转发

kind: Service
apiVersion: v1
metadata:
  name: msyql
  namespace: middleware
spec:
  ports:
  - port: 80
    protocol: TCP
    name: http
  type: ClusterIP
---
kind: Endpoints
apiVersion: v1
metadata: 
  name: msyql
  namespace: middleware
subsets:
- addresses:
  - ip: 192.168.58.118
  ports:
   - port: 3306
     protocol: TCP
     name: http
---
kind: Service
apiVersion: v1
metadata:
  name: redis
  namespace: middleware
spec:
  ports:
  - port: 80
    protocol: TCP
    name: http
  type: ClusterIP
---
kind: Endpoints
apiVersion: v1
metadata: 
  name: redis
  namespace: middleware
subsets:
- addresses:
  - ip: 192.168.58.118
  ports:
   - port: 6379
     protocol: TCP
     name: http
---
kind: Service
apiVersion: v1
metadata:
  name: elasticsearch
  namespace: middleware
spec:
  ports:
  - port: 80
    protocol: TCP
    name: http
  type: ClusterIP
---
kind: Endpoints
apiVersion: v1
metadata: 
  name: elasticsearch
  namespace: middleware
subsets:
- addresses:
  - ip: 192.168.58.121
  ports:
   - port: 9200
     name: http
---
kind: Service
apiVersion: v1
metadata:
  name: minio
  namespace: middleware
spec:
  ports:
  - port: 80
    protocol: TCP
    name: http
  type: ClusterIP
---
kind: Endpoints
apiVersion: v1
metadata: 
  name: minio
  namespace: middleware
subsets:
- addresses:
  - ip: 192.168.58.121
  ports:
   - port: 9000
     protocol: TCP
     name: http
---
kind: Service
apiVersion: v1
metadata:
  name: rocketmq
  namespace: middleware
spec:
  ports:
  - port: 80
    protocol: TCP
    name: http
  type: ClusterIP
---
kind: Endpoints
apiVersion: v1
metadata: 
  name: rocketmq
  namespace: middleware
subsets:
- addresses:
  - ip: 192.168.58.126
  ports:
   - port: 9876
     protocol: TCP 
     name: http
---
kind: Service
apiVersion: v1
metadata:
  name: fastdfs
  namespace: middleware
spec:
  ports:
  - port: 80
    protocol: TCP
    name: http
  type: ClusterIP
---
kind: Endpoints
apiVersion: v1
metadata: 
  name: fastdfs
  namespace: middleware
subsets:
- addresses:
  - ip: 192.168.58.121
  ports:
   - port: 22122
     protocol: TCP
     name: http
posted @ 2022-07-05 15:25  liwenchao1995  阅读(75)  评论(0编辑  收藏  举报