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 @   liwenchao1995  阅读(77)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
点击右上角即可分享
微信分享提示