k8s 外部ip定义

发布时间 2023-11-07 18:43:49作者: 大川哥
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