k8s Deployment與Service配置樣例


一、Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: pie-algorithm-farmland-detection
spec:
  replicas: 1
  selector:
    matchLabels:
      name: pie-algorithm-farmland-detection
  template:
    metadata:
      labels:
        name: pie-algorithm-farmland-detection
    spec:
      containers:
        - name: task-status
          image: 172.16.40.78:1180/pie-algorithms/pie-algorithm-farmland-detection:latest
          imagePullPolicy: IfNotPresent
          ports:
          - containerPort: 19092
          volumeMounts:
          - name: pie-algorithm-farmland-detection
            mountPath: /usr/seis/data/user/admin/test/
      volumes:
      - name: pie-algorithm-farmland-detection
        nfs:
          server: 172.16.40.247
          path: /FS/piecloud/MapData/test/

 

二、Service

apiVersion: v1
kind: Service
metadata:
  name: pie-algorithm-farmland-detection
spec:
  type: NodePort
  ports:
  - port: 19092
    targetPort: 19092
    nodePort: 30902
  selector:
    name: pie-algorithm-farmland-detection

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM