k8s 外部ip定义

apiVersion: v1
kind: Service
metadata:
  name: xinxi-azure-svc
  namespace: jituan-xinxi-be

spec:
  ports:
    - name: xinxi-azure-port
      port: 443
      protocol: TCP
      targetPort: 38455
  type: ClusterIP

---
apiVersion: v1
kind: Endpoints
metadata:
  name: xinxi-azure-svc         
  namespace: jituan-xinxi-be
subsets:
- addresses:
  - ip: 14.13.21.66                                  
  ports:
  - port: 38455                                                 
    name: xinxi-azure-port                              
    protocol: TCP

  

参考:https://blog.csdn.net/MssGuo/article/details/127299044

posted @ 2023-11-07 18:40  大川哥  阅读(26)  评论(0编辑  收藏  举报