k8s pod 定义 文件 yaml

# yaml格式的pod定义文件完整内容:
apiVersion: v1       #必选,版本号,例如v1
kind: Pod       #必选,Pod
metadata:       #必选,元数据
  name: intellect1       #必选,Pod名称
  namespace: app #必选,Pod所属的命名空间
  labels:      #自定义标签
    - name: intellect1       #自定义标签名字
  annotations:       #自定义注释列表
    - name: intellect1  
spec:         #必选,Pod中容器的详细定义
  containers:      #必选,Pod中容器列表
  - name: intellect1     #必选,容器名称
    image: 192.168.190.126:5000/app/intellect:latest    #必选,容器的镜像名称
    imagePullPolicy: Always    
    ports:       #需要暴露的端口库号列表
    - name: P3000     #端口号名称
      containerPort: 3000   #容器需要监听的端口号
      hostPort: 31300    #容器所在主机需要监听的端口号,默认与Container相同
      protocol: TCP     #端口协议,支持TCP和UDP,默认TCP
原文地址:https://www.cnblogs.com/Leechg/p/14303899.html