官术网_书友最值得收藏!

3.1 Pod定義詳解

YAML格式的Pod定義文件的完整內容如下:

        apiVersion: v1
        kind: Pod
        metadata:
          name: string
          namespace: string
          labels:
            - name: string
          annotations:
            - name: string
        spec:
          containers:
          - name: string
            image: string
            imagePullPolicy: [Always | Never | IfNotPresent]
            command: [string]
            args: [string]
            workingDir: string
            volumeMounts:
            - name: string
              mountPath: string
              readOnly: boolean
            ports:
            - name: string
              containerPort: int
              hostPort: int
              protocol: string
            env:
            - name: string
          value: string
        resources:
          limits:
            cpu: string
            memory: string
          requests:
            cpu: string
            memory: string
        livenessProbe:
          exec:
            command: [string]
          httpGet:
            path: string
            port: number
            host: string
            scheme: string
            httpHeaders:
            - name: string
              value: string
          tcpSocket:
            port: number
          initialDelaySeconds: 0
          timeoutSeconds: 0
          periodSeconds: 0
          successThreshold: 0
          failureThreshold: 0
        securityContext:
          privileged: false
      restartPolicy: [Always | Never | OnFailure]
      nodeSelector: object
      imagePullSecrets:
    -    name: string
      hostNetwork: false
      volumes:
      - name: string
         emptyDir: {}
         hostPath:
           path: string
         secret:
           secretName: string
           items:
              - key: string
                path: string
            configMap:
              name: string
              items:
              - key: string
                path: string

對各屬性的詳細說明如表3.1所示。

表3.1 對Pod定義文件模板中各屬性的詳細說明

續表

續表

續表

主站蜘蛛池模板: 仙桃市| 昌乐县| 廉江市| 进贤县| 南部县| 太湖县| 屏南县| 石屏县| 盈江县| 嘉峪关市| 科技| 镇康县| 彭山县| 南康市| 绍兴县| 乌海市| 收藏| 巴南区| 双峰县| 衢州市| 萍乡市| 莫力| 遂川县| 高尔夫| 临清市| 外汇| 化德县| 荣昌县| 高碑店市| 冷水江市| 灵台县| 西丰县| 大邑县| 阳高县| 商河县| 宁德市| 贵港市| 和硕县| 普兰县| 新干县| 长岭县|