service资源

-
2024-07-10
apiVersion: v1
kind: Service
metadata:
    name: sev-web
    labels:
        type: web
spec:
    selector:
        type: nginx
        sev: web
    type: ClusterIP
    ports:
    - port: 88
      targetPort: 80
      protocol: TCP
  	clusterIP: 10.200.100.200    
---
apiVersion: v1
kind: Pod
metadata:
    name: web1
    labels:
        type: nginx
        sev: web
spec:
    containers:
        - name: web1
          image: nginx
---
apiVersion: v1
kind: Pod
metadata:
    name: web2
    labels:
        type: nginx
        sev: web
spec:
    containers:
        - name: web2
          image: nginx

        四种类型:
            - ClusterIP
            - NodePort
            - ExternalName
            - LoadBalancer

 


苗世雷
地势坤君子厚德载物
公告

记录和学习
最新评论

加载中...